Newly verified on chain: AMM pools, QoreSeal and the encryption key registry

About
Qtum'd is a post-quantum verifiable randomness service for QoreChain designed to stay fair even after Q-Day. Apps call one function, pay a small fee and get a random number back about 8 seconds later, with a callback to their contract. Each result combines two independent entropy sources: a public drand round, which cannot be predicted in advance, and a value from each provider's hash chain, pre-committed and anchored with an ML-DSA-87 signature. Before Q-Day, drand prevents any provider from predicting or biasing the outcome. After Q-Day, even if a quantum adversary could derive drand rounds early, it still cannot invert a hash, meaning a single honest provider is enough to keep the output unpredictable. Anyone can verify a result on the Check page, which recomputes the output client-side directly from on-chain data and drand. Anyone can also spin up a provider with a single command on a free Cloudflare account. The live site includes a dice roller, a giveaway picker, and two example contracts (a coin flip and an NFT with randomised rarity), all usable without connecting a wallet.
How it's made
Architecture: - Qtumd.sol: the contract on the EVM lane. It takes requests, checks each provider reveal against its hash chain, checks the drand signature with randa-mu's BLS library, then writes the result and calls the app back. - Provider bots: Cloudflare Workers that listen for requests over a WebSocket and reveal the next value about one block later. The two default providers run on two separate free Cloudflare accounts. The list of 21 million values is stored in KV as checkpoints, so the bot only has to rebuild a small part of it for each reveal. - Site and check page: plain JS with viem. The check page recomputes every result in the browser, so users do not need to trust our server. Kits and network features: - @qorechain/sdk: unified accounts, ML-DSA-87 key registration and opening EVM windows. - pqcVerify: the precompiles at 0x0A01 and 0x0A02, used to verify provider anchors and changes to the default list. A stolen classical key alone cannot change either. - Scoped EVM windows: each bot opens a window limited to Qtumd and the two example contracts, and renews it by itself before it runs low. - ML-DSA-87 signing inside a Worker, done in WebAssembly with noble. What was hard: - Timing. QoreChain stamps a block in whole seconds before building it, so a reveal can land later than its timestamp suggests. I measured inclusion over 100 transactions (1.85 s at most) and 6,624 blocks, then set a 3 s margin around that. The remaining edge case is written up as a known limit. - Liveness. A provider that goes quiet must not block results, so late or missing values are just left out and the result still comes. - Tests that mean something. Instead of chasing test count, I planted 46 bugs into the contract, and the Foundry tests catch all 46. Test inputs come from outside our code: real drand rounds and noble ML-DSA vectors. - Trust in the runner. Today both default providers are mine. The fix is more independent operators, so provider setup is a single command and joining the default list goes through a GitHub form.
Timeline
Pushed 60 commits to main
- c0bd708 README: centred header with badges and quick links · hungraw
- 0095d6f AI_USAGE: how I steered the agent, with links to the commits · hungraw
- 8e608e9 Audit: say run 2 used the same code and what that showed · hungraw
- 0bc097c Audit: link run 1's public report; README: say what the bots do · hungraw
- 5534764 Site: say how to switch QoreX to testnet · hungraw
and 55 more commits
Earned a Ship Weeks badge.
Earned a Ship Weeks badge.
Earned a Ship Weeks badge.
Earned a Ship Weeks badge.
New project.
Comments and questions
- No comments yet.