Tech

How data is stored on blockchain?

What Is Solana Crypto

From all over, we keep hearing how blockchain is a revolutionary technology for data storage. Immutability, difficult to hack, and indestructibility are some common attributes referred to blockchain for affirming its unmatched data security. So, let’s understand how data is stored on the blockchain that it is being considered so secured.

Hashing- the data storing mechanism of blockchain

You must be knowing that in blockchain, data is stored in the form of blocks. Now, regarding the data storing mechanism of blockchain the major takeaway is, not every transaction data directly gets stored into blocks. Rather the data of multiple transactions are combined through a process called hashing and a final unified block is created. A block usually comprises the data for all the transactions that happened in temporal proximity.

  • Let’s assume there is a verified transaction, say transaction A, and the data for this transaction needs to be added to a block in a chain.
  • First, the data is put through a Hash algorithm, which will create a unique set of numbers and letters called Hash (#). The point to be noted here is that the same data will always produce the same Hash.
  • So, now we have a hash for transaction A. Next, assume that transaction B has produced another new set of data to be added to a block.
  • The data from transaction B will also be put through the hash algorithm, and since the transaction B data is different from the transaction A data, so a completely unique hash(#) will be generated.
  • Now, the two hashes for two different transactions will again be put through the hash algorithm to create another unique hash.
  • This process of combining multiple hashes generated from multiple transactions continues until it reduces down to one single Hash – the ‘root’ hash. This process is called Hashing.

In a nutshell, hashing is a process of repetition. Each transaction is hashed, then joined and hashed again till the final root hash is created. The purpose of summarizing multiple sets of hashed transactions into a single root hash is to significantly reduce the amount of data required to be stored or transmitted over the blockchain network. Then, this compressed data for the root hash gets stored as one block in the chain.

The root hash serves as the unique identifier for that particular block, and this root hash number is linked to the hashes of its preceding and succeeding blocks in the chain. Now let’s understand how data stored through hashing improves data security. 

Merkel Tree-the layers of security in blockchain data

It is easy to visualize a tree structure for the above mentioned hashing process, where multiple layers of hashing eventually lead to creating one final root hash or one final block. This hash-based data structure for representing the hash list is called the Markel tree. The Markel tree describes how the hashes for each block and its children are linked to each other. 

Without getting into the crypto-technicality of the Markel tree, let’s simply understand its context. The focus here is that when the hashing process is repeated with exactly the same transactions, the same hashes will be created, but this mechanism only works one way. This means the same data will always produce the same Hash, but it is impossible to reverse the process; one can’t decipher the original data by un-hashing the hash numbers and letters. Thus, with the creation of every Hash, a layer of security gets added to the data because any change or tempering in data will result in a completely different hash. And a change in any hash will affect every iteration of hashes all the way to the root hash in the Merkle Tree.  

Off-chain decentralized data storage via Blockchain

Storing the data inside each block on the chain is highly secured, and if any attack happens, the data can be restored and used. But storing data on-chain is a highly costly affair, especially when the data size is heavy. So, there are other off-chain methods of storing data via blockchain. The off-chain storage doesn’t store the entire data on the blockchain but stores the metadata alone. One of the most popular blockchain-powered off-chain data storage solutions is decentralized cloud storage. 

Decentralized Cloud Storage leverages the blockchain technology

 and allows you to upload and manage data files on IPFS. Popularly known as IPFS is a blockchain-based data storage technology that uses the BitTorrent protocol. What happens here is that data is not stored as a whole rather it is broken into shards and then stored in multiple instances. The file or data gets downloaded only if the person has requested it, so data downgliding is address dependent. 

Decentralized cloud storage combines the cloud storage interface with IPFS API. It is the most efficient IPFS pinning service for collectors, platforms, and creators.

How does a decentralized cloud storage platform work?

Encryption: Decentralized Cloud Storage Platform automatically encrypts files/data before uploading.

Division into pieces: Once encrypted, every object is divided into small size identical pieces 

Storing: Small object pieces are stored over a global network of storage nodes. The storing method prevents data breaches that happen to data stored in one place.

Retrieving: For retrieving data, only a particular number of pieces out of the whole like 29 out of 80 pieces are required to reconstruct that object. 

Conclusion

While a transaction record like who is the sender, who is the receiver and how much money has been transacted is an affordable unit of data for blockchain storage. But storing custom data on the blockchain is pretty expensive because of the huge data size. The cost of storing data is so high that even storing kilobytes can cost you a fortune. So the probable good idea is to use a blockchain-powered off-chain decentralized data storage mechanism to store large amounts of data.

 

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular

To Top