Hash Function
Hash functions are mathematical functions used to secure and encrypt data as fixed length strings.
Hash functions are one way. Which makes them a critical component for the public/private key pairs used to set up wallets for storing cryptoassets.
The public address used by the wallet to interact with the network is generated by the wallet’s private key during setup. But, since hash functions are one way. The user’s private key used to access their wallet cannot be determined just by knowing the wallet’s public address
Hash functions are also deterministic, when you input the same string it produces the same output. This is how passwords are securely stored for web applications. Instead of storing the password itself, a hash function is used to create a hash value for the password.
When a password is inputted to access the application, a hash value is generated using the hash function. When this hash value matches the stored hash value, the user is granted access to the application.
Cryptoasset networks use hash functions more like electronic signatures. Users sign transactions in their wallets and the hash function encrypts the communication of the transaction for secure transmission to the blockchain.
A variety of hash functions exist cryptoassets can use for this purpose. For example, Bitcoin uses SHA-256, or Secure Hash Algorithm.
When a wallet transmits instructions to Bitcoin’s network. Bitcoin uses SHA-256 to confirm the instructions are valid and add the transaction to the next available block for confirmation.
Further Reading Hash Function
What Is a Hash Function in Cryptography? A Beginner’s Guide