@xfuel/verify 0.3.5 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +82 -269
  3. package/cli.js +40 -0
  4. package/index.cjs +8 -0
  5. package/index.d.ts +5 -0
  6. package/index.js +7 -0
  7. package/package.json +61 -67
  8. package/dist/anchor-trust.d.ts +0 -129
  9. package/dist/anchor-trust.d.ts.map +0 -1
  10. package/dist/anchor-trust.js +0 -395
  11. package/dist/anchor-trust.js.map +0 -1
  12. package/dist/anchor-witness.d.ts +0 -265
  13. package/dist/anchor-witness.d.ts.map +0 -1
  14. package/dist/anchor-witness.js +0 -818
  15. package/dist/anchor-witness.js.map +0 -1
  16. package/dist/base-payer.d.ts +0 -65
  17. package/dist/base-payer.d.ts.map +0 -1
  18. package/dist/base-payer.js +0 -222
  19. package/dist/base-payer.js.map +0 -1
  20. package/dist/binding.d.ts +0 -52
  21. package/dist/binding.d.ts.map +0 -1
  22. package/dist/binding.js +0 -80
  23. package/dist/binding.js.map +0 -1
  24. package/dist/canonical-preimage.d.ts +0 -9
  25. package/dist/canonical-preimage.d.ts.map +0 -1
  26. package/dist/canonical-preimage.js +0 -25
  27. package/dist/canonical-preimage.js.map +0 -1
  28. package/dist/carry-forward.d.ts +0 -79
  29. package/dist/carry-forward.d.ts.map +0 -1
  30. package/dist/carry-forward.js +0 -184
  31. package/dist/carry-forward.js.map +0 -1
  32. package/dist/cli.d.ts +0 -19
  33. package/dist/cli.d.ts.map +0 -1
  34. package/dist/cli.js +0 -1534
  35. package/dist/cli.js.map +0 -1
  36. package/dist/epoch.d.ts +0 -143
  37. package/dist/epoch.d.ts.map +0 -1
  38. package/dist/epoch.js +0 -352
  39. package/dist/epoch.js.map +0 -1
  40. package/dist/head-binding.d.ts +0 -24
  41. package/dist/head-binding.d.ts.map +0 -1
  42. package/dist/head-binding.js +0 -61
  43. package/dist/head-binding.js.map +0 -1
  44. package/dist/index.d.ts +0 -574
  45. package/dist/index.d.ts.map +0 -1
  46. package/dist/index.js +0 -1627
  47. package/dist/index.js.map +0 -1
  48. package/dist/issuer-history.d.ts +0 -110
  49. package/dist/issuer-history.d.ts.map +0 -1
  50. package/dist/issuer-history.js +0 -348
  51. package/dist/issuer-history.js.map +0 -1
  52. package/dist/issuer-pin.d.ts +0 -126
  53. package/dist/issuer-pin.d.ts.map +0 -1
  54. package/dist/issuer-pin.js +0 -567
  55. package/dist/issuer-pin.js.map +0 -1
  56. package/dist/jcs.d.ts +0 -8
  57. package/dist/jcs.d.ts.map +0 -1
  58. package/dist/jcs.js +0 -64
  59. package/dist/jcs.js.map +0 -1
  60. package/dist/jws.d.ts +0 -46
  61. package/dist/jws.d.ts.map +0 -1
  62. package/dist/jws.js +0 -129
  63. package/dist/jws.js.map +0 -1
  64. package/dist/payer.d.ts +0 -65
  65. package/dist/payer.d.ts.map +0 -1
  66. package/dist/payer.js +0 -148
  67. package/dist/payer.js.map +0 -1
  68. package/dist/preimage.d.ts +0 -78
  69. package/dist/preimage.d.ts.map +0 -1
  70. package/dist/preimage.js +0 -363
  71. package/dist/preimage.js.map +0 -1
  72. package/dist/receipt-lane.d.ts +0 -235
  73. package/dist/receipt-lane.d.ts.map +0 -1
  74. package/dist/receipt-lane.js +0 -446
  75. package/dist/receipt-lane.js.map +0 -1
  76. package/dist/receipt-version.d.ts +0 -92
  77. package/dist/receipt-version.d.ts.map +0 -1
  78. package/dist/receipt-version.js +0 -323
  79. package/dist/receipt-version.js.map +0 -1
  80. package/dist/refusal.d.ts +0 -93
  81. package/dist/refusal.d.ts.map +0 -1
  82. package/dist/refusal.js +0 -249
  83. package/dist/refusal.js.map +0 -1
  84. package/dist/request-binding.d.ts +0 -7
  85. package/dist/request-binding.d.ts.map +0 -1
  86. package/dist/request-binding.js +0 -26
  87. package/dist/request-binding.js.map +0 -1
  88. package/dist/row-hash.d.ts +0 -22
  89. package/dist/row-hash.d.ts.map +0 -1
  90. package/dist/row-hash.js +0 -26
  91. package/dist/row-hash.js.map +0 -1
  92. package/dist/shell.d.ts +0 -65
  93. package/dist/shell.d.ts.map +0 -1
  94. package/dist/shell.js +0 -268
  95. package/dist/shell.js.map +0 -1
  96. package/dist/solana-payer.d.ts +0 -99
  97. package/dist/solana-payer.d.ts.map +0 -1
  98. package/dist/solana-payer.js +0 -258
  99. package/dist/solana-payer.js.map +0 -1
  100. package/dist/v11-receipt.d.ts +0 -23
  101. package/dist/v11-receipt.d.ts.map +0 -1
  102. package/dist/v11-receipt.js +0 -368
  103. package/dist/v11-receipt.js.map +0 -1
package/README.md CHANGED
@@ -1,269 +1,82 @@
1
- # @xfuel/verify
2
-
3
- Offline verification for Chit402 receipts — verify payment binding and output commitment without calling the API.
4
-
5
- npm: `@xfuel/verify` · License: Apache-2.0 · Docs: https://chit402.com
6
-
7
- ## Installation
8
-
9
- ```bash
10
- npm install @xfuel/verify
11
- ```
12
-
13
- ## Usage
14
-
15
- ### Library
16
-
17
- ```typescript
18
- import { verifyReceipt, verifyBinding, verifyNullifier } from '@xfuel/verify';
19
-
20
- // Verify a receipt offline (binding only, no network)
21
- const receipt = { /* Chit402 receipt JSON */ };
22
- const result = verifyBinding(receipt);
23
- console.log(result.matches); // true if binding verified
24
-
25
- // Full verification including on-chain nullifier check
26
- const fullResult = await verifyReceipt(receipt, { checkNullifier: true });
27
- console.log(fullResult.overall); // 'verified' | 'partial' | 'failed'
28
- console.log(fullResult.receipt_lane.freeze); // unsigned; does not change overall
29
- ```
30
-
31
- ### CLI
32
-
33
- ```bash
34
- # Local binding verification.
35
- # Issuer history is fetched unless you pass --issuer-history-file or --no-issuer-history.
36
- # A payload v10 receipt fails offline (exit 1) when that fetch cannot run.
37
- npx xfuel-verify receipt.json
38
-
39
- # Explicit offline. --no-issuer-history skips the kid window.
40
- npx xfuel-verify receipt.json --no-issuer-history
41
-
42
- # Hash the canonical object (must match signed payload_hash) and read not_after
43
- # from a pinned issuer-history snapshot. Both flags are offline.
44
- npx xfuel-verify receipt.json --canonical-preimage preimage.json --issuer-history-file issuer-history.json
45
-
46
- # A signed refusal (schema chit402.refusal.v1) is not a payment.
47
- # The check proves the issuer refused, at the signed anchor, for that code.
48
- # It does not prove a payment or that the block still stands.
49
- npx xfuel-verify refusal.json
50
-
51
- # With on-chain nullifier check (requires network)
52
- npx xfuel-verify receipt.json --check-nullifier
53
-
54
- # Output as JSON
55
- npx xfuel-verify receipt.json --json
56
-
57
- # From stdin
58
- curl -s https://api.chit402.com/receipt/task-123?format=json | npx xfuel-verify -
59
-
60
- # Dual anchor: inclusion, Solana memo, Base calldata
61
- npx xfuel-verify receipt.json inclusion.json head.json --rpc
62
- ```
63
-
64
- ## What This Verifies
65
-
66
- | Check | Requires Network? | Description |
67
- |-------|-------------------|-------------|
68
- | Payment binding | No | Recompute commitment from receipt fields |
69
- | Issuer signature | No, unless `--fetch-jwks` | ES256. Trusted only via JWKS (by kid) or a pinned RFC 7638 kid |
70
- | Output hash | No | Hash is on the receipt |
71
- | On-chain settlement | Yes | Query Base RPC for tx |
72
- | Nullifier anchor | Yes | Query ZKVerifierSP1 contract |
73
- | Tree head and inclusion | No | Head ES256 signature over size and root, then an index-and-size-bound inclusion proof |
74
- | Anchored receipt root | Yes, with `--rpc` | The offline head and inclusion checks, then Solana memo and fee payer and Base calldata and sender |
75
- | Canonical preimage | No | SHA-256 of `--canonical-preimage`, or the stored canonical object, matches signed `payload_hash` |
76
- | Issuer history | Yes, unless `--no-issuer-history` or `--issuer-history-file` | `iat` is inside the kid's `not_before` / `not_after`. A payload v10 pin must match the snapshot hash. Offline v10 fails if the fetch cannot run |
77
-
78
- ## Issuer Signature Verification (ES256)
79
-
80
- Receipts include `issuer_signature.jws` (compact ES256 / P-256). The signature
81
- counts only when the verifying key is trusted:
82
-
83
- 1. **JWKS by kid** — a key in `--jwks-file`, `--jwks-url`, or `--fetch-jwks`
84
- (allowlisted host, default `api.chit402.com`) whose `kid` matches the JWS.
85
- 2. **Pinned thumbprint** — the embedded `issuer_jwk` is used only when its
86
- RFC 7638 thumbprint equals a trusted kid. The default offline pin is the
87
- production kid `IvFpmC-vPhkY_v0vidsrWVT9uzlE5XWKZgAEOeJTq1Q`. Override with
88
- `--trusted-kid`, or disable with `--no-trusted-kid`.
89
-
90
- The epoch record and the tree head use those same sources, with or without `--rpc`. `xfuel-verify receipt.json inclusion.json head.json` checks the head signature and the inclusion proof offline. `--rpc` adds the chain checks. An embedded key still has to match the trusted-kid pin, or the kid has to be in a verified issuer-history entry. The head's signed `anchors.base.from` and `anchors.solana.fee_payer` must be on the anchor-wallet list (the package pin, or a verified `/.well-known/anchor-wallets.json`). The chain sender and fee payer must be those wallets. `--version` prints the package version.
91
-
92
- Anchor mode also checks a content-addressed issuer pin when the receipt or the head carries `issuer_key_pin`, or when you pass `--issuer-pin`. The pin is a 40-hex commit plus the SHA-256 of `docs/well-known/issuer-key.json`. A branch name is not fetched. A claimed pin requires `issuer_signature.jws` verified under that key. Unsigned envelope kids do not satisfy the check. The registration self-signature is checked when the file has one. A claimed era with no pin fails `ISSUER_PIN_DOWNGRADE`. Receipts that do not claim the era skip this check. The pin chain is Base Sepolia (`eip155:84532`). See [issuer-key-pin.md](../../docs/product/issuer-key-pin.md).
93
-
94
- `issuer_jwk` on the receipt is not a trust root. A copy re-signed with an
95
- arbitrary P-256 key reports `key untrusted` (`issuer_signature.valid === false`),
96
- including when `--jwks-file` points at the real JWKS.
97
-
98
- ```bash
99
- # Explicit offline. The default command fetches issuer history.
100
- npx xfuel-verify receipt.json --no-issuer-history
101
-
102
- # Recompute a published canonical preimage and check the kid window.
103
- # curl -f stops on HTTP errors. Most receipts have no /preimage (a 404).
104
- # A missing preimage is not a verification failure: omit --canonical-preimage.
105
- curl -fsS "https://api.chit402.com/receipt/RECEIPT_ID?format=json" -o receipt.json
106
- curl -fsS "https://api.chit402.com/.well-known/issuer-history.json?version=1" -o issuer-history.json
107
- if curl -fsS "https://api.chit402.com/receipt/RECEIPT_ID/preimage" -o preimage.json; then
108
- npx xfuel-verify receipt.json --canonical-preimage preimage.json --issuer-history-file issuer-history.json
109
- else
110
- npx xfuel-verify receipt.json --issuer-history-file issuer-history.json
111
- fi
112
-
113
- # Trust the published JWKS instead of (or in addition to) the pin
114
- curl -o issuer-jwks.json https://api.chit402.com/.well-known/jwks.json
115
- npx xfuel-verify receipt.json --jwks-file issuer-jwks.json --no-trusted-kid
116
-
117
- # Fetch the issuer JWKS (https://api.chit402.com/.well-known/jwks.json)
118
- npx xfuel-verify receipt.json --fetch-jwks
119
- ```
120
-
121
- ```typescript
122
- import { verifyReceipt } from '@xfuel/verify';
123
-
124
- const result = await verifyReceipt(receipt);
125
- console.log(result.issuer_signature.valid); // true only for a trusted key
126
- console.log(result.issuer_signature.key_trusted);
127
- console.log(result.amount_usdc); // from verified claims, not the outer copy
128
- console.log(result.claim_mismatches); // any signed path whose outer copy disagrees
129
- console.log(result.unsigned_fields); // outer paths the signature does not cover
130
- console.log(result.verified_scope); // 'signed_claims'
131
- ```
132
-
133
- Amount, payer, payee, asset, and tx are read from the verified JWS claims.
134
- Every signed path is compared with the outer receipt. A mismatch fails.
135
- Paths the signature does not cover are `unsigned_fields` and are printed as
136
- `UNVERIFIED`. Overall does not verify them. The outer document `schema` is
137
- not a copy of the JWS `schema`. `--check-payer` on Base confirms payer, payee,
138
- asset, and amount in the USDC `Transfer` log.
139
-
140
- `xfuel-verify receipt.json inclusion.json head.json` also runs those receipt
141
- checks. A matching inclusion proof does not make a tampered receipt VERIFIED.
142
-
143
- A paid USDC receipt whose signed `binding.expected_commitment` is null is
144
- reported as “No payment-binding commitment”, not as an unmetered or TFUEL receipt.
145
-
146
- The CLI does **not** fetch JWKS unless `--fetch-jwks` or `--jwks-url` is set.
147
- Exit code 1 is returned when the key is untrusted, the signature is invalid, or
148
- a signed claim disagrees with the outer copy.
149
-
150
- ## Frozen Fields
151
-
152
- These fields are immutable once set and verifiable by any third party:
153
-
154
- - `task_id` — unique task identifier
155
- - `route.provider` — compute hub (theta-edgecloud, akash-network)
156
- - `route.model` — model that served the request
157
- - `payment.gross_amount` — total charged in USDC atomic units
158
- - `payment.ref` — settlement reference (network:txHash)
159
- - `output.hash` — commitment to model output
160
- - `proof.nullifier` — single-use nullifier anchored on-chain
161
-
162
- ## Verification Algorithm
163
-
164
- The binding commitment is computed as:
165
-
166
- ```solidity
167
- // Payment-only binding
168
- keccak256(abi.encodePacked(
169
- keccak256(payment_ref),
170
- keccak256(task_id),
171
- rail_discriminant, // 1=usdc, 2=tfuel
172
- amount
173
- ))
174
-
175
- // PBR (Payment-Bound Receipt) — includes model + output
176
- keccak256(abi.encodePacked(
177
- keccak256(payment_ref),
178
- keccak256(task_id),
179
- rail_discriminant,
180
- amount,
181
- model_commitment,
182
- output_hash
183
- ))
184
- ```
185
-
186
- This matches `SP1ProofHooks.computePaymentCommitment` on-chain.
187
-
188
- ## Exit Codes (CLI)
189
-
190
- | Code | Meaning |
191
- |------|---------|
192
- | 0 | Verified |
193
- | 1 | Verification failed |
194
- | 2 | Partial (binding ok, nullifier not checked) |
195
- | 3 | Input error |
196
-
197
- `unsupported_version` uses exit 1. No flag (`--check-payer`, `--rpc`, `--fetch-jwks`, `--no-issuer-history`, `--no-preimage`, `--no-trusted-kid`, `--accept-shell`) turns an unknown version into a pass. The check runs before any chain RPC.
198
-
199
- ## Receipt versions
200
-
201
- The signed JWS payload is the version. It is an exact JSON number. Strings, booleans, arrays, null, and non-integers are `unsupported_version`. `11.0` and `1.1e1` are the number 11.
202
-
203
- | Signed field | Accepted |
204
- |---|---|
205
- | `v` | `11`, and the claims must not contain `payload_version` |
206
- | `payload_version` | integers `1` through `10`, and `11` only when `issuer_root` is signed |
207
- | refusal `payload_version` | integers `1`, `2`, `3` |
208
- | neither field | outer version `4` or `5`, and no field introduced at v6 or later (`version_source: inferred`) |
209
-
210
- An outer `v` or `issuer_signature.payload_version` that differs in value or type is `version_mismatch`. A `v` or `payload_version` in the JWS protected header is ignored.
211
-
212
- Receipts issued after 2026-10-08 require `@xfuel/verify` >= 0.3.5. Older versions may print VERIFIED for formats they do not understand. `--help` and `--version` print this list.
213
-
214
- ## API Reference
215
-
216
- ### `verifyBinding(receipt)`
217
-
218
- Verify payment binding locally. Returns:
219
-
220
- ```typescript
221
- {
222
- verified: boolean;
223
- expected: string | null;
224
- recomputed: string | null;
225
- matches: boolean;
226
- covers: string[];
227
- reason?: string;
228
- }
229
- ```
230
-
231
- ### `verifyNullifier(receipt, options?)`
232
-
233
- Verify nullifier is anchored on-chain. Requires network access.
234
-
235
- ```typescript
236
- {
237
- verified: boolean;
238
- nullifier: string | null;
239
- anchored: boolean | null;
240
- reason?: string;
241
- }
242
- ```
243
-
244
- ### `verifyReceipt(receipt, options?)`
245
-
246
- Full verification combining binding and optional nullifier check.
247
-
248
- ```typescript
249
- {
250
- receipt_id: string;
251
- binding: BindingVerification;
252
- nullifier: NullifierVerification;
253
- output_hash: string | null;
254
- hub: string | null;
255
- model: string | null;
256
- amount_usdc: string | null;
257
- tx: string | null;
258
- overall: 'verified' | 'partial' | 'failed';
259
- errors: string[];
260
- }
261
- ```
262
-
263
- ## Build digest
264
-
265
- `npm run digest` writes `BUILD_DIGEST.txt`. That file is the SHA-256 of the sorted `src/**/*.ts` listing, not a bit-reproducible `tsc` binary. The same sources produce the same digest. The receipt-tree genesis leaf copies this digest so a holder can see which verifier source the issuer vouches for. It does not prove the process that served the receipt ran that exact binary.
266
-
267
- ## License
268
-
269
- Apache-2.0
1
+ # chit402-verify
2
+
3
+ Offline verification for Chit402 receipts — verify payment binding and output commitment without calling the API.
4
+
5
+ npm: `chit402-verify` · License: Apache-2.0 · Docs: https://chit402.com
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install chit402-verify
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### Library
16
+
17
+ ```typescript
18
+ import { verifyReceipt, verifyBinding, verifyNullifier } from 'chit402-verify';
19
+
20
+ // Verify a receipt offline (binding only, no network)
21
+ const receipt = { /* Chit402 receipt JSON */ };
22
+ const result = verifyBinding(receipt);
23
+ console.log(result.matches); // true if binding verified
24
+
25
+ // Full verification including on-chain nullifier check
26
+ const fullResult = await verifyReceipt(receipt, { checkNullifier: true });
27
+ console.log(fullResult.overall); // 'verified' | 'partial' | 'failed'
28
+ ```
29
+
30
+ ### CLI
31
+
32
+ ```bash
33
+ # Local binding verification (no network required)
34
+ npx chit402-verify receipt.json
35
+
36
+ # Hash the canonical object (must match signed payload_hash) and read not_after
37
+ # from a pinned issuer-history snapshot. Both flags are offline.
38
+ npx chit402-verify receipt.json --canonical-preimage preimage.json --issuer-history issuer-history.json
39
+
40
+ # With on-chain nullifier check (requires network)
41
+ npx chit402-verify receipt.json --check-nullifier
42
+
43
+ # Output as JSON
44
+ npx chit402-verify receipt.json --json
45
+
46
+ # From stdin
47
+ curl -s https://api.chit402.com/receipt/task-123?format=json | npx chit402-verify -
48
+ ```
49
+
50
+ ## What This Verifies
51
+
52
+ | Check | Requires Network? | Description |
53
+ |-------|-------------------|-------------|
54
+ | Payment binding | No | Recompute commitment from receipt fields |
55
+ | Issuer signature | No, unless `--fetch-jwks` | ES256. Trusted via JWKS (by kid) or the pinned production kid. Embedded `issuer_jwk` alone is not enough. |
56
+ | Output hash | No | Hash is on the receipt |
57
+ | On-chain settlement | Yes | Query Base RPC for tx |
58
+ | Nullifier anchor | Yes | Query ZKVerifierSP1 contract |
59
+ | Canonical preimage | No | `--canonical-preimage` is SHA-256'd and matched to signed `payload_hash` |
60
+ | Issuer history | No, with `--issuer-history` | `iat` is inside the kid's `not_before` / `not_after`. A payload v10 pin must match |
61
+
62
+ ## Exit Codes (CLI)
63
+
64
+ | Code | Meaning |
65
+ |------|---------|
66
+ | 0 | Verified |
67
+ | 1 | Verification failed |
68
+ | 2 | Partial (binding ok, nullifier not checked) |
69
+ | 3 | Input error |
70
+
71
+ ## Publish
72
+
73
+ `publishConfig` sets `access` to `public` and does not name an owner. On the registry, `chit402-verify` (latest `0.2.0`) and `@xfuel/verify` (latest `0.2.1`) are both maintained by the npm user `xfuel`. Publish `@xfuel/verify` first. `npm whoami` must print `xfuel`. A `404` on `PUT https://registry.npmjs.org/chit402-verify` is that login, not a missing package and not a new scope: the name already exists.
74
+
75
+ ## Documentation
76
+
77
+ - [Chit402 Docs](https://chit402.com)
78
+ - [API Reference](https://api.chit402.com)
79
+
80
+ ## License
81
+
82
+ Apache-2.0
package/cli.js ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * chit402-verify CLI — Chit402 receipt verification
4
+ *
5
+ * @xfuel/verify is a thin alias. The verifier is chit402-verify.
6
+ */
7
+ import { createRequire } from 'node:module';
8
+ import { spawn } from 'node:child_process';
9
+ import { constants as osConstants } from 'node:os';
10
+
11
+ const require = createRequire(import.meta.url);
12
+ const verifyCliPath = require.resolve('chit402-verify/dist/cli.js');
13
+
14
+ const child = spawn(process.execPath, [verifyCliPath, ...process.argv.slice(2)], {
15
+ stdio: 'inherit',
16
+ env: process.env,
17
+ });
18
+
19
+ // Forward termination signals so killing the wrapper (CI timeout, supervisor) also stops the verifier.
20
+ const FORWARDED = ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGQUIT'];
21
+ for (const sig of FORWARDED) {
22
+ process.on(sig, () => {
23
+ try { child.kill(sig); } catch { /* child already gone */ }
24
+ });
25
+ }
26
+
27
+ // Mirror the verifier's result exactly. A verifier killed by a signal (crash, heap-OOM abort,
28
+ // timeout) must never look like success: exit 128 + signal number, as a shell would report it.
29
+ child.on('exit', (code, signal) => {
30
+ if (signal) {
31
+ const n = osConstants.signals[signal];
32
+ process.exit(typeof n === 'number' ? 128 + n : 1);
33
+ }
34
+ process.exit(typeof code === 'number' ? code : 1);
35
+ });
36
+
37
+ child.on('error', (err) => {
38
+ console.error('Failed to start chit402-verify:', err.message);
39
+ process.exit(1);
40
+ });
package/index.cjs ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * chit402-verify — Chit402 receipt verification re-export (CommonJS)
3
+ */
4
+ 'use strict';
5
+
6
+ const verify = require('chit402-verify');
7
+ module.exports = verify;
8
+ module.exports.default = verify.default;
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * chit402-verify — Chit402 receipt verification type re-exports
3
+ */
4
+ export * from 'chit402-verify';
5
+ export { default } from 'chit402-verify';
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * chit402-verify — Chit402 receipt verification re-export
3
+ *
4
+ * Verify payment binding and output commitment offline.
5
+ */
6
+ export * from 'chit402-verify';
7
+ export { default } from 'chit402-verify';
package/package.json CHANGED
@@ -1,67 +1,61 @@
1
- {
2
- "name": "@xfuel/verify",
3
- "version": "0.3.5",
4
- "description": "Offline verification for Chit402 receipts — verify payment binding and output hash without calling the API",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "bin": {
8
- "xfuel-verify": "dist/cli.js"
9
- },
10
- "exports": {
11
- ".": {
12
- "types": "./dist/index.d.ts",
13
- "import": "./dist/index.js",
14
- "require": "./dist/index.js"
15
- },
16
- "./cli": "./dist/cli.js",
17
- "./dist/cli.js": "./dist/cli.js"
18
- },
19
- "sideEffects": false,
20
- "engines": {
21
- "node": ">=18"
22
- },
23
- "files": [
24
- "dist",
25
- "README.md",
26
- "LICENSE"
27
- ],
28
- "publishConfig": {
29
- "access": "public"
30
- },
31
- "homepage": "https://github.com/XFuel-Lab/chit402/tree/main/packages/verify#readme",
32
- "bugs": {
33
- "url": "https://github.com/XFuel-Lab/chit402/issues"
34
- },
35
- "scripts": {
36
- "build": "tsc",
37
- "digest": "node scripts/build-digest.mjs",
38
- "test": "npm run build && node --test --test-concurrency=1 test/*.test.mjs",
39
- "prepack": "npm run build",
40
- "prepublishOnly": "npm run build && npm test"
41
- },
42
- "keywords": [
43
- "chit402",
44
- "xfuel",
45
- "verify",
46
- "receipt",
47
- "x402",
48
- "usdc",
49
- "base",
50
- "offline",
51
- "zk"
52
- ],
53
- "author": "XFuel Lab",
54
- "license": "Apache-2.0",
55
- "repository": {
56
- "type": "git",
57
- "url": "git+https://github.com/XFuel-Lab/chit402.git",
58
- "directory": "packages/verify"
59
- },
60
- "dependencies": {
61
- "ethers": "^6.16.0"
62
- },
63
- "devDependencies": {
64
- "@types/node": "^22.0.0",
65
- "typescript": "^5.9.3"
66
- }
67
- }
1
+ {
2
+ "name": "@xfuel/verify",
3
+ "version": "0.4.1",
4
+ "description": "Alias of chit402-verify. The xfuel-verify bin stays.",
5
+ "type": "module",
6
+ "main": "./index.js",
7
+ "types": "./index.d.ts",
8
+ "bin": {
9
+ "xfuel-verify": "cli.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./index.d.ts",
14
+ "import": "./index.js",
15
+ "require": "./index.cjs"
16
+ }
17
+ },
18
+ "sideEffects": false,
19
+ "engines": {
20
+ "node": ">=18"
21
+ },
22
+ "files": [
23
+ "index.js",
24
+ "index.cjs",
25
+ "index.d.ts",
26
+ "cli.js",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "publishConfig": {
31
+ "access": "public",
32
+ "provenance": true
33
+ },
34
+ "scripts": {
35
+ "test": "node test.mjs"
36
+ },
37
+ "keywords": [
38
+ "chit402",
39
+ "verify",
40
+ "receipt",
41
+ "x402",
42
+ "usdc",
43
+ "base",
44
+ "offline",
45
+ "zk"
46
+ ],
47
+ "author": "XFuel Lab",
48
+ "license": "Apache-2.0",
49
+ "homepage": "https://chit402.com",
50
+ "bugs": {
51
+ "url": "https://github.com/XFuel-Lab/chit402/issues"
52
+ },
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "git+https://github.com/XFuel-Lab/chit402.git",
56
+ "directory": "packages/aliases/chit402-verify"
57
+ },
58
+ "dependencies": {
59
+ "chit402-verify": "0.4.1"
60
+ }
61
+ }