Transactions, fingerprints, and tampering
PHP stores each transaction and its SHA-256 fingerprint in MySQL. Each new block includes the previous block’s fingerprint.
Add a transaction
Adding is disabled while the chain is invalid. The tampering result is shown below.
Reset the demo
This clears all blocks and rejected attempts from the demo tables, then creates a fresh starting block.
What is stored in MySQL
| Block | Transaction | Previous fingerprint | Saved fingerprint | Reconciliation | Tamper tool |
|---|---|---|---|---|---|
| #1 | GENESIS | GENESIS |
0007908a8a45ff813c0548a397e2e93e0df55ba8d47c9490b54e8d4a81f35fdb |
Fingerprint: MISMATCH
Previous link: matches
Recalculated:
a4da001fdc894ad64f3e616c23b75c7c0962701c5fc7ae7e13427ba445a49608 |
Starting block |
| #2 | PG sends SG $5 | 0007908a8a45ff813c0548a397e2e93e0df55ba8d47c9490b54e8d4a81f35fdb |
00010938b21dbda8f9c5308f115231188f679f1642373f335540c2660d002747 |
Fingerprint: MISMATCH
Previous link: MISMATCH
Recalculated:
6e1b2464fecea44a1b44ca43d69c7ab4afbf3c6023ed60e05c441720b14d32efExpected previous: a4da001fdc894ad64f3e616c23b75c7c0962701c5fc7ae7e13427ba445a49608 |
|
| #3 | PG2 sends SG2 $25 | 00010938b21dbda8f9c5308f115231188f679f1642373f335540c2660d002747 |
000f9a34c5a18347c02bfa243d48da8eca476e294329dd1f56f0445ec18ff59b |
Fingerprint: MISMATCH
Previous link: MISMATCH
Recalculated:
35f020ee6c78fcb52d47b441bc74d0d93782008835f726782e2571892663b27fExpected previous: 6e1b2464fecea44a1b44ca43d69c7ab4afbf3c6023ed60e05c441720b14d32ef |
Rejected attempts saved in the database
| Attempt | Linked block | Original transaction | Attempted transaction | Recalculated hash | Original saved hash | Result | Time |
|---|---|---|---|---|---|---|---|
| #1 | Block #2 | PG sends SG $5 | PG sends SG $1 [changed] | 4aff7262a6fd01638e5a100373d8071df920cf3a179c4d92669f8367d87a30b5 |
00010938b21dbda8f9c5308f115231188f679f1642373f335540c2660d002747 |
FAILED: Recalculated hash does not match the original saved hash | 2026-11-23 11:04:27 |
Learning demo only. A rejected attempt is saved in failed_transactions and linked to its original block_id. Its proposed transaction is not written into the blockchain_blocks table.