Skip to content
QORECHAIN
Register

Protocol Builders

Arus

A post-quantum rollup for smart-meter data: sealed readings, signed batches, an on-chain watchtower.

Share on X

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

ArusProtocol Builders

Pushed 1 commit to main

  • a9b4e99 Hourly hostile calls: a host cron backstop starts the workflow when GitHub's schedule skips an hour (0.6.2) · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • dc64a13 Hostile calls: read the contract state at the block the calls run at (0.6.1) · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • e4618ab CI can also be started by hand (workflow_dispatch) · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • fb648a2 898 hostile calls against the live contract, 0 accepted; a random 60 every hour in CI until 16 December · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • 00496ff Page: the film link's text before scripts load says 2 min 1 s too · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • 032a07a Evidence for the drill gate: drill during a run answered 429 busy; with a window opened on purpose the drill closed it and all five attempts were refused; e2e for the language switch · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • 003a9cc The drill and a run wait out a settlement pass instead of answering busy; proof script for the drill with a window open · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • 96ffded Drill takes turns with runs and settling; film v3 (121 s); BM redraws the published-data panel; replay times labelled UTC+8 · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • e9e809d CBOM regenerated with QoreScan from the contract v3 source (43 components; tests pass) · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • c2850f5 Page: a rejected native row says when x/rdk gave its index to the next batch; README step 3 names the chain key the browser checks against · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • 08c9c15 Contract v3 runs on diana and the docs that describe it · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • d6a284a Contract v3 on diana: 0x9bf6bc44571a701032e4e1e487510fc63b618a18 (deploy 0x637f2d89…5188), households enrolled with their meter keys pinned, bond 1 QOR, pool 1.5 QOR; v1 and v2 kept as history · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • 3ebf836 Contract v3: the five fixes from the independent review, with tests · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • 7383645 Images regenerated from the live page at c8c685b (hero text, replay columns as hours) · aimanmalib(not counted: no real change)
ArusProtocol Builders

Pushed 1 commit to main

  • c8c685b README: withdrawals per house that exported power; the registry's dilithium5 name and the explorer's EVM label explained; CHANGELOG headings without dashes · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • 0c0dc56 e2e: the household test asserts the browser's own signature check against the chain's key · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • 1a081af Fixes from a judge-style review: honest claims, chain-read signature check in the browser, alarms for the two lies v2 cannot prove, native evidence from chain events · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • 64b744c Native drill 2: the Arus watchtower challenged in the next block and the chain credited it (C8161BAD); rejected batches read from chain events; EVM windows sized to each action; bond guard; drill atte · aimanmalib
ArusProtocol Builders

Pushed 1 commit to main

  • c7b698c Native fraud drill on arus-1: the chain upheld the fraud (rdk_fraud_upheld, 84C7A04F…); the watchtower records batches another account challenged first · aimanmalib
ArusProtocol Builders

Newly verified on chain: QoreScan

Comments and questions

  • No comments yet.