4. What is Hashing?
Hashing
is the process of taking an input of arbitrary length and converting it into a hash
(a modified, outputted value) of a unique and fixed length. Hash functions are used to generate the encrypted output. This process plays a vital role in maintaining the integrity of transactions and confidentiality of data in the blockchain environment.
A hashing algorithm is selected based on a certain number of features. The most important one is that a hashing function must either be collision-free
, or allow for an extremely low probability of collision. Theoretically, it is rather impossible for a hashing algorithm to be absolutely collision-free. However, practically speaking, this is generally achieved by using a very large number of bits in the hash value. This is done in order to make sure that no one can derive the secret items from the hash value, and also to make sure that one hash value uniquely reprints a single data set. SHA-3
, SHA-256
, and Keccak-256
are some of the hashing algorithms used for this purpose.
The probability of generating a single hash value for two different transactions for a 256-bit code would be 2^256
(which is an extremely low chance).
