chit402-verify 0.3.4 → 0.4.0

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 (108) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +270 -82
  3. package/dist/anchor-trust.d.ts +144 -0
  4. package/dist/anchor-trust.d.ts.map +1 -0
  5. package/dist/anchor-trust.js +441 -0
  6. package/dist/anchor-trust.js.map +1 -0
  7. package/dist/anchor-witness.d.ts +265 -0
  8. package/dist/anchor-witness.d.ts.map +1 -0
  9. package/dist/anchor-witness.js +833 -0
  10. package/dist/anchor-witness.js.map +1 -0
  11. package/dist/base-payer.d.ts +65 -0
  12. package/dist/base-payer.d.ts.map +1 -0
  13. package/dist/base-payer.js +222 -0
  14. package/dist/base-payer.js.map +1 -0
  15. package/dist/binding.d.ts +52 -0
  16. package/dist/binding.d.ts.map +1 -0
  17. package/dist/binding.js +80 -0
  18. package/dist/binding.js.map +1 -0
  19. package/dist/canonical-preimage.d.ts +9 -0
  20. package/dist/canonical-preimage.d.ts.map +1 -0
  21. package/dist/canonical-preimage.js +25 -0
  22. package/dist/canonical-preimage.js.map +1 -0
  23. package/dist/carry-forward.d.ts +79 -0
  24. package/dist/carry-forward.d.ts.map +1 -0
  25. package/dist/carry-forward.js +184 -0
  26. package/dist/carry-forward.js.map +1 -0
  27. package/dist/cli.d.ts +18 -0
  28. package/dist/cli.d.ts.map +1 -0
  29. package/dist/cli.js +2090 -0
  30. package/dist/cli.js.map +1 -0
  31. package/dist/epoch.d.ts +143 -0
  32. package/dist/epoch.d.ts.map +1 -0
  33. package/dist/epoch.js +352 -0
  34. package/dist/epoch.js.map +1 -0
  35. package/dist/head-binding.d.ts +24 -0
  36. package/dist/head-binding.d.ts.map +1 -0
  37. package/dist/head-binding.js +61 -0
  38. package/dist/head-binding.js.map +1 -0
  39. package/dist/index.d.ts +585 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +1648 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/issuer-history.d.ts +151 -0
  44. package/dist/issuer-history.d.ts.map +1 -0
  45. package/dist/issuer-history.js +595 -0
  46. package/dist/issuer-history.js.map +1 -0
  47. package/dist/issuer-pin.d.ts +126 -0
  48. package/dist/issuer-pin.d.ts.map +1 -0
  49. package/dist/issuer-pin.js +567 -0
  50. package/dist/issuer-pin.js.map +1 -0
  51. package/dist/jcs.d.ts +8 -0
  52. package/dist/jcs.d.ts.map +1 -0
  53. package/dist/jcs.js +64 -0
  54. package/dist/jcs.js.map +1 -0
  55. package/dist/jws.d.ts +46 -0
  56. package/dist/jws.d.ts.map +1 -0
  57. package/dist/jws.js +129 -0
  58. package/dist/jws.js.map +1 -0
  59. package/dist/payer.d.ts +65 -0
  60. package/dist/payer.d.ts.map +1 -0
  61. package/dist/payer.js +148 -0
  62. package/dist/payer.js.map +1 -0
  63. package/dist/preimage.d.ts +78 -0
  64. package/dist/preimage.d.ts.map +1 -0
  65. package/dist/preimage.js +363 -0
  66. package/dist/preimage.js.map +1 -0
  67. package/dist/receipt-lane.d.ts +235 -0
  68. package/dist/receipt-lane.d.ts.map +1 -0
  69. package/dist/receipt-lane.js +446 -0
  70. package/dist/receipt-lane.js.map +1 -0
  71. package/dist/receipt-version.d.ts +98 -0
  72. package/dist/receipt-version.d.ts.map +1 -0
  73. package/dist/receipt-version.js +364 -0
  74. package/dist/receipt-version.js.map +1 -0
  75. package/dist/refusal.d.ts +93 -0
  76. package/dist/refusal.d.ts.map +1 -0
  77. package/dist/refusal.js +249 -0
  78. package/dist/refusal.js.map +1 -0
  79. package/dist/request-binding.d.ts +7 -0
  80. package/dist/request-binding.d.ts.map +1 -0
  81. package/dist/request-binding.js +26 -0
  82. package/dist/request-binding.js.map +1 -0
  83. package/dist/row-hash.d.ts +22 -0
  84. package/dist/row-hash.d.ts.map +1 -0
  85. package/dist/row-hash.js +26 -0
  86. package/dist/row-hash.js.map +1 -0
  87. package/dist/shell.d.ts +65 -0
  88. package/dist/shell.d.ts.map +1 -0
  89. package/dist/shell.js +268 -0
  90. package/dist/shell.js.map +1 -0
  91. package/dist/solana-payer.d.ts +99 -0
  92. package/dist/solana-payer.d.ts.map +1 -0
  93. package/dist/solana-payer.js +258 -0
  94. package/dist/solana-payer.js.map +1 -0
  95. package/dist/v11-receipt.d.ts +23 -0
  96. package/dist/v11-receipt.d.ts.map +1 -0
  97. package/dist/v11-receipt.js +368 -0
  98. package/dist/v11-receipt.js.map +1 -0
  99. package/dist/verdict.d.ts +94 -0
  100. package/dist/verdict.d.ts.map +1 -0
  101. package/dist/verdict.js +381 -0
  102. package/dist/verdict.js.map +1 -0
  103. package/issuer-history.snapshot.json +1 -0
  104. package/package.json +70 -59
  105. package/cli.js +0 -27
  106. package/index.cjs +0 -8
  107. package/index.d.ts +0 -5
  108. package/index.js +0 -7
@@ -0,0 +1,381 @@
1
+ "use strict";
2
+ /**
3
+ * @xfuel/verify 0.4.0 verdict.
4
+ * `verified` is only when every check passed. A failed check is `invalid`
5
+ * even when another check could not be completed.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.VERDICT_DOC_ANCHORS = void 0;
9
+ exports.verdictCopy = verdictCopy;
10
+ exports.buildVerifyVerdict = buildVerifyVerdict;
11
+ exports.overallLine = overallLine;
12
+ exports.verdictDocAnchor = verdictDocAnchor;
13
+ exports.humanVerdictLines = humanVerdictLines;
14
+ const WINDOW_FAIL = new Set([
15
+ 'kid_revoked_before_issuance',
16
+ 'issued_before_not_before',
17
+ 'issued_after_not_after',
18
+ 'issued_at_missing',
19
+ 'not_before_missing',
20
+ 'not_after_invalid',
21
+ 'revoked_at_missing',
22
+ 'kid_status_regression',
23
+ 'issuer_history_invalid',
24
+ 'issuer_history_pin_mismatch',
25
+ 'issuer_history_pin_missing',
26
+ 'issuer_history_version_mismatch',
27
+ 'issuer_history_seq_mismatch',
28
+ 'signature_invalid',
29
+ 'key untrusted',
30
+ 'prev_hash_mismatch',
31
+ 'entry_hash_mismatch',
32
+ 'head_hash_mismatch',
33
+ 'introduced_key_signature',
34
+ 'inherited_key_window',
35
+ 'issuer_history_not_extension',
36
+ ]);
37
+ function verdictCopy(reason, result) {
38
+ if (result === 'verified')
39
+ return { message: 'Every check passed.', next_step: null };
40
+ if (reason === 'not_in_log' || reason === 'NOT_IN_LOG') {
41
+ return {
42
+ message: 'This receipt is not a leaf of the public log. The payment row in the book is unchanged.',
43
+ next_step: null,
44
+ };
45
+ }
46
+ if (reason === 'unsupported_version') {
47
+ return {
48
+ message: 'This receipt version is not supported by this verifier.',
49
+ next_step: 'Upgrade @xfuel/verify.',
50
+ };
51
+ }
52
+ if (reason === 'kid_not_in_history') {
53
+ return {
54
+ message: 'No issuer history covers this key.',
55
+ next_step: 'Pass --issuer-history with a snapshot that includes this kid.',
56
+ };
57
+ }
58
+ if (reason === 'signed_receipt_unavailable') {
59
+ return {
60
+ message: 'This document is the public shell. The signed receipt is on the owner view.',
61
+ next_step: 'Pass the signed receipt from the owner view.',
62
+ };
63
+ }
64
+ if (reason === 'receipt_unavailable') {
65
+ return {
66
+ message: 'The receipt could not be fetched.',
67
+ next_step: 'Fetch the receipt again, then re-run.',
68
+ };
69
+ }
70
+ if (reason === 'log_unreachable' || reason === 'anchor_unreachable') {
71
+ return {
72
+ message: 'The receipt log or anchor could not be fetched.',
73
+ next_step: 'Fetch the log and the anchor again, then re-run.',
74
+ };
75
+ }
76
+ if (reason === 'pending' || reason === 'pending_anchor') {
77
+ return {
78
+ message: 'The leaf is past the anchored tree. The anchor is not in yet.',
79
+ next_step: 'Re-run when the anchor for this leaf is published.',
80
+ };
81
+ }
82
+ if (reason === 'kid_status_regression') {
83
+ return {
84
+ message: 'Issuer history changes not_before or restores a revoked key.',
85
+ next_step: null,
86
+ };
87
+ }
88
+ if (reason === 'kid_revoked_before_issuance' || reason === 'issued_before_not_before' || reason === 'issued_after_not_after') {
89
+ return {
90
+ message: 'The issuer key was revoked or this receipt is outside its window.',
91
+ next_step: null,
92
+ };
93
+ }
94
+ if (reason === 'version_mismatch'
95
+ || reason === 'payload_version_mismatch'
96
+ || reason === 'id_mismatch'
97
+ || reason === 'id_prefix_version_mismatch') {
98
+ return {
99
+ message: 'The receipt id or version does not match the signature.',
100
+ next_step: null,
101
+ };
102
+ }
103
+ if (reason === 'intent_on_legacy_version') {
104
+ return {
105
+ message: 'A signed intent is not a payment on this receipt version.',
106
+ next_step: null,
107
+ };
108
+ }
109
+ if (reason === 'payment_mismatch' || reason === 'binding_mismatch') {
110
+ return {
111
+ message: 'The payment on the receipt does not match the signature.',
112
+ next_step: null,
113
+ };
114
+ }
115
+ if (reason === 'key untrusted') {
116
+ return {
117
+ message: "Signed by a key that is not the issuer's.",
118
+ next_step: null,
119
+ };
120
+ }
121
+ if (result === 'could_not_check') {
122
+ return {
123
+ message: 'A check could not be completed.',
124
+ next_step: null,
125
+ };
126
+ }
127
+ return {
128
+ message: 'The receipt does not match what the issuer signed.',
129
+ next_step: null,
130
+ };
131
+ }
132
+ function claimed(state) {
133
+ if (!state || state === 'unclaimed')
134
+ return 'could_not_check';
135
+ return state;
136
+ }
137
+ function buildVerifyVerdict(input) {
138
+ if (input.absentReason)
139
+ return absentReceiptVerdict(input);
140
+ const errors = input.errors || [];
141
+ const unsupported = errors.includes('unsupported_version');
142
+ const versionMismatch = errors.includes('version_mismatch') || errors.includes('payload_version_mismatch');
143
+ const idMismatch = errors.includes('id_mismatch') || errors.includes('task_id_mismatch') || errors.includes('receipt_id_mismatch');
144
+ const idPrefix = errors.includes('id_prefix_version_mismatch');
145
+ const intentLegacy = errors.includes('intent_on_legacy_version');
146
+ let shape = 'pass';
147
+ if (idPrefix || intentLegacy)
148
+ shape = 'fail';
149
+ else if (unsupported)
150
+ shape = 'could_not_check';
151
+ else if (versionMismatch || idMismatch)
152
+ shape = 'fail';
153
+ let signature = 'could_not_check';
154
+ if (unsupported)
155
+ signature = 'could_not_check';
156
+ else if (input.signatureChecked && input.signatureValid === true)
157
+ signature = 'pass';
158
+ else if (input.signatureChecked && input.signatureValid === false)
159
+ signature = 'fail';
160
+ else if (input.signatureValid === true)
161
+ signature = 'pass';
162
+ const historyReason = input.historyReason || null;
163
+ let keyWindow = 'could_not_check';
164
+ if (input.historyMissing || historyReason === 'kid_not_in_history')
165
+ keyWindow = 'could_not_check';
166
+ else if (input.historyChecked && input.historyOk)
167
+ keyWindow = 'pass';
168
+ else if (input.historyChecked && historyReason && WINDOW_FAIL.has(historyReason))
169
+ keyWindow = 'fail';
170
+ else if (input.historyChecked && input.historyOk === false)
171
+ keyWindow = 'fail';
172
+ // Pass only after the signature was checked and passed. An unchecked or
173
+ // failed signature did not check the payment, so it is not a pass.
174
+ let payment = signature === 'pass' ? 'pass' : 'could_not_check';
175
+ const preimageFailed = errors.some((err) => /preimage|payload_hash_mismatch|canonical preimage/.test(err));
176
+ if (signature === 'pass') {
177
+ if ((input.claimMismatches || 0) > 0 || (input.bindingExpected && input.bindingMatches === false) || preimageFailed)
178
+ payment = 'fail';
179
+ else if (input.payerChecked && input.payerValid === false)
180
+ payment = 'fail';
181
+ else if (input.bindingExpected && input.bindingMatches !== true && !unsupported)
182
+ payment = 'could_not_check';
183
+ }
184
+ const logInclusion = claimed(input.logInclusion);
185
+ const anchor = claimed(input.anchor);
186
+ const checks = {
187
+ signature,
188
+ key_window: keyWindow,
189
+ payment_binding: payment,
190
+ log_inclusion: logInclusion,
191
+ anchor,
192
+ shape,
193
+ };
194
+ const failed = Object.keys(checks).filter((name) => checks[name] === 'fail');
195
+ const unchecked = Object.keys(checks).filter((name) => checks[name] === 'could_not_check');
196
+ let result = 'verified';
197
+ let reason = null;
198
+ if (failed.length) {
199
+ result = 'invalid';
200
+ reason = failReason(failed, historyReason, input.logReason || null, errors, payment);
201
+ }
202
+ else if (unchecked.length) {
203
+ result = 'could_not_check';
204
+ reason = uncheckedReason(unchecked, historyReason, input.logReason || null, errors);
205
+ }
206
+ const copy = verdictCopy(reason, result);
207
+ const exit_code = result === 'verified' ? 0 : result === 'invalid' ? 1 : 2;
208
+ return {
209
+ result,
210
+ exit_code,
211
+ reason,
212
+ message: copy.message,
213
+ next_step: copy.next_step,
214
+ receipt_id: input.receiptId ?? null,
215
+ display_id: input.displayId ?? null,
216
+ payload_version: input.payloadVersion ?? null,
217
+ checks,
218
+ history: {
219
+ source: input.historySource ?? null,
220
+ head_hash: input.historyHead ?? null,
221
+ entry_count: input.historyCount ?? null,
222
+ as_of: input.historyAsOf ?? null,
223
+ },
224
+ log: input.log ?? null,
225
+ verifier: { name: 'chit402-verify', version: input.version },
226
+ };
227
+ }
228
+ function absentReceiptVerdict(input) {
229
+ const reason = input.absentReason || 'receipt_unavailable';
230
+ const copy = verdictCopy(reason, 'could_not_check');
231
+ const could = 'could_not_check';
232
+ return {
233
+ result: 'could_not_check',
234
+ exit_code: 2,
235
+ reason,
236
+ message: copy.message,
237
+ next_step: copy.next_step,
238
+ receipt_id: null,
239
+ display_id: null,
240
+ payload_version: null,
241
+ checks: {
242
+ signature: could,
243
+ key_window: could,
244
+ payment_binding: could,
245
+ log_inclusion: could,
246
+ anchor: could,
247
+ shape: could,
248
+ },
249
+ history: {
250
+ source: null,
251
+ head_hash: null,
252
+ entry_count: null,
253
+ as_of: null,
254
+ },
255
+ log: null,
256
+ verifier: { name: 'chit402-verify', version: input.version },
257
+ };
258
+ }
259
+ function failReason(failed, historyReason, logReason, errors, payment) {
260
+ if (failed.includes('shape')) {
261
+ if (errors.includes('id_prefix_version_mismatch'))
262
+ return 'id_prefix_version_mismatch';
263
+ if (errors.includes('intent_on_legacy_version'))
264
+ return 'intent_on_legacy_version';
265
+ if (errors.includes('version_mismatch') || errors.includes('payload_version_mismatch'))
266
+ return 'version_mismatch';
267
+ return 'id_mismatch';
268
+ }
269
+ if (failed.includes('signature'))
270
+ return errors.find((err) => err === 'key untrusted') || 'signature_invalid';
271
+ if (failed.includes('key_window'))
272
+ return historyReason || 'key_window';
273
+ if (failed.includes('payment_binding') || payment === 'fail')
274
+ return 'payment_mismatch';
275
+ if (failed.includes('log_inclusion')) {
276
+ if (logReason === 'not_in_log')
277
+ return 'not_in_log';
278
+ return logReason || 'log_inclusion';
279
+ }
280
+ if (failed.includes('anchor'))
281
+ return logReason || 'anchor';
282
+ return 'invalid';
283
+ }
284
+ function uncheckedReason(unchecked, historyReason, logReason, errors) {
285
+ if (unchecked.includes('shape') || errors.includes('unsupported_version'))
286
+ return 'unsupported_version';
287
+ if (unchecked.includes('key_window'))
288
+ return historyReason || 'kid_not_in_history';
289
+ if (unchecked.includes('signature'))
290
+ return 'signature_unchecked';
291
+ if (unchecked.includes('log_inclusion') || unchecked.includes('anchor'))
292
+ return logReason || 'log_unreachable';
293
+ return 'could_not_check';
294
+ }
295
+ function overallLine(verdict, legacyOverall) {
296
+ if (verdict.result === 'verified')
297
+ return 'VERIFIED';
298
+ if (verdict.reason === 'not_in_log')
299
+ return 'NOT_IN_LOG';
300
+ if (verdict.result === 'invalid')
301
+ return 'INVALID';
302
+ if (legacyOverall === 'pending' || verdict.reason === 'pending' || verdict.reason === 'pending_anchor')
303
+ return 'PENDING';
304
+ if (legacyOverall === 'partial')
305
+ return 'PARTIAL';
306
+ return 'COULD_NOT_CHECK';
307
+ }
308
+ /** Fragment for `https://chit402.com/docs/verify#`. Ids have no spaces. */
309
+ function verdictDocAnchor(reason) {
310
+ if (reason === 'key untrusted')
311
+ return 'key_untrusted';
312
+ return reason;
313
+ }
314
+ /** Human lines. Exit 2 always includes the exact `NOT found invalid` line. */
315
+ function humanVerdictLines(verdict) {
316
+ const lines = [overallLine(verdict), verdict.message];
317
+ if (verdict.exit_code === 2)
318
+ lines.push('NOT found invalid');
319
+ if (verdict.reason)
320
+ lines.push(`Details: https://chit402.com/docs/verify#${verdictDocAnchor(verdict.reason)}`);
321
+ if (verdict.history.source === 'bundled' && verdict.history.as_of) {
322
+ lines.push(`Issuer history: as of ${verdict.history.as_of}`);
323
+ }
324
+ if (verdict.next_step)
325
+ lines.push(verdict.next_step);
326
+ return lines;
327
+ }
328
+ /**
329
+ * Reason ids printed as `https://chit402.com/docs/verify#<reason>`.
330
+ * The public page must have one element id for each.
331
+ */
332
+ exports.VERDICT_DOC_ANCHORS = [
333
+ 'not_in_log',
334
+ 'signed_receipt_unavailable',
335
+ 'unsupported_version',
336
+ 'kid_not_in_history',
337
+ 'receipt_unavailable',
338
+ 'log_unreachable',
339
+ 'anchor_unreachable',
340
+ 'pending_anchor',
341
+ 'pending',
342
+ 'kid_status_regression',
343
+ 'kid_revoked_before_issuance',
344
+ 'issued_before_not_before',
345
+ 'issued_after_not_after',
346
+ 'issued_at_missing',
347
+ 'not_before_missing',
348
+ 'not_after_invalid',
349
+ 'revoked_at_missing',
350
+ 'issuer_history_invalid',
351
+ 'issuer_history_pin_mismatch',
352
+ 'issuer_history_pin_missing',
353
+ 'issuer_history_version_mismatch',
354
+ 'issuer_history_seq_mismatch',
355
+ 'issuer_history_not_extension',
356
+ 'signature_invalid',
357
+ 'key_untrusted',
358
+ 'key_window',
359
+ 'version_mismatch',
360
+ 'id_mismatch',
361
+ 'id_prefix_version_mismatch',
362
+ 'intent_on_legacy_version',
363
+ 'payment_mismatch',
364
+ 'log_inclusion',
365
+ 'anchor',
366
+ 'invalid',
367
+ 'signature_unchecked',
368
+ 'could_not_check',
369
+ 'prev_hash_mismatch',
370
+ 'entry_hash_mismatch',
371
+ 'head_hash_mismatch',
372
+ 'introduced_key_signature',
373
+ 'inherited_key_window',
374
+ 'head_signature_missing',
375
+ 'head_signature_invalid',
376
+ 'head_claims_mismatch',
377
+ 'head_key_untrusted',
378
+ 'inclusion_failed',
379
+ 'root_mismatch',
380
+ ];
381
+ //# sourceMappingURL=verdict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdict.js","sourceRoot":"","sources":["../src/verdict.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAsEH,kCA+FC;AAyCD,gDAmFC;AAuED,kCAOC;AAGD,4CAGC;AAGD,8CASC;AAnVD,MAAM,WAAW,GAAG,IAA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6BAA6B;IAC7B,0BAA0B;IAC1B,wBAAwB;IACxB,mBAAmB;IACnB,oBAAoB;IACpB,mBAAmB;IACnB,oBAAoB;IACpB,wBAAwB;IACxB,6BAA6B;IAC7B,4BAA4B;IAC5B,iCAAiC;IACjC,6BAA6B;IAC7B,8BAA8B;IAC9B,mBAAmB;IACnB,eAAe;IACf,YAAY;IACZ,kBAAkB;IAClB,aAAa;IACb,4BAA4B;IAC5B,0BAA0B;IAC1B,kBAAkB;IAClB,eAAe;IACf,QAAQ;IACR,SAAS;IACT,qBAAqB;IACrB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,oBAAoB;IACpB,0BAA0B;IAC1B,sBAAsB;IACtB,wBAAwB;IACxB,wBAAwB;IACxB,sBAAsB;IACtB,oBAAoB;IACpB,kBAAkB;IAClB,eAAe;CACP,CAAC"}
@@ -0,0 +1 @@
1
+ {"canonicalization":"Each entry_hash is SHA-256 of the JCS (RFC 8785) UTF-8 bytes of the entry without entry_hash. prev_hash is the previous entry_hash, or null on the first entry. The current issuer key signs head_hash and entry_count. A sealed snapshot also signs version and seq. SHA-256 of the JCS bytes of the whole document is the snapshot hash a receipt pins.","entries":[{"alg":"ES256","entry_hash":"349d7bb495bad55aaa25d05ee91134575e6e7d300795b37b41f4bcf29af80f0e","jwk":{"alg":"ES256","crv":"P-256","kid":"IvFpmC-vPhkY_v0vidsrWVT9uzlE5XWKZgAEOeJTq1Q","kty":"EC","use":"sig","x":"_H7J9niXF2tez_MnF25pnrDN7iJ_VC9gBzYYW9gzSPk","y":"jiorfRc9wtNaRmaFHsQaXNzcWteUA0RnpvD4SWdVl34"},"kid":"IvFpmC-vPhkY_v0vidsrWVT9uzlE5XWKZgAEOeJTq1Q","not_after":null,"not_before":"2026-09-04T08:52:05Z","prev_hash":null,"reason":null,"revoked_at":null,"status":"active"}],"head_hash":"349d7bb495bad55aaa25d05ee91134575e6e7d300795b37b41f4bcf29af80f0e","issuer_signature":{"alg":"ES256","issuer_jwk":{"alg":"ES256","crv":"P-256","kid":"IvFpmC-vPhkY_v0vidsrWVT9uzlE5XWKZgAEOeJTq1Q","kty":"EC","use":"sig","x":"_H7J9niXF2tez_MnF25pnrDN7iJ_VC9gBzYYW9gzSPk","y":"jiorfRc9wtNaRmaFHsQaXNzcWteUA0RnpvD4SWdVl34"},"jws":"eyJhbGciOiJFUzI1NiIsInR5cCI6ImNoaXQ0MDItaXNzdWVyLWhpc3Rvcnkrand0Iiwia2lkIjoiSXZGcG1DLXZQaGtZX3Ywdmlkc3JXVlQ5dXpsRTVYV0taZ0FFT2VKVHExUSJ9.eyJzY2hlbWEiOiJjaGl0NDAyLmlzc3Vlcl9oaXN0b3J5LnYxIiwicGF5bG9hZF92ZXJzaW9uIjoxLCJlbnRyeV9jb3VudCI6MSwiaGVhZF9oYXNoIjoiMzQ5ZDdiYjQ5NWJhZDU1YWFhMjVkMDVlZTkxMTM0NTc1ZTZlN2QzMDA3OTViMzdiNDFmNGJjZjI5YWY4MGYwZSIsInZlcnNpb24iOjIsInNlcSI6Mn0.YHgulY1FLf_wZrxafAkqQr2rrT-lVbU8TCuNrIHPDp0M7k7L0BJteUhQQuNI7HrS-jqN1cOXzwYJ_3LabmxADw","kid":"IvFpmC-vPhkY_v0vidsrWVT9uzlE5XWKZgAEOeJTq1Q","payload_version":1,"typ":"chit402-issuer-history+jwt"},"not_before_note":"Only kid IvFpmC-vPhkY_v0vidsrWVT9uzlE5XWKZgAEOeJTq1Q defaults not_before to 2026-09-04T08:52:05Z, the first deployment of this ES256 issuer path. The earliest receipt in the repo signed by that kid is 2026-09-26T17:27:32Z (fixture chit-5d775d12). Any other kid uses its history entry or ISSUER_KEY_NOT_BEFORE. A null not_before is unknown and the window check fails closed.","payload_version":1,"schema":"chit402.issuer_history.v1","seq":2,"version":2}
package/package.json CHANGED
@@ -1,59 +1,70 @@
1
- {
2
- "name": "chit402-verify",
3
- "version": "0.3.4",
4
- "description": "Chit402 receipt verification — verify payment binding and output commitment offline.",
5
- "main": "./index.js",
6
- "types": "./index.d.ts",
7
- "bin": {
8
- "chit402-verify": "cli.js"
9
- },
10
- "exports": {
11
- ".": {
12
- "types": "./index.d.ts",
13
- "import": "./index.js",
14
- "require": "./index.cjs"
15
- }
16
- },
17
- "sideEffects": false,
18
- "engines": {
19
- "node": ">=18"
20
- },
21
- "files": [
22
- "index.js",
23
- "index.cjs",
24
- "index.d.ts",
25
- "cli.js",
26
- "README.md",
27
- "LICENSE"
28
- ],
29
- "publishConfig": {
30
- "access": "public"
31
- },
32
- "scripts": {
33
- "test": "node test.mjs"
34
- },
35
- "keywords": [
36
- "chit402",
37
- "verify",
38
- "receipt",
39
- "x402",
40
- "usdc",
41
- "base",
42
- "offline",
43
- "zk"
44
- ],
45
- "author": "XFuel Lab",
46
- "license": "Apache-2.0",
47
- "homepage": "https://chit402.com",
48
- "bugs": {
49
- "url": "https://github.com/XFuel-Lab/chit402/issues"
50
- },
51
- "repository": {
52
- "type": "git",
53
- "url": "git+https://github.com/XFuel-Lab/chit402.git",
54
- "directory": "packages/aliases/chit402-verify"
55
- },
56
- "dependencies": {
57
- "@xfuel/verify": "^0.3.4"
58
- }
59
- }
1
+ {
2
+ "name": "chit402-verify",
3
+ "version": "0.4.0",
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
+ "chit402-verify": "dist/cli.js",
9
+ "xfuel-verify": "dist/cli.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js",
15
+ "require": "./dist/index.js"
16
+ },
17
+ "./cli": "./dist/cli.js",
18
+ "./dist/cli.js": "./dist/cli.js"
19
+ },
20
+ "sideEffects": false,
21
+ "engines": {
22
+ "node": ">=18"
23
+ },
24
+ "files": [
25
+ "dist",
26
+ "issuer-history.snapshot.json",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "publishConfig": {
31
+ "access": "public",
32
+ "provenance": true
33
+ },
34
+ "homepage": "https://github.com/XFuel-Lab/chit402/tree/main/packages/verify#readme",
35
+ "bugs": {
36
+ "url": "https://github.com/XFuel-Lab/chit402/issues"
37
+ },
38
+ "scripts": {
39
+ "build": "tsc",
40
+ "digest": "node scripts/build-digest.mjs",
41
+ "test": "npm run build && node --test --test-concurrency=1 test/*.test.mjs",
42
+ "prepack": "npm run build",
43
+ "prepublishOnly": "npm run build && npm test"
44
+ },
45
+ "keywords": [
46
+ "chit402",
47
+ "xfuel",
48
+ "verify",
49
+ "receipt",
50
+ "x402",
51
+ "usdc",
52
+ "base",
53
+ "offline",
54
+ "zk"
55
+ ],
56
+ "author": "XFuel Lab",
57
+ "license": "Apache-2.0",
58
+ "repository": {
59
+ "type": "git",
60
+ "url": "git+https://github.com/XFuel-Lab/chit402.git",
61
+ "directory": "packages/verify"
62
+ },
63
+ "dependencies": {
64
+ "ethers": "^6.16.0"
65
+ },
66
+ "devDependencies": {
67
+ "@types/node": "^22.0.0",
68
+ "typescript": "^5.9.3"
69
+ }
70
+ }
package/cli.js DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * chit402-verify CLI — Chit402 receipt verification
4
- *
5
- * This is the public-facing CLI. Internally it runs @xfuel/verify.
6
- */
7
- import { createRequire } from 'node:module';
8
- import { spawn } from 'node:child_process';
9
-
10
- const require = createRequire(import.meta.url);
11
- // Resolve via the package exports map. Deep imports of dist/cli.js throw
12
- // ERR_PACKAGE_PATH_NOT_EXPORTED unless @xfuel/verify lists that subpath.
13
- const verifyCliPath = require.resolve('@xfuel/verify/dist/cli.js');
14
-
15
- const child = spawn(process.execPath, [verifyCliPath, ...process.argv.slice(2)], {
16
- stdio: 'inherit',
17
- env: process.env,
18
- });
19
-
20
- child.on('exit', (code) => {
21
- process.exit(code ?? 0);
22
- });
23
-
24
- child.on('error', (err) => {
25
- console.error('Failed to start chit402-verify:', err.message);
26
- process.exit(1);
27
- });
package/index.cjs DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * chit402-verify — Chit402 receipt verification re-export (CommonJS)
3
- */
4
- 'use strict';
5
-
6
- const verify = require('@xfuel/verify');
7
- module.exports = verify;
8
- module.exports.default = verify.default;
package/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * chit402-verify — Chit402 receipt verification type re-exports
3
- */
4
- export * from '@xfuel/verify';
5
- export { default } from '@xfuel/verify';
package/index.js DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * chit402-verify — Chit402 receipt verification re-export
3
- *
4
- * Verify payment binding and output commitment offline.
5
- */
6
- export * from '@xfuel/verify';
7
- export { default } from '@xfuel/verify';