What is Hashing?

Ray Wong
Hashcademy
Published in
3 min readAug 4, 2018
Source: https://pixabay.com/photo-1808082/

Blockchain is a series of blocks linked together in a chain-like manner, where block is the smallest unit of record on the system which contains a list of transactions.

An individual block in a blockchain contains a block number, data stored in the block, hash of the previous block and hash of the current block, along with other data items.

What is bitcoin hashing?

Hashing is an important element of the mining process in blockchain like Bitcoin. You can’t really talk much about bitcoin mining without understanding what cryptographic hashing is. Cryptography refers to the technology used to achieve secured and private commutation of data. It is a way of sending coded messages that are understandable only by selected authorised parties. Hashing, is a type of cryptographic technique used in blockchain to achieve secured transactions.

A hash is a long number which could be understood as the digital fingerprint of any collection of data. When you take a specific input and hash it. You will get your output as a long number. Hashing makes it possible to identify and also electronically shorten or convert data into a fixed range of numbers. SHA256 is the specific hash function used for Bitcoin mining and it generates a 64-digit hexadecimal number.

An example of SHA256 output below:

902C47B1CC93EB0CBDD7A4DC22ADB92341D6EF9161BB509CF0CF2AC5C63CC77F

Data stored on each block could be quite substantial. Hashing makes it possible to shorten/convert data into a fixed range of numbers. You could also try the hash function here: https://www.freeformatter.com/sha256-generator.html#ad-output

Hashing algorithm is characterized with several properties, the three most important properties below are highly relevant to blockchain.

• Deterministic — Given the same input, the same hash function will always yield the same output.

• Impossible to be reverse engineered — Reverse engineering is not possible. You can not use a specific output to “guess” the hash function or the hash input.

• Variability — The slightest change in input feed into the SHA256 functions will always yield a very different hash output. Even if the data inputted is different with just a single full stop or a comma, the hash output will still be totally different.

In the Bitcoin blockchain network, the blocks are linked together through the hash outputs. The hash of the current block is generated through the SHA256 functions using the block number, the previous block hash number, and block data together. In other words, the hash of the current block will contain information/hash of the earlier block.

A slight input distortion on any of the blocks will affect not only the block itself but also the whole blockchain; thus rendering the whole chain of transactions invalid. This dependent connection between successive blocks on the blockchain makes the blockchain highly secure and also tamper-proof.

We have now explained what hash function is and what it does. We will explain how this relates to mining in a separate article.

--

--