Verify a reader
A reader's answers do not have to be taken on trust. The check tool replays a reader's log with the rule library and can compare every entry with your own Monero node.
#Three levels
node reader/tools/verify.mjs --service https://api.xmr20.org/xmr721 \
--owners ownership-index/result/owners.jsonl,ownership-index/added/added.jsonl| Add | What is checked |
|---|---|
| (nothing) | The owner list here hashes to the value the service states. Every entry of the service's log is judged again with the rule library, in order, and must come out the same way. Every checkpoint is recomputed from that replay |
--node <your node> | Every logged record is looked up on your node: it must sit in the stated block, at the stated place, with exactly those bytes. Every payment, burn and fee payment is fetched again and compared. Checkpoint block hashes are compared |
--node <your node> --scan <empty folder> | Reads every block from the start block with this code, as a reader of your own, and compares the two logs. Only this finds a record the service left out. It takes as long as a first sync |
--published <folder> compares with checkpoint files written by reader/tools/export-checkpoints.mjs.
#Checkpoints
Every reader writes checkpoints. Two readers with the same settings at the same block give the same checkpoint. Shortened here; the live one also names the mint, opening, burn and spend settings:
{
"schema": "mordinals-checkpoint-v1",
"network": "mainnet",
"domain": "ec7f7d26…ba1d",
"owners": "e71d340d…39ee",
"start": 3804029,
"height": 3813840,
"blockHash": "d927883e…b407",
"records": 18,
"listHash": "3265a04a…d36c",
"stateHash": "9f7fb5f2…89fb"
}Compare GET /checkpoint of two readers at the same height. If stateHash matches, they agree on every owner, listing and counter.
#The ownership index
The owner list itself can be rebuilt from the chain. The repository's ownership-index/ holds:
- the owner of every Mordinal under the original rules, worked out by running the original 2023 index code unchanged, at commit
8467001of mooonero/mordinals; - a second, separately written replay in Python;
- the scan scripts and the checks.
The two replays agree on all 42,894 Mordinals and all 164 transfers, with zero differences. The owner list hashes to e71d340d84538c229f9e190d221271873cde6b1daab8366d9b282ff016e639ee (with the added entry), the value every reader states in /info.
#Tests
npm test # rules, reader, decoders, wallet: offline
npm run test:views # the pages in a browser (npx playwright install chromium once)
npm run test:lab # rules and relay against monerod and monero-wallet-rpc on an offline test chaintest:lab needs MONERO_BIN set to the folder that holds monerod and monero-wallet-rpc, and the carrier tool built with sh reader/carrier/build.sh.