Skip to content
QORECHAIN
Register

Post-Quantum AI Agents

LEASH

The key will leak. The chain should not care.

Share on X

About

LEASH gives an AI agent money without giving it your wallet. You write one sentence: "max 2 QOR per payment, 6 QOR a day, only pay qor1…, expires in 24 hours", and the owner signs it with an ML-DSA-87 key. The policy is installed in LeashVault, a Solidity contract that holds the budget itself. The agent never holds funds. It drives the treasury through a linked authenticator, and every payment needs two signatures: the agent's authenticator on the call, and the agent's post-quantum key on the intent hash, checked on chain by QoreChain's pqcVerify precompile against the key the chain already holds for that account. The vault checks the recipient too. The chain's spending rules bound how much a linked key may move, but not who it may pay, so the allow-list lives in the contract next to the caps, the expiry and the replay nonce. A leaked classical key alone cannot move money, and the agent cannot widen its own leash: the policy is signed by the owner's post-quantum key, and the owner can pause the vault or withdraw the unspent budget with that same key. The console at leash-qore.fly.dev runs it live against QoreChain testnet: one sentence, one real payment, and eight real attacks that each name the layer that stopped them.

How it's made

Architecture: Three roles, three keys. The owner holds the root key (secp256k1 + ML-DSA-87) and signs the policy. The agent holds only a linked ed25519 authenticator plus its own ML-DSA-87 key. The relayer pays fees and broadcasts the agent's authorisation. The money sits in LeashVault (Solidity), not in the treasury. Two layers, both on chain: x/abstractaccount binds who may act: the authenticator's permissions, the spending rule (per-execution cap, daily cap, the one allowed call target), the expiry, and instant revocation. LeashVault binds what leaves: per-payment cap, daily cap, recipient allow-list, expiry and replay nonce, plus the owner's ML-DSA-87 signature over the policy and the agent's over each intent, both verified by pqcVerify against the key read from pqcKeyStatus. What was hard: Chain v3.2.8 requires a possession proof on every authenticator link, so the five-line link text is built and signed in Rust. The chain reports a refused message as code 0 with an abstractaccount_execution_failed event, so refusals are read from that event and the contract's own error selector is recovered by replaying the call with eth_call; code 0 is never shown as money moved. And a bare EVM value transfer carries no calldata, so allowed_evm_calls does not stop it: the treasury therefore holds nothing, the vault is the custodian, and the owner's key is the only way to move what is left. Kits: qorechain-sdk 0.14 and qorechain-pqc in Rust; Solidity with Foundry for the vault, its 38 unit tests and 4 fork tests against the live precompiles; the backend is Rust/Axum, and it keeps the leash in a JSON file so a machine suspended to zero comes back with its history.

Timeline

LEASHPost-Quantum AI Agents

Pushed 1 commit to main

  • 26ecf83 Join the Q-Day Drill with a dedicated drill leash · Kiter
LEASHPost-Quantum AI Agents

Pushed 2 commits to main

  • 1dae875 Put the copyright holder on the repository owner · PhiBao
  • c49c63c Redraw the README diagram, resize the cover, style the withdraw button · PhiBao
LEASHPost-Quantum AI Agents

New project.

Comments and questions

  • No comments yet.