agent-receipt-verify 0.2.3 → 0.2.5

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 (31) hide show
  1. package/README.md +38 -3
  2. package/bin/cli.mjs +41 -24
  3. package/package.json +5 -3
  4. package/src/acceptance-binding.mjs +309 -0
  5. package/src/settlement-link-vectors.mjs +124 -11
  6. package/src/verify-delivery.mjs +507 -0
  7. package/src/x402-conformance-check.mjs +41 -5
  8. package/src/x402-discovery-census.mjs +24 -1
  9. package/src/x402-offer-receipt.mjs +49 -3
  10. package/tools/naar-kanon-vorm.mjs +172 -0
  11. package/tools/pack-inhoud.mjs +45 -1
  12. package/vectors/acceptance-binding/crossed-deliverable.json +40 -0
  13. package/vectors/acceptance-binding/pairs-same-deliverable.json +39 -0
  14. package/vectors/acceptance-binding/real-record-as-issued.json +68 -0
  15. package/vectors/acceptance-binding/real-record-crossed-deliverable.json +65 -0
  16. package/vectors/acceptance-binding/real-record-crossed-x402-keys.json +74 -0
  17. package/vectors/acceptance-binding/real-record-with-producer-key.json +66 -0
  18. package/vectors/acceptance-binding/real-record-x402-keys-match.json +76 -0
  19. package/vectors/settlement-link-kanon/README.md +69 -0
  20. package/vectors/settlement-link-kanon/find-candidates-onchain.json +43 -0
  21. package/vectors/settlement-link-kanon/no-candidates-not-measured.json +42 -0
  22. package/vectors/settlement-link-kanon/opens-live-2.json +47 -0
  23. package/vectors/settlement-link-kanon/opens-live-3.json +47 -0
  24. package/vectors/settlement-link-kanon/opens-live.json +47 -0
  25. package/vectors/settlement-link-kanon/two-identical-payments.json +76 -0
  26. package/vectors/settlement-link-kanon/wrong-nonce-live-2.json +46 -0
  27. package/vectors/settlement-link-kanon/wrong-nonce-live-3.json +46 -0
  28. package/vectors/settlement-link-kanon/wrong-nonce-live.json +46 -0
  29. package/vectors/settlement-link-kanon/wrong-salt-live-2.json +46 -0
  30. package/vectors/settlement-link-kanon/wrong-salt-live-3.json +46 -0
  31. package/vectors/settlement-link-kanon/wrong-salt-live.json +46 -0
@@ -0,0 +1,46 @@
1
+ {
2
+ "id": "x402-evm-settlement-link-wrong-nonce-live",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "verifies": "receipt-to-settlement",
9
+ "encodes": "A candidate that is not this payment must not satisfy the commitment.",
10
+ "provenance": [
11
+ "x402 offer-receipt extension section 5.6.4, as proposed in pull request 3827 at commit 0e492d6 and not on main",
12
+ "EIP-3009"
13
+ ],
14
+ "description": "The correct receipt and salt, but a candidate nonce that belongs to a different settlement by the same payer. The commitment must not open on it.",
15
+ "input": {
16
+ "receipt": {
17
+ "format": "eip712",
18
+ "payload": {
19
+ "version": 2,
20
+ "network": "eip155:84532",
21
+ "resourceUrl": "https://api.tokenizen.nl/api/paid/verify-ownership",
22
+ "payer": "0x87f344b6Ec48A936373d774D3De8649DEEB66Ee1",
23
+ "issuedAt": 1792187030,
24
+ "transaction": "",
25
+ "authorizationMethod": "eip3009",
26
+ "authorizationCommitment": "0x5c35a61a09a566a9c284fad18a70ac2ddfff34d01d2a3ce776ce94e8d5b38ff8"
27
+ },
28
+ "signature": "0x78615cb22986af0aad6e08b74ca78773bb58ece21660e84e4b35b3e5c1841b0075238ca9bfdf0f969ad3f2903af8f391fafd1b3fc7ebbf1fb5c949a3948fccde1c"
29
+ },
30
+ "authorizationSalt": "0xea85b2473363fd8fff1ccdd7f8638be8b47c7c05023e3e2e3f81bebb085ba2ad",
31
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
32
+ "candidates": [
33
+ {
34
+ "authorizer": "0x87f344b6Ec48A936373d774D3De8649DEEB66Ee1",
35
+ "nonce": "0x515895dfac6f148a4cfdf5c4f8266b7859dbd6534cdf77104b1be9f484eb5005"
36
+ }
37
+ ]
38
+ },
39
+ "context": {
40
+ "note": "Both nonces were really consumed by this payer; only one belongs to this receipt."
41
+ },
42
+ "expected": {
43
+ "valid": false,
44
+ "reason_code": "NOT_LINKED"
45
+ }
46
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "id": "x402-evm-settlement-link-wrong-salt-live-2",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "verifies": "receipt-to-settlement",
9
+ "encodes": "A salt that belongs to another payment must not open this commitment.",
10
+ "provenance": [
11
+ "x402 offer-receipt extension section 5.6.4, as proposed in pull request 3827 at commit 0e492d6 and not on main",
12
+ "EIP-3009"
13
+ ],
14
+ "description": "The same receipt and the same candidate, but the salt of a different payment. The commitment must not open. This is the case the whole construction rests on: without the salt, two payments with identical terms could not be told apart.",
15
+ "input": {
16
+ "receipt": {
17
+ "format": "eip712",
18
+ "payload": {
19
+ "version": 2,
20
+ "network": "eip155:84532",
21
+ "resourceUrl": "https://api.tokenizen.nl/api/paid/verify-ownership",
22
+ "payer": "0x87f344b6Ec48A936373d774D3De8649DEEB66Ee1",
23
+ "issuedAt": 1792187518,
24
+ "transaction": "",
25
+ "authorizationMethod": "eip3009",
26
+ "authorizationCommitment": "0xfecee93e1aec7d6858a218bf324f23e2a4eed07925d8d4542b9662c5026e3d22"
27
+ },
28
+ "signature": "0x02f5ba0d2b7928a2dbb1d8845b664a79d38eebcd0a2c4532ed3c6b922051bf8d47c8aafb0520a875a708e3ed480d84a537962ea90d66ce2ee3811f4229aa8b401b"
29
+ },
30
+ "authorizationSalt": "0xea85b2473363fd8fff1ccdd7f8638be8b47c7c05023e3e2e3f81bebb085ba2ad",
31
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
32
+ "candidates": [
33
+ {
34
+ "authorizer": "0x87f344b6Ec48A936373d774D3De8649DEEB66Ee1",
35
+ "nonce": "0x515895dfac6f148a4cfdf5c4f8266b7859dbd6534cdf77104b1be9f484eb5005"
36
+ }
37
+ ]
38
+ },
39
+ "context": {
40
+ "note": "Both salts are real and come from two separate payments with identical terms."
41
+ },
42
+ "expected": {
43
+ "valid": false,
44
+ "reason_code": "NOT_LINKED"
45
+ }
46
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "id": "x402-evm-settlement-link-wrong-salt-live-3",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "verifies": "receipt-to-settlement",
9
+ "encodes": "A salt that belongs to another payment must not open this commitment.",
10
+ "provenance": [
11
+ "x402 offer-receipt extension section 5.6.4, as proposed in pull request 3827 at commit 0e492d6 and not on main",
12
+ "EIP-3009"
13
+ ],
14
+ "description": "The same receipt and the same candidate, but the salt of a different payment. The commitment must not open. This is the case the whole construction rests on: without the salt, two payments with identical terms could not be told apart.",
15
+ "input": {
16
+ "receipt": {
17
+ "format": "eip712",
18
+ "payload": {
19
+ "version": 2,
20
+ "network": "eip155:84532",
21
+ "resourceUrl": "https://api.tokenizen.nl/api/paid/verify-ownership",
22
+ "payer": "0x87f344b6Ec48A936373d774D3De8649DEEB66Ee1",
23
+ "issuedAt": 1792188211,
24
+ "transaction": "",
25
+ "authorizationMethod": "eip3009",
26
+ "authorizationCommitment": "0xea8dd34b8beac90f021a4e8d893a689c25249f86947770c8e6647c1cde206008"
27
+ },
28
+ "signature": "0x5b3a70cce6978ab44e51828b5ebbc55522e98b015045d94559d369420698da3b5309b28050dcb00ce14d65c8b230a273f8ff5ebff6410c6ae2a308e422ed5a611b"
29
+ },
30
+ "authorizationSalt": "0xea85b2473363fd8fff1ccdd7f8638be8b47c7c05023e3e2e3f81bebb085ba2ad",
31
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
32
+ "candidates": [
33
+ {
34
+ "authorizer": "0x87f344b6Ec48A936373d774D3De8649DEEB66Ee1",
35
+ "nonce": "0x4b133bbec3ce0d8177a9010784faedb459f04384b45316bb526a5f96c90a70de"
36
+ }
37
+ ]
38
+ },
39
+ "context": {
40
+ "note": "Both salts are real and come from two separate payments with identical terms."
41
+ },
42
+ "expected": {
43
+ "valid": false,
44
+ "reason_code": "NOT_LINKED"
45
+ }
46
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "id": "x402-evm-settlement-link-wrong-salt-live",
3
+ "schema_version": "3.0.0",
4
+ "protocol": "x402",
5
+ "scheme": "exact",
6
+ "network": "eip155:84532",
7
+ "asset_transfer_method": "eip3009",
8
+ "verifies": "receipt-to-settlement",
9
+ "encodes": "A salt that belongs to another payment must not open this commitment.",
10
+ "provenance": [
11
+ "x402 offer-receipt extension section 5.6.4, as proposed in pull request 3827 at commit 0e492d6 and not on main",
12
+ "EIP-3009"
13
+ ],
14
+ "description": "The same receipt and the same candidate, but the salt of a different payment. The commitment must not open. This is the case the whole construction rests on: without the salt, two payments with identical terms could not be told apart.",
15
+ "input": {
16
+ "receipt": {
17
+ "format": "eip712",
18
+ "payload": {
19
+ "version": 2,
20
+ "network": "eip155:84532",
21
+ "resourceUrl": "https://api.tokenizen.nl/api/paid/verify-ownership",
22
+ "payer": "0x87f344b6Ec48A936373d774D3De8649DEEB66Ee1",
23
+ "issuedAt": 1792187030,
24
+ "transaction": "",
25
+ "authorizationMethod": "eip3009",
26
+ "authorizationCommitment": "0x5c35a61a09a566a9c284fad18a70ac2ddfff34d01d2a3ce776ce94e8d5b38ff8"
27
+ },
28
+ "signature": "0x78615cb22986af0aad6e08b74ca78773bb58ece21660e84e4b35b3e5c1841b0075238ca9bfdf0f969ad3f2903af8f391fafd1b3fc7ebbf1fb5c949a3948fccde1c"
29
+ },
30
+ "authorizationSalt": "0x63072ea656fe922bf04c9cefc4275314d695fff01e5b57f6628c8df0252cc5dc",
31
+ "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
32
+ "candidates": [
33
+ {
34
+ "authorizer": "0x87f344b6Ec48A936373d774D3De8649DEEB66Ee1",
35
+ "nonce": "0x1120412c78ea1b2e8bf9eacfc3264c71a23ecd9b1fa579eb16030693344d5dfe"
36
+ }
37
+ ]
38
+ },
39
+ "context": {
40
+ "note": "Both salts are real and come from two separate payments with identical terms."
41
+ },
42
+ "expected": {
43
+ "valid": false,
44
+ "reason_code": "NOT_LINKED"
45
+ }
46
+ }