Skip to content
QORECHAIN
Register

Protocol Builders

Bergwacht

A post-quantum payment rollup: public settlement, ML-KEM-sealed payment instructions, a watchtower anyone can run.

Share on X

About

Businesses want rollups for payments, but they can't put invoices, bank details and counterparties on a public chain, and anything encrypted today with classical key exchange can be harvested now and decrypted after Q-Day. Making the whole rollup private breaks what keeps it honest: anyone must be able to re-execute it and prove fraud. Bergwacht splits every payment in two and posts both to the same based inbox on QoreChain, in ONE hybrid-signed transaction: - the L2 transfer (qledger-v1, ML-DSA-44): public amounts, so anyone can re-execute it, prove fraud on it and withdraw from it; - a sealed instruction (RF creditor reference, memo, IVMS101 Travel Rule data) encrypted with ML-KEM-1024 to the payer, the payee and an auditor, with keys from QoreChain's on-chain KEM registry. Nobody can attach a note to someone else's payment: seven binding rules, each pinned by a test (THREAT_MODEL T6). A disclosure ticket opens exactly one payment for a regulator; the others stay sealed. Live on testnet as bergwacht-1 (every hash in evidence/ONCHAIN.md): - Detection: our operator published three wrong roots on purpose (batches 1, 2, 5). Watchtowers not run by us got all three rejected 1-2 blocks after submission and the operator's bond slashed; our replay agreed each time. - Fraud proof: our own watchtower's fraud proof was upheld for batch 8 in a drill we set up; the chain named it challenger and paid it 500 QOR of the slashed bond. - Liveness: the watchtower account submitted batch 3 by hand, then batches 4, 6 and 7 from its own replay after posts had waited 30 or 60 blocks with no operator batch (escape hatch); all four are finalized on chain. - Hybrid signatures: every batch transaction carries ML-DSA-87 next to secp256k1. With a stolen classical key the chain still refuses a transfer and an inbox post, and a stolen key cannot be smuggled in as a co-signer. - EVM: a settlement contract checks the batch anchor's ML-DSA-87 signature with the pqcVerify precompile; BergwachtExitVault (0x8049a4d8d44221b4f38dc20109fe723f479a6a15) paid two fast exits on Diana. - Network board: the same replay re-executed 378 batches on 14 based qledger-v1 rollups, ours included, with the chain's own roots, 0 fraud found. - Upstream: replaying our batches showed the RDK's generic validator flags honest qledger-v1 batches; reported with a fixture and a regression test as qorechain/qorechain-rdk#6. Check it in five minutes, read-only, no keys: - Browser verifier (receipt, disclosure ticket, proof bundle): https://bergwacht.nedovost.org/verify.html - Live dashboard: https://bergwacht.nedovost.org - "Judge in 5 minutes" in the README.

How it's made

Node.js 22, ES modules, no build step, on @qorechain/rdk 0.9.0 and @qorechain/sdk, testnet qorechain-diana. Built by two people in about 1.5 days. Rollup: optimistic, qledger-v1, based sequencing. createRollup, bond, deposits, postRollupData, submitBatch with an ML-DSA-87 anchor, challengeBatch with fraud proofs, executeWithdrawal with Merkle proofs, settlement receipts verified against the chain. Sealed instructions: RDK sealEnvelope, ML-KEM-1024 to payer, payee and auditor, keys read from the on-chain KEM registry (registerKemKey / getKemKey). Fresh content key, AES-256-GCM, header as AAD. Instruction and L2 tx go as two messages of ONE hybrid-signed tx, so both come from the same poster at consecutive inbox sequences; the verifier binds them by poster and SHA-256, then checks amount and payee. Watchtower: keeps its own state and re-executes each batch with executeQledger; on a wrong root it builds a fraud proof and calls challengeBatch; if the operator stalls it submits batches itself; it also reports payments not sealed to the auditor. Inbox ranges are checked against the chain's accumulator. It runs as a systemd service on our VPS; anyone can run the keyless replay. EVM: Solidity settlement contract using the pqcVerify precompile, and BergwachtExitVault for fast exits (quorum of two ML-DSA-87 keys), deployed through scoped EVM windows. Cryptography: ML-KEM-1024 (envelopes), ML-DSA-44 (L2 accounts), ML-DSA-87 (batch anchors and every L1 tx, hybrid with secp256k1), all listed in a CycloneDX 1.6 CBOM that a test enforces. What was hard: - The first design put an ML-DSA-44 signature inside the envelope: 10.2 KB, over the 6 KiB inbox limit. We moved to the atomic pair. - The RDK's generic transitionRootValidator flags honest qledger-v1 batches, so the watchtower uses an exact replay that reproduces the chain's roots byte for byte. We reported the gap upstream (qorechain/qorechain-rdk#6). - The chain's batch listing hides rejected batches, so the watchtower probes the gaps to find them. AI-native process as code: every change is a GitHub issue in its own git worktree; a test is committed red first; a fresh-context reviewer agent sees only the diff and a PR merges on its verdict and green CI; hooks refuse edits outside a taken issue; a jury agent scores the repo and its findings become issues (AI_USAGE.md). Security: THREAT_MODEL.md covers 20 threats (T1-T20) with residual risks; offline node:test suite; mutation passes on the security code; red-team runner (redteam/). Honest limits: batches submitted by the escape hatch carry no PQC anchor; the ExitVault quorum is our own two keys and its relayer is a script; the camt.054 export is not validated against the XSD.

Timeline

BergwachtProtocol Builders

Pushed 219 commits to main

  • 54d1b74 Merge pull request #303 from M1hairu/worktree-292-uptime · M1hairu(not counted: no real change)
  • ac02569 Merge remote-tracking branch 'origin/main' into worktree-292-uptime · M1hairu
  • e6391fc Merge pull request #328 from M1hairu/worktree-315-mono · M1hairu
  • c266e3d Merge pull request #326 from M1hairu/worktree-325-submission-sync · M1hairu
  • ffce4df #315: white monochrome base; pink only for wrong roots, chrome-white primary button · M1hairu

and 214 more commits

BergwachtProtocol Builders

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

BergwachtProtocol Builders

Pushed 34 commits to main

  • 914b4ce Merge pull request #240 from M1hairu/worktree-239-source-serif · M1hairu
  • 9f27ec6 #239: review — phone header flows (links visible), escrow caption states only what the page knows, 'all re-executed' only when every final batch is, ticket samples named by post, tampered sample descr · M1hairu
  • 87bd55a #239: verifier — samples as a register in three groups (the tampered control in coral), drop zone as an instrument cell, verdict under the glass lens, bracket controls, a two-line lede with the bundle · M1hairu
  • 89adc36 #239: the world and the instrument — black canvas with a silk-dot ridge and grain (rlt), instrument cells with corner marks and bracket controls (guap_hack), true-glass lens class; dashboard: three fi · M1hairu
  • 34caa88 Merge remote-tracking branch 'origin/main' into worktree-239-source-serif · M1hairu

and 29 more commits

BergwachtProtocol Builders

Pushed 160 commits to main

  • df19e0e Merge pull request #225 from M1hairu/worktree-224-final-video · M1hairu
  • da55a6e #224: final demo video, Recordly-style (camera zoom, framed browser takes), new shots for batch 8, judge, proof bundle, co-signer; cover updated; bergwacht.nedovost.org · M1hairu
  • 4c7aaa6 Merge pull request #223 from M1hairu/worktree-178-video-storyboard · M1hairu
  • d8f1434 #178 rework: exact-match command allowlist (no parser), drill captions for batch 8, escape-hatch run wording · M1hairu
  • 65a6005 test(#178): exact-match tape allowlist, reviewer's bypasses, drill captions — red · M1hairu

and 155 more commits

BergwachtProtocol Builders

Pushed 23 commits to main

  • 13684d5 Merge pull request #199 from M1hairu/worktree-154-demo-video · M1hairu
  • 8492164 Merge origin/main · M1hairu
  • 899bcb1 #154: caption backdrop band, no caption over the cover, /verify.html scenes re-recorded in the brand; draft rebuilt (155 s) · M1hairu
  • e661116 Merge pull request #210 from M1hairu/worktree-207-judge-rows-chain · M1hairu
  • 0f63433 Merge origin/main into worktree-207 · M1hairu

and 18 more commits

BergwachtProtocol Builders

Pushed 299 commits to main

  • 55e4e43 Merge pull request #204 from M1hairu/worktree-201-verify-brand · M1hairu
  • 529a6c6 Merge origin/main · M1hairu
  • 4a65424 #201: verify.html in the Bergwacht identity: brand.css, ridge strip with the mark linking home, gold only for VALID, coral for NOT VALID and warnings · M1hairu
  • 9712db6 Merge pull request #203 from M1hairu/worktree-202-check-live-strict · M1hairu
  • 3c918e2 Merge origin/main into worktree-202 · M1hairu

and 294 more commits

BergwachtProtocol Builders

Pushed 299 commits to main

  • 55e4e43 Merge pull request #204 from M1hairu/worktree-201-verify-brand · M1hairu
  • 529a6c6 Merge origin/main · M1hairu
  • 4a65424 #201: verify.html in the Bergwacht identity: brand.css, ridge strip with the mark linking home, gold only for VALID, coral for NOT VALID and warnings · M1hairu
  • 9712db6 Merge pull request #203 from M1hairu/worktree-202-check-live-strict · M1hairu
  • 3c918e2 Merge origin/main into worktree-202 · M1hairu

and 294 more commits

BergwachtProtocol Builders

First on-chain deployment detected on testnet.

BergwachtProtocol Builders

New project.

Comments and questions

  • No comments yet.