Skip to content
QORECHAIN
Register

Protocol Builders

Turnstile

A post-quantum rollup for pay-per-call APIs: Every call paid, every batch signed, every answer sealed.

Share on X

About

AI agents can't pay for an API one call at a time. Turnstile fixes that. A seller puts a price on any route. When an agent calls it, the API answers with a price the seller signed. The agent pays with a post quantum signature from its own account inside our rollup, and gets an answer that only it can open. Thousands of tiny payments settle in a few batches on QoreChain, each anchored with an ML-DSA-87 signature. A watchtower replays every batch and challenges any wrong one. Sellers withdraw with a Merkle proof, and anyone can check a receipt on chain or inside a Solidity contract. We also added spending limits for agents that live on chain, a zero knowledge proof of the facilitator fee, a hosted MCP server that charges per tool call and exit files that only their owner can open. Every claim on the Proof page links to its transaction, and the limits are written down too.

How it's made

Turnstile is a TypeScript monorepo. The settlement layer is our own RDK rollup on QoreChain testnet, qledger v1 with based sequencing and optimistic challenges. A buyer signs each payment with ML-DSA-44 inside the rollup. The operator posts batches of up to 64 transactions, each anchored with ML-DSA-87. On the seller side a middleware answers HTTP 402 with a quote signed through QoreSign. The facilitator checks the payment, posts it to the rollup inbox and pays the gas. Answers are sealed with QoreSeal to the ML-KEM-1024 key the buyer registered on chain. For many cheap calls a session replaces one post per call. The buyer funds a session account and signs a running total, so fifty calls settle in a single post. On the EVM we deployed three Solidity contracts with Foundry. TurnstileReceipts rebuilds the anchor message and checks it with the pqcVerify precompile. AgentSpendCap holds an agent's spending limits and only accepts an owner with a registered post quantum key. FeeAudit verifies a Groth16 proof made with Circom and snarkjs, using the pairing precompile. A separate watchtower with its own key replays every batch from the raw inbox. We forged batches on purpose three times. We lost two races by one block, found a two second database wait in our own code, fixed it and won the third. The hardest part was the chain's own rules: hybrid signatures on every transaction, one post per transaction and a rate limited REST endpoint. The repo also has Sign In With QoreChain, an IBC exit to Osmosis, a QoreScan inventory and two MCP servers. Contracts: TurnstileReceipts 0x970B29eB9C454a836Fe6dCB3e7A616673A66B2e0, AgentSpendCap 0x16c2cb5600d37195C88fde5327771652b1d02dFd, FeeAudit 0xAE05f8faDD76F827B3e80A3382a54cF31A4549A5. Built with an AI coding agent, documented in AI_USAGE.md.

Timeline

TurnstileProtocol Builders

Pushed 1 commit to main

  • 94d1964 README: 89 unit tests and the Built on QoreChain badge; project page doc matches what was saved · Abhishek222983101
TurnstileProtocol Builders

Pushed 1 commit to main

  • 0456d4c README: animated architecture and payment flow, 30 second demo reel, two column GIF grid, animated dividers · Abhishek222983101
TurnstileProtocol Builders

Pushed 1 commit to main

  • dc10b63 README: header row for the summary table · Abhishek222983101
TurnstileProtocol Builders

Pushed 1 commit to main

  • eae4629 README and docs: demo video on YouTube · Abhishek222983101
TurnstileProtocol Builders

Pushed 1 commit to main

  • 12630f9 README: animated banner, badges, demo GIFs, problem idea solution, try it, diagrams, tech table, proof and a section for reviewing agents · Abhishek222983101
TurnstileProtocol Builders

Newly verified on chain: EVM window (incl. scoped)

TurnstileProtocol Builders

Pushed 1 commit to main

  • eee2249 New bright cover and social card; video docs · Abhishek222983101
TurnstileProtocol Builders

Pushed 1 commit to main

  • 062e323 Playground: a failed seller answer is shown as a failure, not as paid; sellers: chain REST outage returns 503 before payment · Abhishek222983101
TurnstileProtocol Builders

Pushed 1 commit to main

  • 12b1982 Watchtower page: three drills scoreboard (lost, lost, won); video docs · Abhishek222983101
TurnstileProtocol Builders

Pushed 1 commit to main

  • 1f73daa Drill 3 won: evidence E-32, docs, proof regenerated · Abhishek222983101
TurnstileProtocol Builders

Pushed 5 commits to main

  • b7ae39e Watchtower: fixed challenge fee; operator: per-run drill guard (DRILL_RUN) · Abhishek222983101
  • a3457ba Watchtower prefetch: incremental per-entry reads instead of full index search (fixes REST 429 load) · Abhishek222983101
  • 0b43fe5 operator drill: log guard name and reasons · Abhishek222983101
  • ea6fb91 Watchtower: start the challenge before any database write (drill 2 showed ~2 s lost there) · Abhishek222983101
  • 10cef2b Record drill 2 honestly (lost by one block), docs updated · Abhishek222983101
TurnstileProtocol Builders

Pushed 1 commit to main

  • 4ad3628 zk test script for Node 22, integrate page, docs, video script, proof regenerated · Abhishek222983101
TurnstileProtocol Builders

Pushed 2 commits to main

  • 3efa35f Fee split, caps, sealed exits with browser unlock, hosted MCP, ZK fee audit, watchtower prefetch, evidence and docs · Abhishek222983101
  • b42552a Exit unlock e2e test · Abhishek222983101
TurnstileProtocol Builders

Pushed 1 commit to main

  • 7746718 PROOF.md regenerated (25 rows) · Abhishek222983101
TurnstileProtocol Builders

Newly verified on chain: QoreScan

TurnstileProtocol Builders

Pushed 1 commit to main

  • 89d49aa P8.3: QoreScan crypto inventory (cbom.json, 48 components) and CI job; docs aligned · Abhishek222983101
TurnstileProtocol Builders

Pushed 1 commit to main

  • f9b0747 P7.2 QoreX deposit page; docs and plan aligned: SIWQ, IBC, supply chain, exit claim built · Abhishek222983101
TurnstileProtocol Builders

Pushed 1 commit to main

  • 1208f29 SIWQ: bind each nonce to the exact issued message; live checks · Abhishek222983101
TurnstileProtocol Builders

Newly verified on chain: IBC via QORel

TurnstileProtocol Builders

Pushed 1 commit to main

  • 2957c2c P7.3 SIWQ sign-in + seller dashboard, P7.4 IBC exit to Osmosis testnet (arrived), supply chain wired, exit claim script, inbox backfill · Abhishek222983101

Comments and questions

  • No comments yet.