API & mirror kit
The CADENA bill asks for an open API (Sec. 14), open formats such as CSV and JSON (Sec. 19), and independent mirror sites run by NGOs, media and universities (Sec. 13). This is how that works with the demo chain.
Open API
No sign-up · about 5 requests per second- GET/api/demo/blocks?page=1&limit=25
Latest blocks, newest first. Add &format=csv for a spreadsheet. Try it
- GET/api/demo/block/{height}
One block: header, signature, and every record with the exact text that was hashed. &format=csv lists the transactions. Try it
- GET/api/demo/tx/{recordId}
One transaction: record, Merkle proof, block, accountability fields and the budget-to-payment trail. Try it
- GET/api/demo/headers
All 6,013 block headers and signatures in one file, for mirrors. &format=csv also works. Try it
- GET/api/demo/public-key
The DEMO signing key (Ed25519, PEM). It is not a government key. Try it
Run your own mirror
A mirror is an independent copy of the chain. If the main site changed a record, every mirror would disagree with it. Anyone with a computer can be one.
- Get a full copy. In the PisoScan folder run npm run export:chain. It writes every block and all 844,624 records with their hashed text to data/export/pisoscan-demo-chain.jsonl.gz (about 34 MB).
- Check it yourself. Download verify-chain.mjs (no dependencies, Node 18 or newer) and run node verify-chain.mjs pisoscan-demo-chain.jsonl.gz. It re-hashes every record, rebuilds every Merkle root, checks each block links to the one before it, and checks each signature. It takes a few seconds.
- Or check a running site. node verify-chain.mjs --url http://localhost:4100 --sample 25 checks all headers and signatures, then re-hashes 25 random blocks through the API.
- Keep checking. Run it again later. If any record changed since your copy, the checker names the block that no longer matches.
Tested: changing one award by ₱1 in a copied file makes the checker report "block #3000: Merkle root does not match its records" and exit with an error.
What is still missing for a real CADENA
- Records signed by the accountable officer of each agency, not a demo key (Sec. 3, 19).
- Accredited mirrors that sync automatically with the official system (Sec. 13).
- SAROs, NCAs, disbursement vouchers and completion certificates published per project, so the budget-to-payment trail has no gaps (Sec. 5).