Popular Science | Hash Function Brief

Hash functions are an integral part of blockchain technology and can be used for a variety of purposes. It is a mathematical function that accepts input of any given length and produces a fixed length output. The output is usually called a hash value, a (hash) digest or a hash.

There are many hash functions, just like multiple online "calculators". The calculator allows you to hash any input you like using different kinds of algorithms at the same time. The size of the input can range from a single number to the entire file, but the size of the output will always be the same.

The cryptographic hash function must meet the following set of criteria in order to be used in the blockchain:

Unidirectional – It must be easy to calculate the output of a given input, but it is not possible to calculate the input for a given output. This will be an integral part of the cryptocurrency mining that we will discuss later in this chapter.

Pseudo-random – Input changes will produce unpredictable changes in the output. If the hash value of the input "2" is "4", the hash of the input "3" is preferably not 6.

Anti-collision – Finding the two inputs of the hash function results in the same output should be difficult (cannot be read).

Certainty – the same input always needs to produce the same output.

The most commonly used hash algorithm is SHA-256. SHA is an acronym for Secure Hash Algorithm. This number represents the output length in bits, for example, there are four different output lengths in the SHA series: 224, 256, 384 or 512 bits. Another algorithm related to blockchain technology is the RIPEMD series. RIPEMD160 is often used in many cryptocurrencies because you may have guessed that it produces 160-bit output.

Hash values ​​are used for multiple purposes in cryptocurrency and blockchain. The most significant use is to link blocks together to create a blockchain. We call the hash value a data fingerprint because it is anti-collision. If you want to send the file to someone else, you can include a hash digest when the file is hashed before the file is sent. The recipient can calculate the hash of the file after receiving the file and compare it to the hash value you provide to check the integrity of the file.

Each set of data entered can be easily identified by the unique hash it generates. Finding the two inputs of the hash function is almost impossible, which results in the same output (causing a conflict). It takes thousands of years for all supercomputers on Earth to create conflict. This is because there is no way to "calculate" the conflict. The only way to find one is through the brute force method, where you try different inputs until you happen to collide.

to sum up

The hash function is the first cornerstone of the blockchain technique. The hash of the file is like a fingerprint. It is easy to detect if two files are identical by comparing their hash values. The hash links the "blocks" together. If you do not include a hash of the previous block, you cannot change past data. If you try to change the data, the reference or link will not work.

About Horizen , one for money, information, and media. A secure and private platform.

We will continue to update Blocking; if you have any questions or suggestions, please contact us!

Share:

Was this article helpful?

93 out of 132 found this helpful

Discover more

Market

The Rise of Bitcoin: Asian Stock Market Soars, Grayscale’s ETF Dominance, and OKX’s Singapore License

Bitcoin's recent rise to $73,000 amidst a bullish market and tech rally is a clear indication of investor confidence,...

Market

SEC might postpone approval of spot Bitcoin ETF as it reviews comments on newly submitted S-1 forms.

There is currently a disagreement among observers regarding the SEC's decision to add comments on S-1 forms, which ha...

Market

Vanguard CEO Shuns Bitcoin ETF, Urges Long-Term Investment The Plot Thickens!

Vanguard CEO Rejects Bitcoin ETF Support, Stresses Firm's Focus on Long-Term Investing Strategy.

Bitcoin

Get Ready for the Bitcoin Rollercoaster CPI Report Expected to Give Insights on Potential Rally

Fashionista readers are eagerly anticipating the upcoming CPI report, hoping it will provide some relief for BTC, whi...

Bitcoin

Bitcoin: Riding High and Making a Splash in the Digital Ocean

Bitcoin (BTC) starts the week with a slight surge in trading while there has been a rise in activity on L1 chains.

Bitcoin

Bitcoin’s Bearish Sentiments Open the Door for Altcoin Season

The Cardano (ADA) network has been highly sought after by investors looking to expand their cryptocurrency portfolios...