An algorithm that transforms a given amount of data (the "message") into a fixed number of digits, known as the "hash" or "digest." Hash functions are a fundamental component in digital signatures, password security, random number generation, message authentication and blockchains. For a simple example of using a hash value to avoid storing keys and passwords on servers, see zero-knowledge proof
Also called a "one-way hash function" because it is nearly impossible to turn the digest back into the original data, it is also exceedingly rare that two different inputs can result in the same output.
This one-way processing is what guarantees the integrity of a blockchain-based currency or contract. All the transactions in a block are hashed into the subsequent block creating a chained linkage. Any alteration to an existing block breaks the chain. See Merkle tree
, hash rate
, digital signature
and hash table
Solve the Bitcoin Puzzle by Hashing
Bitcoin miners are given a mathematical puzzle to solve to prove that they have done substantial work to earn the right to be first to add the next block of transactions to the blockchain. This proof-of-work (PoW) system is also used by Ethereum; however, that is changing (see Ethereum 2.0
Miners' use specialized hardware to perform countless hash computations to come up with the answer such as finding a hash value that begins with 14 zeros. So much hash processing takes place mining Bitcoin worldwide that the electricity used could power a small country (see proof-of-work algorithm
). See crypto mining
In early 2021, Tesla added Bitcoin as an alternate payment on its online order form, only to remove it shortly thereafter. A rumor floated that Elon Musk was not aware of the electricity Bitcoin required but that he would reinstate the option if Bitcoin was ever changed to be more efficient. Considering Bitcoin electricity consumption is common knowledge, the rumor is dubious.
Hashes Are Fixed in Size
The hash value guarantees only that it is mathematically equal to the data it has hashed. If the data are changed in any way, that same hash cannot be generated. No matter how large or small the input, the hash output is fixed; for example, Bitcoin hashes are 256 bits long. See SHA