Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A student designs a "blockchain" in which each block holds only its data, a time-stamp and its own hash. It does not store the hash of the previous block.
A blockchain is a digital ledger: a time-stamped series of records that cannot be altered. Each block holds its data, a time-stamp, the hash of the previous block and its own hash. A tiny change in the data gives a completely different hash. If block of is changed, every block from to needs a new hash:
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
(a) Each block checks only itself. Block now has new data and a matching new hash, so it looks correct. Block holds nothing about block , so nothing disagrees. The change cannot be seen.
(b) If block stores the hash of block , it still holds the old hash. The new hash of block no longer matches it, so anyone who checks the chain sees that block was changed.
(c) To hide that, the person must put the new hash of block into block . That changes the data of block , so block gets a new hash, which must go into block , and so on to the end. Every later block must change.
The program shows this: it builds three linked blocks, changes block 1 and works out its new hash, then checks each link.
Log in to join the discussion.
Loading…