agent-receipt-verify 0.0.0-stage → 0.2.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.
Files changed (40) hide show
  1. package/CONFORMANCE.md +110 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +39 -0
  4. package/README.md +273 -2
  5. package/bench/eip3009-beleid.mjs +113 -0
  6. package/bench/robustness.mjs +264 -0
  7. package/bin/cli.mjs +95 -0
  8. package/examples/receipt-live-base-sepolia-2.json +21 -0
  9. package/examples/receipt-live-base-sepolia-3.json +21 -0
  10. package/examples/receipt-live-base-sepolia.json +21 -0
  11. package/package.json +61 -4
  12. package/profiles/profile.schema.json +115 -0
  13. package/profiles/x402-deployed-ladder-v1.json +178 -0
  14. package/src/eip3009-autorisatie.mjs +228 -0
  15. package/src/inam-countersigned.mjs +162 -0
  16. package/src/mcp-server.mjs +262 -0
  17. package/src/profiel.mjs +145 -0
  18. package/src/x402-conformance-check.mjs +194 -0
  19. package/src/x402-conformance-treden.mjs +246 -0
  20. package/src/x402-discovery-census.mjs +247 -0
  21. package/src/x402-index-liveness.mjs +201 -0
  22. package/src/x402-link-onchain.mjs +280 -0
  23. package/src/x402-metingen-bundel.mjs +96 -0
  24. package/src/x402-offer-receipt.mjs +84 -0
  25. package/src/x402-poortwachters.mjs +241 -0
  26. package/tools/bundel-bouw.mjs +126 -0
  27. package/tools/pack-inhoud.mjs +96 -0
  28. package/vectors/inam/BRON-README.md +38 -0
  29. package/vectors/inam/canonical-vectors.json +122 -0
  30. package/vectors/inam/vectors.json +96 -0
  31. package/vectors/kanon/amount-insufficient-001.json +52 -0
  32. package/vectors/kanon/cross-chain-replay-001.json +54 -0
  33. package/vectors/kanon/cross-contract-replay-001.json +54 -0
  34. package/vectors/kanon/domain-name-mismatch-001.json +53 -0
  35. package/vectors/kanon/expired-001.json +51 -0
  36. package/vectors/kanon/network-mismatch-001.json +52 -0
  37. package/vectors/kanon/nonce-replay-001.json +56 -0
  38. package/vectors/kanon/not-yet-valid-001.json +51 -0
  39. package/vectors/kanon/sig-malleable-high-s-001.json +54 -0
  40. package/vectors/kanon/valid-baseline-001.json +52 -0
@@ -0,0 +1,96 @@
1
+ {
2
+ "suite": "inam-countersigned-grounding-v0.1",
3
+ "method": "counterparty-countersigned",
4
+ "note": "Test keys and made-up addresses only. Checks: feedbackHash, receiptId, both signatures, value, sender, specHash/outputHash against the bytes the requester observed.",
5
+ "parties": {
6
+ "requester": {
7
+ "did": "did:key:z6Mkkrq4oHrSaU8E2ZctUreJkiXyrVbPRM4FZgPxYx3X8XCS",
8
+ "erc8004Address": "0x1111111111111111111111111111111111111111"
9
+ },
10
+ "provider": {
11
+ "did": "did:key:z6MkenP9pSJt69Re5GYC3HeA6JC4BbFSATBbVkjx3TVbE4LL",
12
+ "erc8004Address": "0x2222222222222222222222222222222222222222"
13
+ }
14
+ },
15
+ "observed": {
16
+ "request": {
17
+ "method": "POST",
18
+ "url": "https://worker.example/translate",
19
+ "body": "{\"text\":\"merhaba dünya\",\"to\":\"en\"}"
20
+ },
21
+ "response": {
22
+ "status": 200,
23
+ "body": "{\"text\":\"hello world\"}"
24
+ },
25
+ "expectedSpecHash": "sha256:423007c3904c15d5f43b0485ff3e442b0003925cb283ac7b58c16634429bce20",
26
+ "expectedOutputHash": "sha256:e344fa3b83cf2b142293de2a4e56c6b211d4a157f8adb3c954c51ab67f41a46a"
27
+ },
28
+ "cases": [
29
+ {
30
+ "id": "POSITIVE",
31
+ "description": "Genuine feedback: sent from the requester's proven wallet, both signatures valid, hashes match the observed bytes.",
32
+ "feedbackFile": "{\"agentId\":7,\"agentRegistry\":\"eip155:8453:0x8004000000000000000000000000000000000000\",\"clientAddress\":\"eip155:8453:0x1111111111111111111111111111111111111111\",\"createdAt\":\"2026-10-03T00:00:00.000Z\",\"inam\":{\"receipt\":{\"agentA\":{\"id\":\"did:key:z6Mkkrq4oHrSaU8E2ZctUreJkiXyrVbPRM4FZgPxYx3X8XCS\",\"role\":\"requester\"},\"agentB\":{\"id\":\"did:key:z6MkenP9pSJt69Re5GYC3HeA6JC4BbFSATBbVkjx3TVbE4LL\",\"role\":\"worker\"},\"jobId\":\"http:countersigned-vectors-v0.1\",\"receiptId\":\"sha256:c4b80bbc9472979127dca9491a729396514bc9b6c36391b79ba9419fbb2828c3\",\"receiptVersion\":\"1.0\",\"result\":{\"completedAt\":\"2026-10-01T10:00:01.000Z\",\"outputHash\":\"sha256:e344fa3b83cf2b142293de2a4e56c6b211d4a157f8adb3c954c51ab67f41a46a\"},\"signatures\":{\"agentA\":\"mjXSDW6FMCAL5wBv0ASZ4BR7Dst7KXNMtQF1mrPaApJw0QCzuwWHPsuQqEkVjb4LOTvGfmJzaa6QtK/QLbKTCQ==\",\"agentB\":\"wDDUXpemxNcVEVQfH7kaTZr2rJk/zzLNNpAkx3a70UjyrGK9OPMAX/dhgxsVneGCse/jXV2s6F+n5WLFDqYwBQ==\"},\"task\":{\"capability\":\"translation.tr-en\",\"createdAt\":\"2026-10-01T10:00:00.000Z\",\"specHash\":\"sha256:423007c3904c15d5f43b0485ff3e442b0003925cb283ac7b58c16634429bce20\"},\"verification\":{\"method\":\"payer_confirmation\",\"outcome\":\"success\"}}},\"tag1\":\"inam-receipt\",\"tag2\":\"translation.tr-en\",\"value\":100,\"valueDecimals\":0}",
33
+ "onchainEvent": {
34
+ "clientAddress": "0x1111111111111111111111111111111111111111",
35
+ "feedbackHash": "0x9d7bb681bc76d26fe927d690d0042a1c3176dbf3b4831d498c99f1e3a39ecfe6",
36
+ "value": 100
37
+ },
38
+ "expected": {
39
+ "accepted": true,
40
+ "failedChecks": []
41
+ }
42
+ },
43
+ {
44
+ "id": "WRONG-WALLET-COPY",
45
+ "description": "The genuine file, byte for byte, sent from a wallet that is not the requester's proven erc8004_id (the Sybil copy).",
46
+ "feedbackFile": "{\"agentId\":7,\"agentRegistry\":\"eip155:8453:0x8004000000000000000000000000000000000000\",\"clientAddress\":\"eip155:8453:0x1111111111111111111111111111111111111111\",\"createdAt\":\"2026-10-03T00:00:00.000Z\",\"inam\":{\"receipt\":{\"agentA\":{\"id\":\"did:key:z6Mkkrq4oHrSaU8E2ZctUreJkiXyrVbPRM4FZgPxYx3X8XCS\",\"role\":\"requester\"},\"agentB\":{\"id\":\"did:key:z6MkenP9pSJt69Re5GYC3HeA6JC4BbFSATBbVkjx3TVbE4LL\",\"role\":\"worker\"},\"jobId\":\"http:countersigned-vectors-v0.1\",\"receiptId\":\"sha256:c4b80bbc9472979127dca9491a729396514bc9b6c36391b79ba9419fbb2828c3\",\"receiptVersion\":\"1.0\",\"result\":{\"completedAt\":\"2026-10-01T10:00:01.000Z\",\"outputHash\":\"sha256:e344fa3b83cf2b142293de2a4e56c6b211d4a157f8adb3c954c51ab67f41a46a\"},\"signatures\":{\"agentA\":\"mjXSDW6FMCAL5wBv0ASZ4BR7Dst7KXNMtQF1mrPaApJw0QCzuwWHPsuQqEkVjb4LOTvGfmJzaa6QtK/QLbKTCQ==\",\"agentB\":\"wDDUXpemxNcVEVQfH7kaTZr2rJk/zzLNNpAkx3a70UjyrGK9OPMAX/dhgxsVneGCse/jXV2s6F+n5WLFDqYwBQ==\"},\"task\":{\"capability\":\"translation.tr-en\",\"createdAt\":\"2026-10-01T10:00:00.000Z\",\"specHash\":\"sha256:423007c3904c15d5f43b0485ff3e442b0003925cb283ac7b58c16634429bce20\"},\"verification\":{\"method\":\"payer_confirmation\",\"outcome\":\"success\"}}},\"tag1\":\"inam-receipt\",\"tag2\":\"translation.tr-en\",\"value\":100,\"valueDecimals\":0}",
47
+ "onchainEvent": {
48
+ "clientAddress": "0x3333333333333333333333333333333333333333",
49
+ "feedbackHash": "0x9d7bb681bc76d26fe927d690d0042a1c3176dbf3b4831d498c99f1e3a39ecfe6",
50
+ "value": 100
51
+ },
52
+ "expected": {
53
+ "accepted": false,
54
+ "failedChecks": [
55
+ "fileClientAddressMatchesSender",
56
+ "senderIsRequesterWallet"
57
+ ]
58
+ }
59
+ },
60
+ {
61
+ "id": "TAMPERED-OUTPUT-HASH",
62
+ "description": "result.outputHash edited inside the carried receipt; feedbackHash recomputed over the edited file, sent from the right wallet.",
63
+ "feedbackFile": "{\"agentId\":7,\"agentRegistry\":\"eip155:8453:0x8004000000000000000000000000000000000000\",\"clientAddress\":\"eip155:8453:0x1111111111111111111111111111111111111111\",\"createdAt\":\"2026-10-03T00:00:00.000Z\",\"inam\":{\"receipt\":{\"agentA\":{\"id\":\"did:key:z6Mkkrq4oHrSaU8E2ZctUreJkiXyrVbPRM4FZgPxYx3X8XCS\",\"role\":\"requester\"},\"agentB\":{\"id\":\"did:key:z6MkenP9pSJt69Re5GYC3HeA6JC4BbFSATBbVkjx3TVbE4LL\",\"role\":\"worker\"},\"jobId\":\"http:countersigned-vectors-v0.1\",\"receiptId\":\"sha256:c4b80bbc9472979127dca9491a729396514bc9b6c36391b79ba9419fbb2828c3\",\"receiptVersion\":\"1.0\",\"result\":{\"completedAt\":\"2026-10-01T10:00:01.000Z\",\"outputHash\":\"sha256:2910e9a528b169d433bad2f53171e547726ca717868e29362ec178cfb58b97cb\"},\"signatures\":{\"agentA\":\"mjXSDW6FMCAL5wBv0ASZ4BR7Dst7KXNMtQF1mrPaApJw0QCzuwWHPsuQqEkVjb4LOTvGfmJzaa6QtK/QLbKTCQ==\",\"agentB\":\"wDDUXpemxNcVEVQfH7kaTZr2rJk/zzLNNpAkx3a70UjyrGK9OPMAX/dhgxsVneGCse/jXV2s6F+n5WLFDqYwBQ==\"},\"task\":{\"capability\":\"translation.tr-en\",\"createdAt\":\"2026-10-01T10:00:00.000Z\",\"specHash\":\"sha256:423007c3904c15d5f43b0485ff3e442b0003925cb283ac7b58c16634429bce20\"},\"verification\":{\"method\":\"payer_confirmation\",\"outcome\":\"success\"}}},\"tag1\":\"inam-receipt\",\"tag2\":\"translation.tr-en\",\"value\":100,\"valueDecimals\":0}",
64
+ "onchainEvent": {
65
+ "clientAddress": "0x1111111111111111111111111111111111111111",
66
+ "feedbackHash": "0x7feec35c27e69bccc6da108795931a25b2acbd49bd46dae7787fede41f3eadf0",
67
+ "value": 100
68
+ },
69
+ "expected": {
70
+ "accepted": false,
71
+ "failedChecks": [
72
+ "receiptIdRecomputes",
73
+ "workerSignature",
74
+ "requesterSignature",
75
+ "outputHashMatchesObservedBytes"
76
+ ]
77
+ }
78
+ },
79
+ {
80
+ "id": "OUTPUT-NOT-WHAT-WAS-SERVED",
81
+ "description": "Both signatures are valid, but the provider's outputHash commits to different bytes than the requester received. A requester that recomputes (SPEC §15 step 3) refuses to countersign this.",
82
+ "feedbackFile": "{\"agentId\":7,\"agentRegistry\":\"eip155:8453:0x8004000000000000000000000000000000000000\",\"clientAddress\":\"eip155:8453:0x1111111111111111111111111111111111111111\",\"createdAt\":\"2026-10-03T00:00:00.000Z\",\"inam\":{\"receipt\":{\"agentA\":{\"id\":\"did:key:z6Mkkrq4oHrSaU8E2ZctUreJkiXyrVbPRM4FZgPxYx3X8XCS\",\"role\":\"requester\"},\"agentB\":{\"id\":\"did:key:z6MkenP9pSJt69Re5GYC3HeA6JC4BbFSATBbVkjx3TVbE4LL\",\"role\":\"worker\"},\"jobId\":\"http:countersigned-vectors-v0.1\",\"receiptId\":\"sha256:51968202116a120715be7387e83f03d26ea3c1281d63110a148159e4d4c7cf90\",\"receiptVersion\":\"1.0\",\"result\":{\"completedAt\":\"2026-10-01T10:00:01.000Z\",\"outputHash\":\"sha256:2910e9a528b169d433bad2f53171e547726ca717868e29362ec178cfb58b97cb\"},\"signatures\":{\"agentA\":\"+fXRHCXTDOA+tUqARcBXm2cn8qkIeD+ByCQXPOTC7Nm2LOIc2mmmWQy0UKLcTpRUbvHaNv9mc3Lmz1IzsKUOBA==\",\"agentB\":\"P46kDb36mIo7D4HFeLR/DrVlKdwWfQdZHwnq2y4XmqjE4udQLFI7yNwkFMvgxCspXZL12pGX3ajp11bnreIMDQ==\"},\"task\":{\"capability\":\"translation.tr-en\",\"createdAt\":\"2026-10-01T10:00:00.000Z\",\"specHash\":\"sha256:423007c3904c15d5f43b0485ff3e442b0003925cb283ac7b58c16634429bce20\"},\"verification\":{\"method\":\"payer_confirmation\",\"outcome\":\"success\"}}},\"tag1\":\"inam-receipt\",\"tag2\":\"translation.tr-en\",\"value\":100,\"valueDecimals\":0}",
83
+ "onchainEvent": {
84
+ "clientAddress": "0x1111111111111111111111111111111111111111",
85
+ "feedbackHash": "0x81d5ed166f4c3fa4d7bb918240fae486c92299077fb00494ec65928a0b967770",
86
+ "value": 100
87
+ },
88
+ "expected": {
89
+ "accepted": false,
90
+ "failedChecks": [
91
+ "outputHashMatchesObservedBytes"
92
+ ]
93
+ }
94
+ }
95
+ ]
96
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "id": "x402-evm-eip3009-amount-insufficient-001",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "encodes": "Amount insufficient: the signed value is below the accepted amount.",
9
+ "provenance": [
10
+ "EIP-3009",
11
+ "x402"
12
+ ],
13
+ "description": "The authorization authentically signs a value below the accepted amount, an authorized underpayment caught only after the signature is known genuine.",
14
+ "input": {
15
+ "x402Version": 2,
16
+ "payload": {
17
+ "authorization": {
18
+ "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
19
+ "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
20
+ "value": "9999",
21
+ "validAfter": "1740672089",
22
+ "validBefore": "1740672154",
23
+ "nonce": "0x0303030303030303030303030303030303030303030303030303030303030303"
24
+ },
25
+ "signature": "0x27328664d2ad42fc02b3ee767ef413e6239afd665fd94aa115d0b9e949551c901224e0aecef200d95e8f8516956e91cee0a08cdf6450829d62381f5b635266351c"
26
+ },
27
+ "resource": {
28
+ "url": "https://api.example.com/premium-data",
29
+ "description": "Access to premium market data",
30
+ "mimeType": "application/json"
31
+ },
32
+ "accepted": {
33
+ "scheme": "exact",
34
+ "network": "eip155:84532",
35
+ "amount": "10000",
36
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
37
+ "payTo": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
38
+ "maxTimeoutSeconds": 60,
39
+ "extra": {
40
+ "name": "USDC",
41
+ "version": "2"
42
+ }
43
+ }
44
+ },
45
+ "context": {
46
+ "verification_time": 1740672100
47
+ },
48
+ "expected": {
49
+ "valid": false,
50
+ "reason_code": "AMOUNT_INSUFFICIENT"
51
+ }
52
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "id": "x402-evm-eip3009-cross-chain-replay-001",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "encodes": "Cross-chain replay: signature bound to eip155:8453 presented to an eip155:84532 server.",
9
+ "provenance": [
10
+ "arXiv:2605.11781",
11
+ "EIP-712",
12
+ "EIP-3009",
13
+ "CWE-294"
14
+ ],
15
+ "description": "The authorization was signed under the Base mainnet domain (chainId 8453) and is replayed against a Base Sepolia server. Reconstructing the digest with the target chainId yields a recovered address that is not authorization.from.",
16
+ "input": {
17
+ "x402Version": 2,
18
+ "payload": {
19
+ "authorization": {
20
+ "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
21
+ "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
22
+ "value": "10000",
23
+ "validAfter": "1740672089",
24
+ "validBefore": "1740672154",
25
+ "nonce": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480"
26
+ },
27
+ "signature": "0xbf38fb328d535ba58158f457ec1ba494b1ad0f579960ec8bac6bde7e6a6381371e315305bb368b23a8946c65ee223b9968213823c823ebc3ffdf79984ad234481c"
28
+ },
29
+ "resource": {
30
+ "url": "https://api.example.com/premium-data",
31
+ "description": "Access to premium market data",
32
+ "mimeType": "application/json"
33
+ },
34
+ "accepted": {
35
+ "scheme": "exact",
36
+ "network": "eip155:84532",
37
+ "amount": "10000",
38
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
39
+ "payTo": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
40
+ "maxTimeoutSeconds": 60,
41
+ "extra": {
42
+ "name": "USDC",
43
+ "version": "2"
44
+ }
45
+ }
46
+ },
47
+ "context": {
48
+ "verification_time": 1740672100
49
+ },
50
+ "expected": {
51
+ "valid": false,
52
+ "reason_code": "SIGNER_MISMATCH"
53
+ }
54
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "id": "x402-evm-eip3009-cross-contract-replay-001",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "encodes": "Cross-contract replay: signature bound to a different verifyingContract on the same chain.",
9
+ "provenance": [
10
+ "arXiv:2605.11781",
11
+ "EIP-712",
12
+ "EIP-3009",
13
+ "CWE-294"
14
+ ],
15
+ "description": "The authorization was signed under a different token contract on the same chain. Reconstructing the digest with the required asset as verifyingContract yields a recovered address that is not authorization.from.",
16
+ "input": {
17
+ "x402Version": 2,
18
+ "payload": {
19
+ "authorization": {
20
+ "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
21
+ "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
22
+ "value": "10000",
23
+ "validAfter": "1740672089",
24
+ "validBefore": "1740672154",
25
+ "nonce": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480"
26
+ },
27
+ "signature": "0x4f422c7e4a67230cc483f58c73984167602cac4e819dbc9dc3f7a732b211b35c6005e26c769bb693104cc9618fd576546c1f8344c5cb32ebb80be67dbeb0ad4f1c"
28
+ },
29
+ "resource": {
30
+ "url": "https://api.example.com/premium-data",
31
+ "description": "Access to premium market data",
32
+ "mimeType": "application/json"
33
+ },
34
+ "accepted": {
35
+ "scheme": "exact",
36
+ "network": "eip155:84532",
37
+ "amount": "10000",
38
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
39
+ "payTo": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
40
+ "maxTimeoutSeconds": 60,
41
+ "extra": {
42
+ "name": "USDC",
43
+ "version": "2"
44
+ }
45
+ }
46
+ },
47
+ "context": {
48
+ "verification_time": 1740672100
49
+ },
50
+ "expected": {
51
+ "valid": false,
52
+ "reason_code": "SIGNER_MISMATCH"
53
+ }
54
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "id": "x402-evm-eip3009-domain-name-mismatch-001",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:5042",
7
+ "asset_transfer_method": "eip3009",
8
+ "encodes": "EIP-712 domain name mismatch: signature bound to name \"USD Coin\" presented for a token whose domain name is \"USDC\".",
9
+ "provenance": [
10
+ "EIP-712",
11
+ "EIP-3009",
12
+ "CWE-347"
13
+ ],
14
+ "description": "The authorization was signed for Arc mainnet USDC (chainId 5042) under the EIP-712 domain name \"USD Coin\", the name Base mainnet USDC reports, while the Arc contract's name() is \"USDC\". Reconstructing the digest with the name from accepted.extra yields a recovered address that is not authorization.from.",
15
+ "input": {
16
+ "x402Version": 2,
17
+ "payload": {
18
+ "authorization": {
19
+ "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
20
+ "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
21
+ "value": "10000",
22
+ "validAfter": "1740672089",
23
+ "validBefore": "1740672154",
24
+ "nonce": "0x0404040404040404040404040404040404040404040404040404040404040404"
25
+ },
26
+ "signature": "0xb82e461a54c0d6133e947b3ff1c2b8565db532fe92e2c20e8803eee463d91c7b5dda3ed0672c7a11afddd84a8f3acb59d8e60f12b0c94521459e479131e251261c"
27
+ },
28
+ "resource": {
29
+ "url": "https://api.example.com/premium-data",
30
+ "description": "Access to premium market data",
31
+ "mimeType": "application/json"
32
+ },
33
+ "accepted": {
34
+ "scheme": "exact",
35
+ "network": "eip155:5042",
36
+ "amount": "10000",
37
+ "asset": "0x3600000000000000000000000000000000000000",
38
+ "payTo": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
39
+ "maxTimeoutSeconds": 60,
40
+ "extra": {
41
+ "name": "USDC",
42
+ "version": "2"
43
+ }
44
+ }
45
+ },
46
+ "context": {
47
+ "verification_time": 1740672100
48
+ },
49
+ "expected": {
50
+ "valid": false,
51
+ "reason_code": "SIGNER_MISMATCH"
52
+ }
53
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "id": "x402-evm-eip3009-expired-001",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "encodes": "Expired authorization: verification occurs at or after validBefore.",
9
+ "provenance": [
10
+ "EIP-3009"
11
+ ],
12
+ "description": "The baseline signature is unchanged. Verification occurs past the validity window, at or after validBefore, so the authorization is expired.",
13
+ "input": {
14
+ "x402Version": 2,
15
+ "payload": {
16
+ "authorization": {
17
+ "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
18
+ "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
19
+ "value": "10000",
20
+ "validAfter": "1740672089",
21
+ "validBefore": "1740672154",
22
+ "nonce": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480"
23
+ },
24
+ "signature": "0x6f561d84da69dea3bf562f243b08ec7d3b6b140f7466c7c797d2a24554ed477b60b03719ddabe477324676e2ede73876c8ae62be1c0630b75bb5f050f48b21d71c"
25
+ },
26
+ "resource": {
27
+ "url": "https://api.example.com/premium-data",
28
+ "description": "Access to premium market data",
29
+ "mimeType": "application/json"
30
+ },
31
+ "accepted": {
32
+ "scheme": "exact",
33
+ "network": "eip155:84532",
34
+ "amount": "10000",
35
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
36
+ "payTo": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
37
+ "maxTimeoutSeconds": 60,
38
+ "extra": {
39
+ "name": "USDC",
40
+ "version": "2"
41
+ }
42
+ }
43
+ },
44
+ "context": {
45
+ "verification_time": 1740672200
46
+ },
47
+ "expected": {
48
+ "valid": false,
49
+ "reason_code": "EXPIRED"
50
+ }
51
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "id": "x402-evm-eip3009-network-mismatch-001",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:8453",
7
+ "asset_transfer_method": "eip3009",
8
+ "encodes": "Network mismatch: the target network differs from the accepted network.",
9
+ "provenance": [
10
+ "x402",
11
+ "CAIP-2"
12
+ ],
13
+ "description": "The payment is accepted on eip155:84532 but the verifier's target network is eip155:8453. The plaintext mismatch is caught before any cryptography, while the signature itself is authentic.",
14
+ "input": {
15
+ "x402Version": 2,
16
+ "payload": {
17
+ "authorization": {
18
+ "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
19
+ "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
20
+ "value": "10000",
21
+ "validAfter": "1740672089",
22
+ "validBefore": "1740672154",
23
+ "nonce": "0x0101010101010101010101010101010101010101010101010101010101010101"
24
+ },
25
+ "signature": "0x13e4e6b83168096278da7d426c281a65adc0754fe92405b865daec447d96764e5a54399c88d55f92bdaf2f7f0563f94d1b2c40d305476b2f5ef190cd7c0b252b1c"
26
+ },
27
+ "resource": {
28
+ "url": "https://api.example.com/premium-data",
29
+ "description": "Access to premium market data",
30
+ "mimeType": "application/json"
31
+ },
32
+ "accepted": {
33
+ "scheme": "exact",
34
+ "network": "eip155:84532",
35
+ "amount": "10000",
36
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
37
+ "payTo": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
38
+ "maxTimeoutSeconds": 60,
39
+ "extra": {
40
+ "name": "USDC",
41
+ "version": "2"
42
+ }
43
+ }
44
+ },
45
+ "context": {
46
+ "verification_time": 1740672100
47
+ },
48
+ "expected": {
49
+ "valid": false,
50
+ "reason_code": "NETWORK_MISMATCH"
51
+ }
52
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "id": "x402-evm-eip3009-nonce-replay-001",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "encodes": "Replay of a previously consumed authorization nonce.",
9
+ "provenance": [
10
+ "arXiv:2605.11781",
11
+ "EIP-3009",
12
+ "CWE-294"
13
+ ],
14
+ "description": "The baseline signature is unchanged. The authorization nonce is declared already consumed through the injected context, so the mandate is a replay.",
15
+ "input": {
16
+ "x402Version": 2,
17
+ "payload": {
18
+ "authorization": {
19
+ "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
20
+ "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
21
+ "value": "10000",
22
+ "validAfter": "1740672089",
23
+ "validBefore": "1740672154",
24
+ "nonce": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480"
25
+ },
26
+ "signature": "0x6f561d84da69dea3bf562f243b08ec7d3b6b140f7466c7c797d2a24554ed477b60b03719ddabe477324676e2ede73876c8ae62be1c0630b75bb5f050f48b21d71c"
27
+ },
28
+ "resource": {
29
+ "url": "https://api.example.com/premium-data",
30
+ "description": "Access to premium market data",
31
+ "mimeType": "application/json"
32
+ },
33
+ "accepted": {
34
+ "scheme": "exact",
35
+ "network": "eip155:84532",
36
+ "amount": "10000",
37
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
38
+ "payTo": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
39
+ "maxTimeoutSeconds": 60,
40
+ "extra": {
41
+ "name": "USDC",
42
+ "version": "2"
43
+ }
44
+ }
45
+ },
46
+ "context": {
47
+ "verification_time": 1740672100,
48
+ "seen_nonces": [
49
+ "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480"
50
+ ]
51
+ },
52
+ "expected": {
53
+ "valid": false,
54
+ "reason_code": "NONCE_REPLAY"
55
+ }
56
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "id": "x402-evm-eip3009-not-yet-valid-001",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "encodes": "Not yet valid: verification occurs before validAfter.",
9
+ "provenance": [
10
+ "EIP-3009"
11
+ ],
12
+ "description": "The authorization is signed correctly but its validAfter is after the verification time, so the mandate is not yet valid.",
13
+ "input": {
14
+ "x402Version": 2,
15
+ "payload": {
16
+ "authorization": {
17
+ "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
18
+ "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
19
+ "value": "10000",
20
+ "validAfter": "1740672120",
21
+ "validBefore": "1740672180",
22
+ "nonce": "0x0202020202020202020202020202020202020202020202020202020202020202"
23
+ },
24
+ "signature": "0x6d97fa04e63d458190789542762da22aa56cb9058fde09743f6e1c5e2758ce6e10471b510923c29c75bacd0b7a58e247a0a9ce3005c23e0d3840807a24456d111b"
25
+ },
26
+ "resource": {
27
+ "url": "https://api.example.com/premium-data",
28
+ "description": "Access to premium market data",
29
+ "mimeType": "application/json"
30
+ },
31
+ "accepted": {
32
+ "scheme": "exact",
33
+ "network": "eip155:84532",
34
+ "amount": "10000",
35
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
36
+ "payTo": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
37
+ "maxTimeoutSeconds": 60,
38
+ "extra": {
39
+ "name": "USDC",
40
+ "version": "2"
41
+ }
42
+ }
43
+ },
44
+ "context": {
45
+ "verification_time": 1740672100
46
+ },
47
+ "expected": {
48
+ "valid": false,
49
+ "reason_code": "NOT_YET_VALID"
50
+ }
51
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "id": "x402-evm-eip3009-sig-malleable-high-s-001",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "encodes": "Signature malleability: the s value is in the upper half of the curve order (violates EIP-2).",
9
+ "provenance": [
10
+ "CVE-2022-35961",
11
+ "EIP-2",
12
+ "EIP-2098",
13
+ "EIP-712"
14
+ ],
15
+ "description": "The malleable high s twin of the baseline signature. It still recovers to the signer but a conformant verifier rejects it at the low s check before recovery.",
16
+ "input": {
17
+ "x402Version": 2,
18
+ "payload": {
19
+ "authorization": {
20
+ "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
21
+ "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
22
+ "value": "10000",
23
+ "validAfter": "1740672089",
24
+ "validBefore": "1740672154",
25
+ "nonce": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480"
26
+ },
27
+ "signature": "0x6f561d84da69dea3bf562f243b08ec7d3b6b140f7466c7c797d2a24554ed477b9f4fc8e622541b88cdb9891d1218c787f2007a2893426f84641c6e3bdbab1f6a1b"
28
+ },
29
+ "resource": {
30
+ "url": "https://api.example.com/premium-data",
31
+ "description": "Access to premium market data",
32
+ "mimeType": "application/json"
33
+ },
34
+ "accepted": {
35
+ "scheme": "exact",
36
+ "network": "eip155:84532",
37
+ "amount": "10000",
38
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
39
+ "payTo": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
40
+ "maxTimeoutSeconds": 60,
41
+ "extra": {
42
+ "name": "USDC",
43
+ "version": "2"
44
+ }
45
+ }
46
+ },
47
+ "context": {
48
+ "verification_time": 1740672100
49
+ },
50
+ "expected": {
51
+ "valid": false,
52
+ "reason_code": "SIG_MALLEABLE"
53
+ }
54
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "id": "x402-evm-eip3009-valid-baseline-001",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "encodes": "Well-formed EIP-3009 exact payment that satisfies all requirements.",
9
+ "provenance": [
10
+ "EIP-3009",
11
+ "EIP-712"
12
+ ],
13
+ "description": "A correctly signed EIP-3009 authorization that matches the requirements and is verified inside its validity window.",
14
+ "input": {
15
+ "x402Version": 2,
16
+ "payload": {
17
+ "authorization": {
18
+ "from": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
19
+ "to": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
20
+ "value": "10000",
21
+ "validAfter": "1740672089",
22
+ "validBefore": "1740672154",
23
+ "nonce": "0xf3746613c2d920b5fdabc0856f2aeb2d4f88ee6037b8cc5d04a71a4462f13480"
24
+ },
25
+ "signature": "0x6f561d84da69dea3bf562f243b08ec7d3b6b140f7466c7c797d2a24554ed477b60b03719ddabe477324676e2ede73876c8ae62be1c0630b75bb5f050f48b21d71c"
26
+ },
27
+ "resource": {
28
+ "url": "https://api.example.com/premium-data",
29
+ "description": "Access to premium market data",
30
+ "mimeType": "application/json"
31
+ },
32
+ "accepted": {
33
+ "scheme": "exact",
34
+ "network": "eip155:84532",
35
+ "amount": "10000",
36
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
37
+ "payTo": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
38
+ "maxTimeoutSeconds": 60,
39
+ "extra": {
40
+ "name": "USDC",
41
+ "version": "2"
42
+ }
43
+ }
44
+ },
45
+ "context": {
46
+ "verification_time": 1740672100
47
+ },
48
+ "expected": {
49
+ "valid": true,
50
+ "reason_code": "VALID"
51
+ }
52
+ }