Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

How blockchains work: Hashing

Hashing is an important part of blockchain because it is the component which implements the immutability of the blockchain.

Hashing is an important part of blockchain because it is the component which implements the immutability of the blockchain. In other words, it is the thing that means once something has been added to the blockchain it can’t be changed; there is a permanent, immutable record of the data.

Hashing is a technique in computer science which takes a piece of data, of any size, and produced a fixed length piece of data; this is called the hash. The hash is a representation of the original data. Hashing has a interesting, and useful, features. If you were to be given a hash and you were asked to find a piece of data that has that hash then without a lot of effort you would be unlikely to find it. This feature of hashing is used in blockchain by the mining nodes. You will see how this all fits together in the next video.

Each block in the blockchain includes some special data items. As well as an identifier for the block, typically a number, and the data to be added to the blockchain, each block contains the hash of the previous block in the blockchain. All of these items are hashed and this hash is included as a data item in the next block of the chain. 

This is a smart idea, if you think about it carefully. If we have a blockchain and someone wants to modify a block in the blockchain then the hashes protect against this. If the data of a block was changed then the hash of that block would change, which subsequently would invalidate the next block as the next block in the blockchain contains the hash of the previous block. This effect ripples all the way along the chain. Because each node has a complete copy of the blockchain, such change to one node’s blockchain would not be reflected in the copies. In this way changes to an ‘old’ block in the blockchain are easily detected and rejected by the other nodes in the network.

This smart idea has the effect of making data written to the blockchain permanent and immutable.

This article is from the free online

How to Get Into Blockchain

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now