twzrd-receipt-verifier 1.0.0 → 1.0.2

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.
package/README.md CHANGED
@@ -14,6 +14,21 @@ This tool recomputes the leaf **and** checks the signature against the published
14
14
  key. If it says `VALID`, the receipt was authored by TWZRD and was not altered.
15
15
  Unsigned, wrong-key, or tampered receipts fail.
16
16
 
17
+ ## Where this fits: the agent trust loop
18
+
19
+ This verifier is the **last step** of the x402 trust rail an agent runs before and
20
+ after it spends:
21
+
22
+ 1. **Discover** a model/provider - [`wzrd-client`](https://pypi.org/project/wzrd-client/) (PyPI) or [`@wzrd_sol/sdk`](https://www.npmjs.com/package/@wzrd_sol/sdk) (npm)
23
+ 2. **Preflight** the seller wallet, free - `POST https://intel.twzrd.xyz/v1/intel/preflight` (or MCP `get_readiness_card_tool`)
24
+ 3. **Pay** with a signed receipt - `GET https://intel.twzrd.xyz/v1/intel/trust/{seller}` (0.05 USDC, x402)
25
+ 4. **Verify** the receipt offline - **this package** (trust nothing but the bytes + the public key)
26
+
27
+ ```bash
28
+ # zero-install: verify a receipt straight from the published package
29
+ npx twzrd-receipt-verifier receipt.json --pubkey 9V6Pn19kiUA5Rn6JpQfNduanvGt2aXGwsarosNfa2Ldf
30
+ ```
31
+
17
32
  ## The published signing key
18
33
 
19
34
  | field | value |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twzrd-receipt-verifier",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Standalone offline verifier for TWZRD AO-Receipt V5 (Ed25519-signed keccak256 leaf). No trust in TWZRD servers or code.",
5
5
  "keywords": ["twzrd", "x402", "solana", "ed25519", "keccak256", "receipt", "verifier", "agent", "attestation"],
6
6
  "homepage": "https://intel.twzrd.xyz",
@@ -119,7 +119,29 @@ function verify(receipt, trustedPubkey) {
119
119
 
120
120
  async function main() {
121
121
  const args = process.argv.slice(2);
122
- if (args.length === 0) { console.error('usage: verify_twzrd_receipt.js <receipt.json|-> [--pubkey KEY] [--base-url URL] [--self-test]'); process.exit(1); }
122
+ const HELP = `twzrd-receipt-verifier -- offline verifier for TWZRD AO-Receipt V5 (Ed25519-signed keccak256 leaf)
123
+
124
+ Verifies, with NO trust in TWZRD's servers or code, that a receipt was authored by
125
+ TWZRD's published Ed25519 key and was not tampered with.
126
+
127
+ usage:
128
+ twzrd-receipt-verifier <receipt.json|-> [--pubkey KEY] [--base-url URL] [--self-test]
129
+
130
+ arguments:
131
+ <receipt.json> path to the receipt JSON, or "-" to read from stdin
132
+ --pubkey KEY trust this base58 Ed25519 pubkey (out-of-band) instead of fetching it
133
+ --base-url URL where to fetch the published key (default: ${DEFAULT_BASE_URL})
134
+ --self-test additionally confirm a tampered copy FAILS (proves the check works)
135
+ -h, --help show this help
136
+
137
+ exit code: 0 = VALID, 1 = INVALID / error
138
+ key source: ${DEFAULT_BASE_URL}/.well-known/x402`;
139
+ if (args.includes('-h') || args.includes('--help')) { console.log(HELP); process.exit(0); }
140
+ if (args.length === 0) {
141
+ console.error('usage: twzrd-receipt-verifier <receipt.json|-> [--pubkey KEY] [--base-url URL] [--self-test]');
142
+ console.error(' twzrd-receipt-verifier --help');
143
+ process.exit(1);
144
+ }
123
145
  const receiptArg = args[0];
124
146
  const getOpt = (name) => { const i = args.indexOf(name); return i >= 0 ? args[i + 1] : undefined; };
125
147
  const selfTest = args.includes('--self-test');