Earned a Ship Weeks badge.

About
Leashed lets an AI agent pay a company's vendors on-chain without giving it the keys to the kingdom. Two independent leashes bound it: the LeashedVault smart contract (whitelisted vendors, per-payment, per-vendor and daily caps, owner approval above a threshold) and a QoreChain EVM authorization window that only the owner's ML-DSA-87 post-quantum key can open, scoped to the vault alone. Every payment is simulated before it's sent, so prompt injections and over-limit payments are refused and nothing is spent. It's live on the qorechain-diana testnet, with real payments, blocked attempts and an owner-approval flow.
How it's made
Architecture Leashed has three parts: - LeashedVault.sol, a Solidity contract on QoreChain's EVM lane that holds the company's fUSD. - A Next.js app: a live dashboard plus an AI agent route. - Node ops scripts built on @qorechain/sdk. The AI agent is Claude with tools. It never holds authority of its own. It can only call the vault, and only while a window is open. Two independent leashes 1. The contract leash (how much, and to whom). The vault enforces a vendor whitelist, per-payment, per-vendor and daily caps, and owner approval above a threshold (request, approve, execute). It also has a pause switch. Only the owner can change the rules. 2. The protocol leash (where, how often, how long). QoreChain's EVM authorization window (MsgOpenEVMWindow) lets the agent's account call only the vault (allowed_targets), for a limited number of transactions and blocks. Opening a window requires an ML-DSA-87 signature, so the agent can't renew its own leash, and a stolen ECDSA key is useless once the window closes. We need both because the window's value cap counts native QOR only. Token amounts have to be limited by the contract. QoreChain features we used - Unified eth_secp256k1 accounts (one key, with both qor1 and 0x addresses). - ML-DSA-87 key registration with proof of possession (MsgRegisterPQCKeyV2). - Hybrid ECDSA + ML-DSA-87 signed transactions. - Scoped EVM windows, and the window status REST endpoint. - Fest-token conversion from bank coin to ERC-20 (MsgConvertCoin) to fund the vault with fUSD. - Owner, agent and drill accounts, each with its own registered PQC key. Safety by design - Every agent payment is simulated with eth_call before it's sent, so a refused payment costs nothing and returns the vault's exact reason (for example NeedsApproval(1200, 500)). - Invoice text is passed to the model as untrusted data. The contract, not the LLM, is the security boundary. What was hard - The wallet's key. The QoreX mobile wallet uses a Cosmos (coin-118) key, so it can't sign EVM transactions. We created separate unified accounts for the owner and the agent. - Getting fUSD into the vault. The faucet delivers fUSD as a bank coin, and QoreX can't send fest tokens. We wrote a converter that signs with the wallet's address-bound (canonical) ML-DSA key, derived from its recovery phrase, and converts the fUSD straight into the owner's ERC-20 balance. - Recording blocked attempts. Reverted transactions leave no on-chain logs, so we record them from the simulation step instead. Everything runs on the qorechain-diana testnet. Explorer links are on the dashboard.
Timeline
Pushed 3 commits to main
- d2fb085 contracts: PqcAttestor (plain CALLs to pqcKeyStatus + pqcVerify precompiles), deployed · hackerjose25
- 5ce626e LeashedVault v2.1: precompile address as immutable constructor arg so the full address is in deploy input + code; migrate v2 -> v2.1 · hackerjose25
- ef4cb9a LeashedVault v2: on-chain PQC key check via pqcKeyStatus precompile; migrate from v1; web + docs · hackerjose25
Newly verified on chain: AMM pools, QoreSeal and the encryption key registry
Earned a Ship Weeks badge.
Earned a Ship Weeks badge.
Earned a Ship Weeks badge.
New project.
Comments and questions
- No comments yet.