Blockchain technology stores essential data, such as transaction history, within “blocks.” Blockchain ensures the participants of the blocks to see any changes of the data so that messing with the data with ill will becomes extremely difficult.
In a nutshell, it makes a tamper-free distributed ledger.
With distributed ledger, the hacker has to invest impossible amount of effort to forge the data in blocks and to make it stick. However, distribution of data is not the only safeguard the blockchain has.
Now this is where Hash comes in.
---------
Hash : Technology which makes blockchain possible
Hash is a method of transforming a data sequence(like text or numbers) into a value or key with fixed length, preferably shorter via certain hash function. With hash, even extensive amount of sentences can be expressed in a sequence of a few letters and numbers. Various data that are to be stored in blockchains also can be compressed in this way. Key thing is that slightest change in data gives completely different hash value. That makes data tampering to be detected very easily.
Hash saves storage space by transforming data into value of fixed length not matter how long the original text — or information — is. If the original data is identical, then the hash of it is identical as well. (All hail to hash function, people!)
Hash translates data into text sequence of fixed length no matter how long — or big — the sentences are
Identical data has identical hash value
Again, even the smallest change in text returns totally different hash value.
Same hash values can only come from completely identical sources.
That means comparing hash values, which are much shorter than data they are derived from, can tell whether they came from the same source or not. Furthermore, since hash functions drastically changes the result of hash values even when a single letter changes in the text, it is really hard to guess original data out of hash value.
Now, why hash is so important in blockchains?
Blocks contain many different kinds of data, including transaction history, time of block creation, nonce value, etc. Parts you would notice are that it has hash value of itself and values of the previous and next block.
Blocks has hash value of their previous block
Blocks are linked to the previous block with the hash value recorded in itself. Blockchain connects all of these blocks in a sequence with their chain-linked hash values. (Block”chain” indeed, don’t you think?)
Let’s suppose there is an ill-minded hacker who wants to tamper with data in his/her favor. If that hacker changes some parts of data in a block, the hash value for that block changes as well. Since the next block created has the hash value of the previous block, the hacker would need to change that hash value, too. The task goes on indefinitely, which gives impossible amount of work to the malicious hacker.
In case of Bitcoins, new block is made every 10 minutes. The hacker must outrun the pace with hash value from the tampered block, making one after another.
In order for the hacker to success, he/she has to forge the data — and create blocks — with greater computing power than the entire blockchain network. That is something of impossibility with current level of invasive technology.
In short, Hash
translates text of any length to a value of fixed length,
chain-links the blocks by sharing previous and next blocks’ hash values,
changes the hash value completely when the source changes, preventing data-tampering.