agents: the chain as the witness of an agent's ledger - a notarized head, read through the AIP-23 verifier under a post-quantum certified anchor, bounds entry times from below; run on testnet 28001 with its evidence

This commit is contained in:
Aere Network committed 2026-09-30 09:43:10 +03:00
1 parent 7812e44e98
commit 01c0c5e211
7 files changed
+811 -4

No files matched your search

+29 -1
View File
@@ -60,12 +60,37 @@ wallet (`AereAgentWallet2of2`, ERC-1271) the money leaves only with the agent's
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`.
## The chain as the witness of the ledger (2026-09-30)
Without a witness, an entry's time is only the statement of whoever holds the agent key. `agent-ancora.mjs` makes the chain that
witness: the ledger's head (sequence number and hash) becomes an AIP-23 envelope, its hash is notarized on AereNotary, and the
first-seen time the contract records, read through the AIP-23 reference verifier under a post-quantum certified anchor (a Merkle
proof in the certified state), becomes an anchor `{seq, hash, at}` for `verify --anchors`.
```
node agent-ancora.mjs head --ledger ledger.json --out head.json # no network
node agent-ancora.mjs notarize --head head.json --rpc <url> --key-file <key> --out notarized.json # needs ethers (x402/)
node agent-ancora.mjs anchors --ledger ledger.json --head notarized.json --rpc <url> \
--chain 2800 --verify-proof <verify-proof.mjs from aere-node> --out anchors.json # --chain: the chain whose time you accept
node agent-cli.mjs verify --ledger ledger.json --policy policy.json --anchors anchors.json
```
With the anchor, an entry after the notarized head cannot claim a time before its first-seen time (minus the 300 s tolerance), an
entry up to the head cannot claim a time after it, and a branch that does not contain the head does not verify. The time is the
chain's, not the agent's and not the notarizer's: whoever notarizes can only notarize late, which weakens the bound, not move it
earlier. Only the hash of the head's statement goes on chain, nothing of the ledger. The anchors file is the output of the
verifier's own run, with the RPC endpoint and the AIP-23 verifier it chose; an anchors file handed over by the party being verified
proves nothing. `anchors` answers not measured (exit 2) while the finality is pending or when the verifier cannot be run, never an
anchor it did not certify. `notarize` reads the chain id from the endpoint and refuses chain 2800 (a real transaction paid by the
key's account) unless `AERE_CONFIRM_MAINNET=yes`.
## What the verifier can and cannot see
- **Time.** An entry's time is the statement of whoever holds the agent key. The verifier bounds it from above with its clock. It
bounds it from below only with a witness: `anchors` (ledger heads seen by a witness at a known time, for example notarized) or
`notBefore`. Without one, the key holder can backdate entries into past windows and spend the limit several times; the result
says so (`time.lowerBound: "none..."`). With anchors, backdating is limited to the interval between two anchors. The library
says so (`time.lowerBound: "none..."`). With anchors, backdating is limited to the interval between two anchors; the chain itself
can be that witness (above). The library
itself refuses to write an entry more than 300 seconds away from its clock.
- **One ledger per agent and policy.** The ledger's session is derived from the agent and the policy hash, so a "second ledger" is
a branch of the same one. Two branches signed by the agent are a proof of equivocation (`findEquivocation`, `verifyEquivocation`)
@@ -85,6 +110,9 @@ Measured on 2026-09-29 (Node.js 24.14.1, Windows):
| `node proba-agent-ledger.mjs` | 51/51: limits over the ledger, identity, tampering, a re-signed false decision, a looser policy under the real hash, backdating (refused when written; caught with anchors or `notBefore`), a branch, equivocation proofs, resuming |
| `node proba-agent-aprobare.mjs` | 39/39: threshold, unnamed or repeated approvers, classical keys, another action or other tool arguments, reused nonces (also after a restart), expiry, approvals across branches, revocation, an omitted revocation |
| `node proba-agent-cli.mjs` | 23/23 on Windows, through files and processes only; on Linux and macOS one more test checks the 0600 mode of the key (not measured here) |
| `node proba-agent-ancora.mjs` | 26/26 without a network (the AIP-23 verifier's answer in its own form): the head, the time read from the finality level (pending, failed, a mismatched or unknown form: no anchor), an envelope that claims another time, backdating caught with the anchor and not without it, another branch, the refusals before any transaction (a modified head, chain 2800 without confirmation, no contract at the notary) |
| `AERE_TESTNET_KEY_FILE=<funded testnet key> node proba-agent-ancora-testnet.mjs` | 7/7 on the public testnet 28001, measured 2026-09-30: a real ledger's head notarized, post-quantum finality from the published AIP-23 verifier within 20 s, the certified time equal to the contract's first-seen time, the honest continuation valid with the anchor, a backdated continuation valid without it and caught with it, another branch refused; evidence in `dovezi-ancora-28001/` |
| `node control-negativ-ancora.mjs` | 11/11: each anchoring guard removed in a copy turns its named test red |
| `node control-negativ-aprobare.mjs` | 26/26: each guard is removed in a copy, one at a time, and the named test must fail for that reason; a test that stops before its summary counts as a failure of the control |
The data format is version 2 (2026-09-29). Code comments, test names and most internal names are in Romanian; messages, data and