Stranger pass of 21 Oct: x402 verify-payments reads all wallet transfers in windows under the endpoint range limit (was UNMEASURED on the live testnet; now VALID), device-operation reputation is byte-identical in JS --canonical and Python, module README figures as measured, .gitignore for the keys the examples write, temporary directories removed by the probes

This commit is contained in:
Aere Network committed 2026-10-21 23:20:15 +03:00
1 parent 82c5b261ac
commit fcece14a12
18 files changed
+266 -45

No files matched your search

+14 -2
View File
@@ -35,6 +35,12 @@ Node.js 24 and `ethers` (for EIP-712 and secp256k1: `npm install` here). Payment
`verifica-plati.mjs` then proves from the outside that a wallet's on-chain payments were allowed by the agent's policy: the ledger
verifies, each payment names an allowed entry, its transaction emits `AuthorizationUsed(wallet, sha256(entry hash))` and the
`Transfer` of that amount, and with `--all-transfers` every transfer out of the wallet since a block is one of those payments.
The blocks from `fromBlock` to the head read once with `eth_blockNumber` are read in windows of at most `--window` blocks (5,000 by
default; public endpoints refuse a long range, and on 2026-10-21 the testnet's refused 10,000 with `Requested range exceeds maximum
RPC range limit`), four at a time. A window counts only when the endpoint answers with a list; an error, an answer that is not a list
or a failed request leaves the window unread, and then the check is `UNMEASURED` with the count of unread windows, never "no
transfers" (a transfer out of the wallet that is not a payment, found in a window that was read, is `INVALID` all the same). Above
`--max-requests` windows (2,000 by default) nothing is asked and the check is `UNMEASURED`, saying how many windows it would need.
## Use
@@ -90,8 +96,8 @@ Measured on 2026-09-29 (Node.js 24.14.1, ethers 6.16.0):
|---|---|
| `node proba-wallet.mjs` | 25/25 without a network, real EIP-712 signatures and ML-DSA-65 keys: five paid purchases through a local facilitator, the sixth refused by the policy; attacks by the holder of the agent key (a forged "allowed" entry over the limit, an entry for another amount, the same entry twice, a branch with its equivocation proof, a new ledger under a changed policy, a backdated entry, two branches sent at the same time), the owner's revocation, human approval, a payment for another requirement and a replayed payment at the seller |
| `node proba-cosign.mjs` | 16/16 without a network (the contract's ERC-1271 check emulated in the local facilitator): three purchases from a 2-of-2 wallet with both halves in order, the fourth refused by the policy; the agent alone, and the policy signer alone, cannot pay; a compromised wallet service that changes the recipient, the payer, the amount, the nonce, the validity, the digest, or signs with another key: the agent refuses to co-sign; the co-signing service over HTTP |
| `node proba-verifica-plati.mjs` | 14/14 without a network, on the chain responses recorded for both testnet runs below, including the contract's code (one byte changed, another signer named, or no code at the wallet: `INVALID`) |
| `node control-negativ-wallet.mjs` | 30/30: each guard of the wallet, the client (including the agent's co-signing checks), the seller and the verifier (including the contract code) removed in a copy, and the named check must fail |
| `node proba-verifica-plati.mjs` | 24/24 on 2026-10-21 without a network, on the chain responses recorded for the testnet runs below (the latest EOA wallet run and the 2-of-2 run; until that day the pattern of the EOA file also matched the 2-of-2 file, so rows 1-10 judged the 2-of-2 run and no row judged an EOA run), including the contract's code (one byte changed, another signer named, or no code at the wallet: `INVALID`); and `--all-transfers` on an endpoint that refuses long ranges: 3,178,224 blocks read in 636 windows of 5,000 (`VALID`), the transfers found in different windows, a foreign transfer in the last window (`INVALID`), one request over the whole range, a window answering an error, a non-list or HTTP 429, a head below `fromBlock`, a range above the request cap (each `UNMEASURED`, never `VALID`), and a foreign transfer found while another window is unread (`INVALID`) |
| `node control-negativ-wallet.mjs` | 36/36 on 2026-10-21: each guard of the wallet, the client (including the agent's co-signing checks), the seller and the verifier (including the contract code, and since 2026-10-21 the windows of `--all-transfers`: one request instead of windows, an unread window or a non-list taken for an empty one, an unread window hiding a foreign transfer, the request cap, a head below `fromBlock`) removed in a copy, and the named check must fail |
| `AERE_TESTNET_KEY_FILE=<funded testnet key> node proba-x402-testnet.mjs` | 9/9 on the public testnet 28001 through its x402 facilitator: a fresh wallet funded with 0.05 tUSD, three purchases of 0.01 paid and settled on chain, the fourth refused by the policy, a replayed payment refused, the balances and the used authorization nonces read on chain, and the evidence file verified `VALID` (a changed amount, or a payment removed from the file: `INVALID`) |
| `AERE_TESTNET_KEY_FILE=<funded testnet key> node proba-cosign-testnet.mjs` | 13/13 on the public testnet 28001: an `AereAgentWallet2of2` deployed from `AereAgentWallet2of2.json` with two fresh keys, its code on chain exactly the compiled code; `isValidSignature` on chain yes only for agent then policy signer, no for seven other forms; three purchases of 0.01 from it through the testnet facilitator, the fourth refused by the policy; the agent alone and the policy signer alone refused by the facilitator, and by the token itself asked on chain without the facilitator; balances and nonces on chain; the evidence verified `VALID` with the contract code (another policy signer named: `INVALID`) |
| `node recompileaza-contract.mjs --solc <solc 0.8.23>` | `IDENTICAL`: 1193 bytes of creation code and 934 of runtime code, with the native solc 0.8.23+commit.f704f362 |
@@ -106,5 +112,11 @@ node verifica-plati.mjs dovezi-28001/plati-agent-2026-09-29-20-23-16.json --rpc
node verifica-plati.mjs dovezi-28001/plati-agent-2of2-2026-09-29-21-29-48.json --rpc https://testnet-rpc.aere.network --all-transfers
```
Measured on 2026-10-21 against the testnet endpoint: both `VALID` (exit 0), every transfer out of each wallet since its `fromBlock`
read in 636 and 635 windows of 5,000 blocks (about 3.2 million blocks each, 3 transfers each, all three payments of the ledger), in
8 min 18 s and 6 min 55 s (the endpoint took 3 to 10 seconds per window of old blocks), and again from a fresh clone of the
public copy as staged that evening, `VALID` both, in 6 min 6 s and 5 min 34 s. Before that day both commands answered
`UNMEASURED` (exit 2): they asked for the whole range in one request, and the endpoint refused it.
tUSD is the testnet's EIP-3009 token, minted by a faucet and worth nothing. Nothing here has been run on the Aere Network mainnet.
Code comments and test names are in Romanian; messages, data and the documentation are in English. No third party has reviewed it.