agents/x402: a 2-of-2 contract wallet (ERC-1271) that neither the agent nor its owner can spend from alone

AereAgentWallet2of2 holds the agent's tokens and accepts only the agent's signature followed by the policy
service's, over the same digest. In the new cosign mode the wallet service signs only its half, after every
check it already made, and the agent adds its half only after it recomputes the payment itself (payer,
recipient, amount, the nonce of its own ledger entry, validity, digest, declared policy signer).
verifica-plati.mjs requires the wallet's code on chain to be exactly the compiled contract with the two
signers; recompileaza-contract.mjs recompiles the published artifact byte for byte with solc 0.8.23.

Tests: co-signing 16/16, payment verifier 14/14, negative control 30/30, wallet 25/25. On the public
testnet 28001 on 2026-09-29: 13/13 with the 2-of-2 wallet (the agent alone and the policy signer alone
refused by the facilitator and by the token asked on chain) and 9/9 with the wallet key. Evidence in
dovezi-28001/. Nothing here has been run on the Aere Network mainnet.
This commit is contained in:
Liviu committed 2026-09-30 00:48:10 +03:00
1 parent 2293c1da86
commit 8b608fe57f
20 files changed
+1480 -40

No files matched your search

+4 -2
View File
@@ -55,8 +55,10 @@ printed; the tool creates them with mode 0600, which has no effect on Windows (p
## Paying over x402
`x402/` holds the agent wallet: a service that keeps the payment key for the owner and signs an x402 payment only when the agent's
ledger records it and the policy allows it, with the wallet as the witness of the ledger's heads and time. It was run end to end
on the public testnet 28001 on 2026-09-29, and the evidence is there with a verifier anyone can run. See `x402/README.md`.
ledger records it and the policy allows it, with the wallet as the witness of the ledger's heads and time. With a 2-of-2 contract
wallet (`AereAgentWallet2of2`, ERC-1271) the money leaves only with the agent's signature and the wallet service's together, so
neither the agent nor the owner can spend alone. Both were run end to end on the public testnet 28001 on 2026-09-29, and the
evidence is there with a verifier anyone can run. See `x402/README.md`.
## What the verifier can and cannot see