# What are Hash Functions in block chain?

We know that bitcoins enter into the digital market only through mining. It is a cryptocurrency created as a peer-to-peer currency which can be traded without using any Bank or Payment gateway. When these transactions are made, they are accounted for using a publicly distributed ledger which keeps a record of all the transactions made to every Bitcoin.

Every time a transaction is made, a new block is created. Every new block will be verified and added into the block chain by the miners. Here comes the purpose of hash functions to make the block chain secure.

### What is a Hash?

Hash is a process of converting input of any length of string into a fixed length of text using a mathematical algorithm. Whatever may be the size of input, it will only produce a fixed length of output.

Input + Mathematical algorithm (Hash function) = Hash value

In cryptocurrency, SHA 256 (Secure Hashing Algorithm with 256 bits) or SHA512 are used to create the hash values.

There are few specific features of Hash value −

• Always the same input will create same hash value. Even a small change will create a new hash.

Hello World :

d2a84f4b8b650937ec8f73cd8be2c74add5a911ba64df27458ed8229da804a26

Hello World :

1894a19c85ba153acbf743ac4e43fc004c891604b26f8c69e1e83ea2afc7c48f

Here we can see that even a small change in the case of alphabet “w” has produced entirely different hash value. This makes the hash value unique and unmitigated and secure.

• Any length of input will always create the same length of text in hash value.

• The speed at which the hash value is created also matters in block chains.

• Hash values are highly secure. It is extremely impossible to get the input value from the output. It is also an irreversible and one-way process. You will lose the entire input data once the data passes through hash function and a hash value is created

In a block chain hashes are used to connect the blocks to each other and create the chain. Every new block added to block chain will have the details of the transaction - Amount, address of sender and receiver, time stamp and most importantly the previous block’s (transaction) information stored as a hash value. This entire information again converts into a Transaction ID, which is the hash value of that particular block.

The previous block information + current block’s transactions = Hash value of current block.

In this manner it creates an unbreakable dependency. Based on the Hash value of the current block you can trace previous and next block. Thus hash functions make the block chain a secure, immutable and transparent network, which is the core of cryptocurrency. The concept of hashing has made the block chains revolutionary and unique.

Advertisements