Provably-fair loot, dice and crates bound to a future block โ an outcome nobody can rig and anyone can recompute.
import { commit, resolve, verify } from "@metanet-games/fairdrop";
// BEFORE block 900123 exists โ publish (and anchor) this commitment
const c = commit({ dropId: "chest-42", height: 900123, table: [
{ item: "common", weight: 80 },
{ item: "rare", weight: 15 },
{ item: "legendary", weight: 5 } ] });
// AFTER block 900123 is mined:
const result = resolve(c, { blockHash }); // { item, index, roll }
verify(c, { blockHash }, result); // true โ anyone can check
Gate any drop on a block that doesn't exist yet when you commit. Publish the table + block up front (anchor the digest to timestamp it), and when the block lands the outcome is forced and re-checkable by anyone from public data. For high-stakes drops, add committed seeds so a grinding miner is working blind.
Part of chainkit โ verifiable building blocks for BSV games. Verify don't trust.
๐งฉ github.com/metanet-games/chainkit ยท ๐น๏ธ the games ยท metanet.games