@xfuel/verify 0.4.2 → 0.4.4

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 (2) hide show
  1. package/README.md +10 -13
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -30,21 +30,17 @@ console.log(fullResult.overall); // 'verified' | 'partial' | 'failed'
30
30
  ### CLI
31
31
 
32
32
  ```bash
33
- # Local binding verification (no network required)
33
+ # The payer check is on. Exit 0 needs the on-chain transfer to match.
34
34
  npx chit402-verify receipt.json
35
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
36
+ # History file that prefix-extends the snapshot shipped in chit402-verify.
37
+ npx chit402-verify receipt.json --issuer-history issuer-history.json
42
38
 
43
39
  # Output as JSON
44
40
  npx chit402-verify receipt.json --json
45
41
 
46
42
  # From stdin
47
- curl -s https://api.chit402.com/receipt/task-123?format=json | npx chit402-verify -
43
+ npx chit402-verify - < receipt.json
48
44
  ```
49
45
 
50
46
  ## What This Verifies
@@ -54,7 +50,7 @@ curl -s https://api.chit402.com/receipt/task-123?format=json | npx chit402-verif
54
50
  | Payment binding | No | Recompute commitment from receipt fields |
55
51
  | 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
52
  | Output hash | No | Hash is on the receipt |
57
- | On-chain settlement | Yes | Query Base RPC for tx |
53
+ | On-chain payer | Yes, always in the CLI | Payer, payee, asset, and amount. A mismatch is exit 1. An RPC that does not answer is exit 2 |
58
54
  | Nullifier anchor | Yes | Query ZKVerifierSP1 contract |
59
55
  | Canonical preimage | No | `--canonical-preimage` is SHA-256'd and matched to signed `payload_hash` |
60
56
  | Issuer history | No, with `--issuer-history` | `iat` is inside the kid's `not_before` / `not_after`. A payload v10 pin must match |
@@ -63,10 +59,11 @@ curl -s https://api.chit402.com/receipt/task-123?format=json | npx chit402-verif
63
59
 
64
60
  | Code | Meaning |
65
61
  |------|---------|
66
- | 0 | Verified |
67
- | 1 | Verification failed |
68
- | 2 | Partial (binding ok, nullifier not checked) |
69
- | 3 | Input error |
62
+ | 0 | `VERIFIED`. The payer check ran and passed, with the other checks |
63
+ | 1 | `INVALID`. Includes a payer, payee, or amount mismatch |
64
+ | 2 | `COULD_NOT_CHECK`. The log, the anchor, or the payer was not checked |
65
+
66
+ Flags are `--issuer-history <file>` and `--json`. Anything after `--` exits 1. With no RPC reachable, a signed receipt is exit 2, not exit 0. This alias forwards every argument to `chit402-verify` 0.4.4.
70
67
 
71
68
  ## Publish
72
69
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfuel/verify",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Alias of chit402-verify. The xfuel-verify bin stays.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -56,6 +56,6 @@
56
56
  "directory": "packages/aliases/chit402-verify"
57
57
  },
58
58
  "dependencies": {
59
- "chit402-verify": "0.4.2"
59
+ "chit402-verify": "0.4.4"
60
60
  }
61
61
  }