Receipts and proofs
Once an hour every finished run and rental becomes one Merkle root on CoresiumReceipts. Here is how to check one.
What a leaf holds
A run's leaf is the JSON text of its receipt id, the model, the source, the listing, the price and when it finished. A rental's leaf holds its receipt id, the GPU, the seconds it ran, the rate, what was billed and when it ended. Never your wallet, your prompt or the job id.
To get your own leaf, stay signed in and open /api/runs/<job id> in the same browser (the job id is in Account, Runs, in each file link). Its receipt.text is your leaf text and receipt.steps is the proof from your leaf up to the hour's root.
How the tree is built
- Each leaf is sha256 of byte 0x00 followed by the leaf text.
- Leaves are ordered: runs first, then rentals, each by finishing time.
- Pairs are hashed upward as sha256 of byte 0x01, then the left hash, then the right hash. An odd node moves up unchanged.
- The top is the hour's root. The ops wallet posts it with
post(hour, root, leaves, gpuSeconds, usdMicro), keyed by whole hours since 1970.
Verify an hour yourself
This script needs Node 18 or later and nothing else. It asks Coresium for the hour's leaves, rebuilds the root, and reads rootOf(hour) from CoresiumReceipts through the public Elysium RPC. Give it your own leaf text as well and it checks that your leaf is in the hour.
#!/usr/bin/env node
/* Check one hour of Coresium receipts against CoresiumReceipts on Elysium. Node 18 or later, no packages.
* node verify-receipt.mjs 2026-11-27T16 the hour's root, rebuilt from its leaves and read on chain
* node verify-receipt.mjs 2026-11-27T16 "<leaf text>" the same, and that your own leaf is one of them
* A leaf is sha256(0x00 + leaf text). Pairs are sha256(0x01 + left + right); an odd node moves up unchanged. */
import { createHash } from "node:crypto";
const SITE = process.env.CORESIUM_SITE || "https://coresium.xyz";
const RPC = "https://rpc.elysium.kinetiq.xyz";
const RECEIPTS = "0x363662f333d30f835e81F6a026D03d3F80Cc3319";
const ROOT_OF = "0x9d7384d9"; // the first 4 bytes of keccak256("rootOf(uint64)")
const H = (prefix, ...parts) => createHash("sha256").update(Buffer.from([prefix])).update(Buffer.concat(parts)).digest();
const rpc = async (method, params) => { const r = await fetch(RPC, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }) }).then((x) => x.json()); if (r.error) throw new Error(r.error.message); return r.result; };
async function main(hour, leafText) {
if (!/^\d{4}-\d{2}-\d{2}T\d{2}$/.test(hour ?? "")) { console.error("Give an hour in UTC as YYYY-MM-DDTHH, for example 2026-11-27T16."); return 2; }
const res = await fetch(`${SITE}/api/v1/receipts?hour=${hour}`);
if (!res.ok) { console.error(`Coresium lists no receipts for ${hour} (HTTP ${res.status}).`); return 1; }
const r = await res.json();
let level = r.leaves.map((h) => Buffer.from(h, "hex"));
while (level.length > 1) { const up = []; for (let i = 0; i < level.length; i += 2) up.push(i + 1 < level.length ? H(1, level[i], level[i + 1]) : level[i]); level = up; }
const rebuilt = level[0].toString("hex");
const block = parseInt(await rpc("eth_blockNumber", []), 16);
const onChain = (await rpc("eth_call", [{ to: RECEIPTS, data: ROOT_OF + BigInt(r.hourNumber).toString(16).padStart(64, "0") }, `0x${block.toString(16)}`])).slice(2);
console.log(`hour ${hour} UTC (hour number ${r.hourNumber}), ${r.leaves.length} leaves`);
console.log(`root rebuilt from the leaves 0x${rebuilt}`);
console.log(`root Coresium lists 0x${r.root}`);
console.log(`rootOf on Elysium 0x${onChain} (block ${block}, read ${new Date().toISOString()})`);
let ok = rebuilt === r.root && rebuilt === onChain;
if (leafText !== undefined) {
const mine = H(0, Buffer.from(leafText, "utf8")).toString("hex"), found = r.leaves.includes(mine);
console.log(`your leaf 0x${mine.slice(0, 16)}... ${found ? "is one of" : "is NOT one of"} this hour's leaves`);
ok = ok && found;
}
console.log(ok ? "VERIFIED" : "NOT VERIFIED");
return ok ? 0 : 1;
}
/* exitCode, not exit(): exiting while a fetch socket closes aborts Node on Windows */
process.exitCode = await main(...process.argv.slice(2));Download verify-receipt.mjs, then run it:
node verify-receipt.mjs 2026-11-27T16
node verify-receipt.mjs 2026-11-27T16 '<your leaf text>'Run by the Coresium team on 2026-11-28 04:41:02 UTC for hour 2026-11-27T16: the root rebuilt from its 2 leaves, the root Coresium lists and rootOf on Elysium at block 11,984,307 were all 0x39e335b525fa578e36aa2ee319a7a8bcfd6fedeffce370233df8b4b97c72ffe0, and it printed VERIFIED. The same run with a made up leaf printed NOT VERIFIED, and an hour with no receipts was refused.
The receipts API
curl https://coresium.xyz/api/v1/receipts
curl "https://coresium.xyz/api/v1/receipts?hour=2026-11-27T16"The latest hours, with their transactions, are also on Receipts.