← Back to Glossary

Hash Function

There are many instances of cryptographic hash functions, but all cryptographic hash functions share a few key properties.

There are many instances of cryptographic hash functions, but all cryptographic hash functions share a few key properties. - All cryptographic hash functions take an input, called a preimage, and produce an output, called a hash or digest, of a fixed length. This length varies based on the precise function used. - The output of a cryptographic hash function is deterministic. For a given input, the output will always be exactly the same. - A cryptographic hash function is a one-way function.

An output can easily be calculated from an input. However, there is no known way of determining the input from a given output. - The output is random and unpredictable. There is no known method for targeting a specific output and calculating the proper input.

Nor can a relationship be drawn between a series of inputs and their outputs. For example, if an input of 100 characters is changed by a single character, the new output bears no resemblance to the old output. These properties make cryptographic hash functions very useful for Bitcoin.

Hashing is random and uncontrollable, ensuring Bitcoin mining is a fair competition. Hashing a public key or a script to obtain an address provides superior security, privacy, and convenience for users. Hashing transactions and blocks provides a simple way of creating universally unique IDs for both transactions and blocks.

Finally, Merkle Trees use hashing to create reliable, immutable summaries of all transactions in a block, making mining and block verification significantly more efficient. Bitcoin only uses a few hash functions for its various aspects. The hash function SHA-256 is used for creating Proofs-of-Work, and SHA-256 is applied twice to generate txids.

In order to generate public key hashes or addresses, the hash160 function is used. This is a combination of the SHA-256 and RIPEMD160 hash functions.

Hash Function is a fundamental concept in Bitcoin's architecture that plays a critical role in how the Bitcoin network processes and validates transactions. Onramp's glossary explains Hash Function and other core Bitcoin concepts to give investors a deeper understanding of how Bitcoin works.

Frequently Asked Questions

What is Hash Function in Bitcoin?

Hash Function is a core element of the Bitcoin network's infrastructure. It is integral to how Bitcoin achieves decentralized consensus and ensures the integrity of every transaction on the blockchain.

Why should investors understand Hash Function?

Understanding Hash Function helps investors appreciate Bitcoin's security model and decentralized architecture. Onramp's educational resources break down complex concepts like Hash Function into accessible explanations.

How does Hash Function relate to Bitcoin security?

Hash Function contributes to Bitcoin's robust security by ensuring that the network operates according to transparent, verifiable rules. Bitcoin's $1+ trillion market cap is secured in part by mechanisms like Hash Function.

Multi-Institution Custody

Are you ready?

The best security available for your Bitcoin without the technical burden. It’s time to upgrade.

Sign up