How does the blockchain work ?
A blockchain is a chain of blocks that contain certain information.
The technique originally described in 1991 by a group of researchers and was intended to time-stamp certain digital documents so that it’s not possible to edit them. Functioning as a digital notary. Nobody did something with this technique until 2009 when “Satoshi Nakamoto” created Bitcoin.
The blockchain function as a distributed ledger and is completely open to anyone. Once data is recorded inside the blockchain it is very difficult to change it. Every block exists of 3 parts :
- The data : which differentiate per blockchain. For example Bitcoin is storing the data of transactions. So the data of a block in the Bitcoin blockchain will be the sender of the bitcoin, the receiver and the amount of bitcoin.
- Hash code : A hash is comparable with a fingerprint. It identifies a block and all of it’s content which is always unique just like a fingerprint. When something inside the block changes, the hash will be different too.
- The hash code of the previous block. This is what is creating the chain. Every block is storing the hash of the previous block.
Each block needs to be validated before it is able to add up to the chain. That is what makes the technology so safe. When someone is trying to temper the blockchain or block info the hash will change which means the whole chain will be invalid.
Computers would be able to calculate the previous hashes even though it is really difficult. But therefor Satoshi Nakamoto implemented the proof of work method to prevent problems. Proof of work slows down the creation of a new block.
Instead of a central entity to manage the blockchain, it’s using a p2p (peer to peer) network and everybody is allowed to join. When someones joins the network he or she will get a full copy of the blockchain. The node can use this to verify if everything is still in order.
When there is a new block, it’s send to everyone on the network. Each node then verifies the block to make sure that it hasn’t been tempered with. When it’s verified each node adds this block to the blockchain.
All the nodes in the network create consensus. They all need to agree on verifying something before the new block is accepted.