
Protocol Builders
Arus
A post-quantum rollup for smart-meter data: sealed readings, signed batches, an on-chain watchtower.
About
A smart meter reports every 15 minutes how much power a home used or exported. Detailed meter data shows when a home is empty, when people sleep and when they eat (Molina-Markham et al., BuildSys 2010). A utility still needs the totals, to pay for the solar a household exports. Putting every reading on a chain is too much data and gives the privacy away; keeping it all in one company's database means trusting that company with both the data and the bill. Arus is a rollup for that data on the QoreChain testnet. Each meter signs every reading with its ML-DSA-87 key, registered on chain. Every hour, the sequencer seals each household's readings with ML-KEM-1024 to that household and the watchtower, using the keys they published in the chain's KEM registry, and publishes only ciphertext and hashes. It signs the batch header with its own ML-DSA-87 key, and the settlement contract checks that signature on chain with the pqcVerify precompile. An independent watchtower opens every envelope, re-verifies every meter signature and recomputes the root, then attests with its own ML-DSA-87 signature, sends a fraud proof that the contract judges itself, or challenges a leaf whose data is missing until the sequencer reveals it on chain. After the challenge window the contract emits a settlement receipt, and each household withdraws its proven watt-hours with a Merkle path. The sequencer also posts every settled batch's commitment to arus-1, a native rollup registered in QoreChain's x/rdk module (qledger-v1, inbox-based sequencing), and submits x/rdk batches anchored with its ML-DSA-87 signature; their settlement receipts verify against chain state. The watchtower re-executes every native batch. In two fraud drills the chain upheld the fraud and slashed the 1,000 QOR submitter bond: in the first, another account on the network challenged first; in the second, the Arus watchtower built its proof before the lying batch was sent and challenged it in the next block, and the chain credited it. Try it without a wallet at arus.sasateguh.com. "Run the next hour" settles a real batch: the watchtower's attestation within seconds, then the receipt and a withdrawal for each house that exported power. Three buttons make the sequencer lie (a wrong total, a forged reading, readings nobody can show); each lying batch is rejected on chain. "Try it with the stolen key" makes five attempts with the sequencer's secp256k1 key alone, and the chain and the contract refuse each one in their own words: the sequencer opens an EVM window only for the transactions it is about to send. Switch the day view to one house to see its readings opened, each signature checked in your browser against the meter's key read from the chain. pnpm verify re-checks both layers from public data, with no key. Beyond the page, 898 hostile calls against the live contract (forged and one-byte-altered signatures, replays, callers without a post-quantum key, wrong recipients, false fraud proofs, forged receipts) were all refused with the reason the threat model expects; they are eth_call simulations, and a random 60 run every hour in CI until 16 December. Limits: meters and households are simulated, and the demo server holds the households' keys to show what one of them sees. A challenged household's readings for that hour become public on chain when the sequencer answers. The challenge window is 120 seconds so the demo moves. An independent review of contract v2 found five issues, two of them high; contract v3, now live, fixes all five, and the threat model lists them. Testnet only. We are a team of two students in Malaysia. We built Arus with AI coding agents, and AI_USAGE.md says how.
How it's made
Settlement contract: ArusSettlement.sol (v3), Foundry. No owner, no pause, no upgrade. submitBatch reads the sequencer's key from the pqcKeyStatus precompile and checks its 4,627-byte ML-DSA-87 signature with pqcVerify over a domain tag, the chain id, the contract, the batch index, the previous header hash, the state root, the data hash, the hour and the counts; attest does the same for the watchtower. proveBadTotal and proveBadSignature judge one leaf from its readings, re-running pqcVerify on a meter's reading. challengeLeaf (with a bond) makes the sequencer reveal a leaf's readings on chain through answerChallenge, or rejectUnanswered rejects the batch. finalize emits SettlementReceipt (verifyReceipt); withdraw pays once per leaf and per household per hour. Version 3 carries the fixes from an independent review of v2: rewards and bonds are credited and claimed, a leaf is revealed at most once, every 15-minute slot must carry a reading, meter keys are pinned at enrolment, and half of each slash goes to the withdrawal pool. Native rollup: arus-1 on x/rdk, created with MsgCreateRollup 677A9E995BF17CCC67C07FD20EE2B824E76B05B0D2FC0F1DDAD38C1281DD40D8 (qledger-v1, inbox-based, 9,900 QOR escrow). Each settled batch's commitment goes in with MsgPostRollupData; planQledgerBatch builds the x/rdk batch, anchorSignBytesForBatch is signed with the sequencer's ML-DSA-87 key, and buildSettlementReceipt / verifySettlementReceipt check the anchor against chain state. Batch 0 (D8B161C37053CB57986F1DC81D834C7C297F7EA8326B2D74F39A7A2AD56ABC05) carries Arus batches 1, 2, 6, 8, 9 and 10. The watchtower re-executes every native batch (buildQledgerFraudProof, checkQledgerFraud) and files MsgChallengeBatch; in the second drill its challenge C8161BAD8E3E89813B210DA49FC9DDAA5198A0B1FDE046DCB32D28CDB3D993DB was upheld in the block after the lying batch. x/rdk gives a rejected batch's index to the next batch, so rejected batches are named by their transactions, read from the chain's events. Off chain (TypeScript): @qorechain/qoreseal seals readings with ML-KEM-1024 to keys from the KEM registry; the watchtower runs in its own container with only its own key; @qorechain/pqc re-checks ML-DSA-87 signatures in pnpm verify and in the browser, which reads each meter's key from the x/pqc registry. EVM windows are opened (hybrid-signed) for exactly the transactions about to be sent, scoped to the contract, for 300 blocks, so a stolen secp256k1 key alone sends nothing between actions. Testnet accounts: sequencer qor1k3cujl6j5fgtsn8hefrxyutk08e6x95q0q4t7x, watchtower qor1d44vx252d7xavekyk2zlg9yqd6ua5gc3v5x73p, contract v3 0x9bf6bc44571a701032e4e1e487510fc63b618a18 (v2 and v1 kept as history); eight ML-DSA-87 and four ML-KEM-1024 keys registered. Kits: @qorechain/sdk, @qorechain/evm, @qorechain/qoreseal, @qorechain/rdk and @qorechain/pqc in the code; @qorechain/qorescan writes the CBOM (docs/cbom). Tests: 34 unit and fuzz tests and 5 invariants in Foundry, 23 Vitest tests, Playwright on Chromium and WebKit (iPhone 13), gitleaks, CI, and 898 hostile eth_call simulations against the live contract in 25 classes, all refused (scripts/adversarial.ts; 60 of them every hour in CI). Credit: QoreChain's build-before-qday examples and kits (Apache-2.0); our fest entries Ikrar, Sisir, Tirai and Mentari (Apache-2.0) for the key status decoding, the precompile test stand-in, the account and window scripts, the deploy script and the CBOM script.
Timeline
Comments and questions
- No comments yet.