How this demo blockchain works
A plain-language walk-through, using the real records you can click through on this site.
1. A record becomes a fingerprint
Each contract award (who awarded it, to whom, for how much, on what date) is written out as one line of text and run through SHA-256. The result is a 64-character fingerprint. Change a single peso or letter and the fingerprint becomes completely different.
Example: 09d4cdac28c3…09d4cdac28c3599e7d170375, the first transaction in the latest block.
2. One day of records becomes a block
All awards dated the same day go into one block. Their fingerprints are paired and hashed again and again until one hash is left: the Merkle root. It summarises every record in the block.
The block's header (its number, date, Merkle root, record count and the previous block's hash) is hashed into the block hash.
3. Blocks are chained
Each block stores the hash of the block before it. Block #6013 stores 212930370b…8d0e7e, which is exactly the hash of block #6012 (212930370b…8d0e7e).
So editing any old record changes its block's hash, which no longer matches what the next block stored, and the break carries on to the end of the chain. The tamper test on every transaction page shows this live.
What a real system like CADENA would add
- Many independent copies. This demo runs on one computer. A real ledger would be held by several independent parties (for example DBM, COA and civil-society groups), so no single one could rewrite it quietly.
- Official signatures. Each record would be digitally signed by the agency that issued it. Nothing here is signed by any agency.
- Records at the moment they happen. Here the chain is built after the fact from published data. A real ledger would add each record when it is issued.
What a blockchain cannot do
It proves a record has not changed since it was added. It cannot prove the record was true in the first place. If an office publishes a wrong amount, the chain keeps the wrong amount faithfully. Audits, inspections and public scrutiny are still needed.