Skip to content
QORECHAIN
Register

Post-Quantum AI Agents

PayeeProof

An AI payment agent that pays subcontractors on time, and only the right one

Share on X

About

PayeeProof is a construction payment desk for a fictional small builder. A finance lead independently verifies completed work, the amount owed, the supplier's signing identity and the supplier's payout wallet, then approves each milestone on chain. A constrained AI agent reads the supplier's signed invoice, checks it against that approval with seven deterministic checks, and pays the approved wallet when the invoice is due. If an invoice asks for a different payout wallet, it is held and the changed characters are highlighted. Why it matters: the UK Small Business Commissioner reported on 25 November 2026 that 79% of UK subcontractors are always paid late, citing Payapps research. UK Finance reported £18.7 million of UK-wide invoice and mandate scam losses in January–June 2026, including £14.0 million involving non-personal accounts. These figures cover the UK as a whole; the construction use case is our design choice. Sources: Small Business Commissioner · UK Finance Half Year Fraud Report 2026.

How it's made

Architecture: one Node service serves the React/Vite web app, the API and a single settlement worker, with SQLite (WAL mode) for persistence. The contract is MilestonePaymentAccount.sol (Solidity 0.8.28, OpenZeppelin 5.2). 1. Buyer approval on chain. The owner (connected through QoreX) calls approveMilestone to fix the supplier's signing key, payout wallet, exact amount and due date for each milestone. grantAgent gives the agent a per-payment cap (0.50 QOR), a total budget (1.00 QOR) and an expiry. 2. Authenticated supplier messaging. Each invoice is plain UTF-8 text plus an EIP-712 envelope (chain 9800, the deployed account as verifying contract). The envelope binds the buyer, milestone, invoice ID, payee, amount in base units, expiry and the Keccak-256 hash of the exact invoice bytes. 3. Isolated AI reader. The model treats invoice text as untrusted data. It has no signing keys, no database writes and no transaction tools, and every field it extracts must quote a full line of the original text word for word. Seven deterministic checks then run: signature, byte digest, payee, amount, quoted evidence, milestone binding, and due window. Any mismatch holds the invoice and records a reason code. 4. The contract, not the agent, decides who gets paid. settle() reads the payout wallet and amount from the contract's own storage, checks the agent's grant, cap and budget, marks the milestone paid before transferring, and reverts with InvoiceMismatch if the signed wallet differs from the approved one. 5. Post-quantum authorization on QoreChain Diana (@qorechain/sdk 0.14). The operator registers an ML-DSA-87 key with proof of possession, then opens a hybrid-signed MsgOpenEVMWindow for the agent's address: 1 allowed target (the payment account), 3 transactions, 120 blocks. The post-quantum key stays offline; the hosted worker holds only a small classical testnet key. 6. Crash-safe worker. The worker saves the signed transaction, hash and nonce before broadcasting. After a restart it reconciles using the receipt and the MilestoneSettled event, so a duplicate or retried invoice never pays twice. What was hard: keeping the AI out of the trust path while still using it; working out the window budget across native uqor (6 decimals) and EVM QOR (18 decimals); and making every hold explainable down to the exact changed characters. Tests: reader tests (clean, changed payee, 1-byte tamper, ambiguous payee, invented model quote) and a local smoke test that checks signatures, digests, decoded events and balance changes. The Foundry suite includes invariant fuzzing.

Timeline

PayeeProofPost-Quantum AI Agents

Pushed 8 commits to main

  • 384d5d9 revised readme updates · rohits1450
  • 488a85a Update README for live demo section formatting · rohits1450
  • 129b306 Add Built on QoreChain badge to README · claude
  • 668e5e8 Rewrite README with diagrams, maths, Diana deployment and track mapping · claude
  • 7cc9b29 Record Diana testnet deployment of MilestonePaymentAccount · claude

and 3 more commits

PayeeProofPost-Quantum AI Agents

New project.

Comments and questions

  • No comments yet.