Skip to content
QORECHAIN
Register

Cross-VM

Mentari

Solar certificates you can retire only once: burn and public receipt land together, or not at all.

Share on X

About

Press "Retire now" with no wallet, try to steal an account with just its classical key, or forge a meter reading: https://mentari.sasateguh.com "Retire now" and each failure button send one hybrid-signed Native transaction (secp256k1 plus ML-DSA-87) with no EVM window open. An energy certificate only means something if it can be retired once. Most registries burn it in one system and publish the record in another, and the two can drift apart. Mentari does both in one transaction on QoreChain. Retiring burns the certificate in an EVM contract and writes a public receipt into qday-receipts, an approved Native contract, through the Cross-VM bridge. If either side fails, neither happens. You can check that without a wallet. Open the site and press "Retire now". Both ledgers go up by one. Then press a failure button. The transaction reaches the Native side and fails, and both counts stay where they were. The explorer shows the first as success and the second as failed (code 14). Each certificate starts as a meter reading signed with ML-DSA-87. The contract checks the signature with the pqcVerify precompile, so a classical key alone mints nothing. Certificates only move to accounts that have a registered post-quantum key. On the Verify page your browser checks the meters' signatures again. One thing I did not expect: the docs mark calls from a Native account into an EVM contract as not yet tested. I ran it. Every "Retire now" is one hybrid-signed Native transaction with no EVM window open, and the explorer labels it quantum-safe. By 2 December the testnet contract had minted 1,417,797 Wh from signed meter readings and retired 22,500 Wh in 45 retirements. Each one matches a Native receipt. Run `pnpm demo` in a fresh clone to re-check all of it from public endpoints, with no key. The run on 2 December passed 167 of 167 checks. Try to break it yourself on the live testnet. "Steal it with the classical key" gives the server only the secp256k1 key of a funded account that has an ML-DSA-87 key registered, and each press tries five things with it: send its QOR, retire or move its certificates, open an EVM window, and swap in the attacker's own ML-DSA-87 key. The chain refuses all five before any block. "Forge a meter reading" has your browser make its own ML-DSA-87 key and sign a reading for a real system; pqcVerify calls the signature valid, and Mentari.attest still refuses it with BadSignature. "Pay and retire" sends a bank payment and a retirement in one Native transaction; its twin asks for 1 Wh too many, the contract refuses it, and the payment is undone. Verify shows that none of the nine Mentari accounts holds an open EVM window, read live from the chain. Mentari v2 (live since 2 December): a retirement or transfer needs the holder's own ML-DSA-87 signature over a plain-text claim in QoreSign's message format, checked with pqcVerify; msg.sender is never the authority. Each claim names its vintage, one system's output on one UTC day. Mentari's own CosmWasm contract, mentari-registry, records every mint and retirement on the Native lane in the same transaction and refuses to retire a vintage past what its meter signed for; then the whole transaction reverts, burn included. The QoreChain team stored it (proposal #71) and put it on the bridge allowlist (#72); it has enforced vintages since 21:15 UTC on 2 December. On Try it, "Ask for one watt-hour too many" sends such a claim, and the page shows the registry's own refusal. The real QoreX extension (0.4.6, from the Chrome Web Store) signed retirement 38 from the live site. QoreChain's QCAI auditor ran twice on the deployed source (scores 82 and 78); the audit notes in the repository answer every finding with its code and tests, with no contract change. Limits: the meters are simulated. The signatures and the chain are real. This is a testnet demo, not a recognised certificate scheme. The demo and deployer accounts also received the fest faucet's test tokens (fUSD, fETH, fBTC) with their QOR, which is why that badge shows; Mentari itself does not use them. I'm a solo builder in Malaysia. I built Mentari with AI coding agents, and AI_USAGE.md says how.

How it's made

Solidity contracts built and tested with Foundry: Mentari and AtomicityProbe (v1), and Mentari v2 next to them. Mentari.retire burns the watt-hours and builds the receipt note from typed fields. It then calls the Cross-VM bridge at 0x…0901 with a record message for qday-receipts, the receipts book on the bridge allowlist (code id 865). It reads the receipt id from the reply and stores it with the retirement. The EVM event names the Native receipt, and the Native note names the EVM retirement. AtomicityProbe is a separate demo contract that fails on purpose. One call writes a receipt and then reverts. One asks the Native contract to refuse. One targets a contract that is not on the allowlist. The receipt count is the same before and after each one. For the manual Cross-VM check: Mentari is 0xF5cb2c6048a7CE8c5A7ACcc66eB8efc33942a448 (qor17h9jcczg5l8gckn6enrxaw80cvu59fzg2335fw). The first EVM-to-Native retire is EVM transaction 0x08e96e38d8880b92eb676f621c7be5bab83725468470ff7a396d6e92c6401a03 in block 10609362, receipts 7 to 8. The write-then-revert is 0xdf7bc37dcbfed49096d4fa903120a20e8e7f9f2e3dc1a6ed1acafd605031926c in block 10609364, receipts 8 to 8. The README lists the rest. Post-quantum: the registrar and every meter sign with ML-DSA-87. The contract reads each key from pqcKeyStatus and requires proof of possession. It checks the signature with pqcVerify. Signed messages carry the chain id and the contract address. Transfers only go to accounts with a registered ML-DSA-87 key. There is no owner, no pause and no upgrade path. In v1, retire and transfer follow msg.sender, so they rely on the chain: a retire signed with the classical key alone was refused (cases I and K in the README). In v2 the holder's own ML-DSA-87 signature, checked with pqcVerify, authorises every retirement and transfer: MentariV2Core builds the plain text in QoreSign's message format, @qorechain/qoresign signs it, and asset-kit's QoreChainHybridHolderGuard (ownership renounced) decides who may hold certificates. MentariV2Receipts (0xa38b5261c463f581d1d721fe2fd4e73f406fe2dc) writes each retirement as an MTR2 note to qday-receipts and refuses over-retirement on the EVM lane. MentariV2 (0x1a26e74203f7a06abb4d67bc1ac68e9ce0c4efd3) writes each mint and retirement to Mentari's own Rust CosmWasm contract mentari-registry (qor1gvwqmvy3ceernegpdj0vv55mrdalr0fwp79n5ypd9kwvzhnfgr0q4c89ud, no admin), stored by proposal #71 and allowlisted by #72 (pinned to code 871); the registry refuses an over-retirement and the whole EVM transaction reverts. The site sends each press as one hybrid-signed MsgCrossVMCall from the Native lane, with no EVM window open. My notes on that route are in docs/findings.md. Kits: @qorechain/sdk 0.14.0 derives the accounts and sends the hybrid-signed transactions. @qorechain/qorex-rainbowkit and @qorechain/wallet-adapter connect and check QoreX on the Try it page. @qorechain/pqc re-checks ML-DSA-87 in the browser, @qorechain/qoreseal seals the site details, @qorechain/qorescan writes the CBOM, @qorechain/qore-cli and the MCP server read the chain in pnpm demo, and @qorechain/qoresign formats the v2 signed text. The Native REST API sends no CORS headers, so a small Node server proxies a fixed list of read-only paths. It also sends the demo transactions from a rate-limited account. Tests: 160 Foundry tests, with fuzzing and invariants, at 99 % line coverage of the contracts. 14 Rust tests for the Native registry. 829 vitest tests. 30 browser tests in Chromium and WebKit. I broke the contract on purpose for each invariant, and each break turned its test red. Credit: the QoreChain workshop examples (Apache-2.0). Workshop 2 for the pqcVerify pattern, workshop 3 for the bridge call and the receipts book.

Timeline

MentariCross-VM

Pushed 5 commits to main

  • b863f38 Link the registry's instantiate2 and bind transactions, and leave no future tense about #71 and #72 · aimanmalib
  • 351b9d5 On Verify, say the direct write changed nothing, and name #72 as the registry's allowlist proposal · aimanmalib
  • 066e0c1 Mentari's own Native registry is live: record its proofs and show them · aimanmalib
  • 8593dd2 Give the direct write to mentari-registry 1.5M gas: 400k ran out loading the Wasm · aimanmalib
  • 8f44461 Count the tests from CI run 46933771867 on 9623984 · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 9623984 Record where a proof read the registry's refusal, and let pnpm verify check a simulated one by its code · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 931f2bc Read the registry's refusal from a simulation's BridgeCallFailed when the Native log names no reason · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 66ef1b4 Name the QoreChain team's allowlist proposal #72 next to #71 · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • f9b7b33 Give the committed video config test 30 s: its first import of the server config took over 5 s on a loaded host · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 715df20 Name the QoreChain team's resubmission #71 everywhere #70 is named, and put the explorer note before it on Verify · aimanmalib
MentariCross-VM

Pushed 2 commits to main

  • 1a43d5a Name Mentari's own Native contract on Verify while it has no recorded proofs · aimanmalib
  • 5ef7612 Say that store proposal #70 closed with no votes, and describe v2's signed text as built · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • b8653d1 Capture the phone screenshot again with the nav's scroll fade · aimanmalib(not counted: no real change)
MentariCross-VM

Pushed 1 commit to main

  • 1edefcc Release 1.3.0: the chain and test numbers of 2 December in both READMEs, AI_USAGE.md and the slides · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • c7bfefe Keep README.md under 500 lines: tighter v2 intro and one Limits bullet · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 07475e9 Say in Limits which version records and which enforces · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 35621a0 Fade the phone nav's right edge so it reads as scrollable; name the Malay Retire now button in README.ms · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 8202b48 Open both READMEs with the timed video link and a judges-in-3-minutes heading, keeping the old anchors · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 696a668 Ask eight log windows at once and stop after 8 s, so Verify and Retirements answer in seconds · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 2ecd012 Stock the v2 Try it button for the judging days: 150,000 Wh · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • c386c9a List session A's changes of 2 December under Unreleased in the changelog · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 08b27e2 Keep the seeded key mock under the guard's 50,000 gas in forge coverage · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 1c96280 Say in AI_USAGE.md how Mentari v2 was built on 2 December · aimanmalib
MentariCross-VM

Pushed 1 commit to main

  • 5fe3fba Match the wallet test's transaction link with ?network=testnet on it · aimanmalib
MentariCross-VM

Pushed 20 commits to main

  • ab50704 Add mentari-registry, a Native contract that refuses to over-retire a vintage · aimanmalib
  • 1f897c5 Add MentariV2: every mint and retirement also lands in the Native registry · aimanmalib
  • 9925d36 Record MentariV2 on the testnet: 0x055ce4c7…575e, block 11147704 · aimanmalib
  • ffab7a5 Show and verify Mentari v2 once its proofs are recorded · aimanmalib
  • 5cead0e Read MentariV2 with v1's read ABI and a parsed ABI, not copied blocks · aimanmalib

and 15 more commits

Comments and questions

  • No comments yet.