Claudio Koller · 12/29/2022

Hash Functions in Bitcoin simply explained

Hash function is an element of cryptography and is used to specify a string of characters, a word or a data set of any size in a fixed length. It is basically used for security purposes and is the core of Bitcoin's cryptographic security.

In cryptography, a hash function is a mathematical function that takes input data of any size and produces a fixed-size output called a hash value or a hash.

The most important property of a hash function is that it is a one-way function, meaning that it is easy to calculate the hash value for any input, but it is not possible to determine the original input from the hash value alone.

Types of hash functions

There are many different hash functions, all with different properties. The hash function that is used in bitcoin is the SHA-256, which stands for Secure Hash Algorithm.

History of SHA-256

The SHA (SHA-0) was developed by the National Institute of Standards and Technology (NIST) and the NSA (National Security Agency) and introduced in 1993. Due to a weakness in the algorithm, the successor SHA-1 was already introduced in 1995.

In the meantime, there are the hash functions SHA-224, SHA-256, SHA-384, and SHA-512, where the digit describes the length of the bit sequence of the output.

Where are hash functions used in bitcoin?

Several functionalities of bitcoin are based on this hash function. The bitcoin address is a hash value of the associated public key and the individual transactions are also identified by their hash values. SHA-256 also occurs in the bitcoin mining process.

Hash functions are one-way functions. That is, they only work in one direction. It is not possible to generate the original input from a hash, even if the hash function used is known. Thus, a hash function is non-reversible.

Origin hash functions

Along with encryption and digital signatures, they are important components for secure communication.

Hash functions chop up information and represent it in a different form. The product of information that has been mapped by a hash function is called a hash or hash value.

What is a hash value?

The hash value represents the result, which was computed by means of a Hashfunktion. One defines a fixed length, how long a hash value may always be.

Often the hash value is coded as a hexadecimal string. This means that the hash value consists of a combination of numbers and letters between 0 and 9 as well as A to F.

Hash functions in the mining process

In the mining process, a block is bundled and contains multiple transactions as well as

information about the previous block. This means if someone wanted to change the database or duplicate a transaction, he or she would have to change the hash in all previous blocks.

In order for a block to be added to the bitcoin blockchain, miners must find a hash that meets the Difficulty.

Example of a hash

Input «Pocket Bitcoin» with SHA-256 gives the output: 2990e6def278e1d502089e8d3832c30bc8f884202ab700025e54376bff3cc2e4

Input «pocket bitcoin» with SHA-256 gives the output: 95841df382eda078daf25205ea6a9d156472e5a901135f2c447fe9f9d0809f25

The output is significantly different, although the inputs are minimally different. In this example, only the case has changed to lower case, but a lot has changed on the output side, the hash value, so no similarities can be seen.


Hash functions play an important role in the bitcoin network. In bitcoin, hash functions are used to verify the integrity of transaction data to enable the creation of new bitcoin currency units through the mining process. In addition, the hash functions are used to create unique addresses for each user on the network.

Spread the knowledge

If you liked this content, make sure to share it with your friends. If you think there's something missing here, send us a quick message.


Congratulations! 🥳

Your bank payment arrived and was successfully exchanged into bitcoin.

Your bitcoin are soon on the way to your Bitcoin wallet.

Bitcoin purchase

Bank payment:EUR 100.00

Purchased:BTC 0.00435850

Exchange rate:EUR 22,599.90 / BTC