Skip to content
QORECHAIN
Register

Post-Quantum AI Agents

QoreMeter

One call. One ticket. Verified on chain — an AI agent pays per API call, and QoreChain enforces its mandate.

Share on X

About

QoreMeter is the on-chain settlement layer that lets an AI agent pay for API calls one at a time, safely. The provider (in this build, a signing account) issues a meter ticket for each batch of metered calls — {provider, buyer, calls, totalPrice, nonce, expiry} — and signs it with its ML-DSA-87 key, registered on chain with proof of possession. The agent settles tickets through MeterDesk, a contract that reads the provider's key from the chain's own registry (pqcKeyStatus precompile), verifies the post-quantum signature on chain (pqcVerify precompile), and enforces the agent's mandate: at most 1 QOR per payment and 3 QOR per day. The agent's own code contains no limit logic — the chain says no. In the live testnet run, three genuine tickets were paid (0.25 + 1 + 1 QOR) and four attacks — a forged ticket, a replay, an over-cap ticket and a day-breaking ticket — were all broadcast as real transactions and all reverted by the chain.

How it's made

Built with TypeScript + Hardhat 3 + viem on qorechain-diana. Flow: (1) a separate provider account registers its ML-DSA-87 key with proof of possession (tx 741C859B…5083); (2) the owner opens an EVM authorisation window with a hybrid-signed native message (secp256k1 + ML-DSA-87, tx AE137C43…7DC); (3) MeterDesk is deployed inside the window (0x60d5000b75a1d791fa0f5ae92cb4d1155e15847f) with immutable caps — 1 QOR per payment, 3 QOR per buyer per day — and funded with 5 QOR; (4) the provider signs meter tickets off chain with @qorechain/sdk (pqcSign) over the exact bytes of MeterDesk.ticketMessage; (5) the agent settles them via pay(), which checks pqcKeyStatus (registered + possession-proven), verifies the signature via the pqcVerify precompile, enforces nonce/expiry/caps, then pays. Attack transactions were broadcast raw so the chain itself would refuse them; revert reasons were decoded afterwards by re-simulation (scripts/verify.ts). Transport note: this build environment's egress resets Node POSTs to the chain endpoints, so native broadcasts go through the REST tx endpoint via curl and EVM traffic through a local curl-based JSON-RPC relay (scripts/relay.mjs) — signature bytes were never altered.

Timeline

QoreMeterPost-Quantum AI Agents

Pushed 52 commits to main

  • 1c1c727 docs: add AI_USAGE.md at repo root (fest checker looks there) · dftaufiq
  • d0c28ea docs: add demo video link · dftaufiq
  • 934f9f9 Add tsconfig.json · dftaufiq(not counted: no real change)
  • 3c4a570 Add scripts/window.ts · dftaufiq(not counted: no real change)
  • 7c228c6 Add scripts/verify.ts · dftaufiq(not counted: no real change)

and 47 more commits

QoreMeterPost-Quantum AI Agents

Pushed 1 commit to main

  • 3fdd6b5 docs: note fest submission status · dftaufiq
QoreMeterPost-Quantum AI Agents

New project.

Comments and questions

  • No comments yet.