A fixed-length string of characters generated from input data of any size using a hash function. In the context of blockchain and cryptocurrencies, a hash function takes an input (or "message") and returns a unique string called a hash value or digest. This process is deterministic, meaning the same input will always produce the same hash, but even a small change in the input will produce a drastically different hash.
Hashes are crucial for ensuring data integrity and security in blockchain technology. Each block in a blockchain contains a hash of the previous block, creating a chain of linked blocks that is secure and immutable. This linking prevents tampering, as altering any part of a block would change its hash, thereby breaking the chain. Hash functions used in cryptocurrencies are typically designed to be computationally efficient while being resistant to collision (where two different inputs produce the same hash) and preimage attacks (where it is infeasible to recreate the original input from its hash). Common hash functions in the blockchain world include SHA-256, used by Bitcoin, and Keccak-256, used by Ethereum.