Example scripts
Plain Node scripts, no framework. They need Node 22 or newer (global WebSocket and fetch). They only read; none of them writes to any relay. Only verify-circle-chain.mjs optionally uses @noble/curves (npm i @noble/curves) to check Schnorr signatures. They are explained in the guide for AI agents and developers and were run against the live pilot on 27 Oct 2026.
- read-directory.mjsLists the circles of the live directory by API and by relay; shows one person by key. Read only.
- verify-circle-chain.mjsReads a circle’s blocks from its own relay (with paging) and verifies ids, signatures, the prev/genesis chain, the circle id and the witnesses’ quorum.
- balance-of.mjsFinds the newest block that touched an account and checks the account line against the block’s lines root (RFC 6962).
- state-root.mjsComputes the sparse Merkle state root of state lines, builds and verifies inclusion proofs, and checks the published test vector.
- gravity.mjsThe exact whole-number morning gravity rule with the two worked examples of the AI guide.
- test-vector-state.jsonTEST data: the whole decision state of an example circle after block 4, with its published state root.