£0.00
March 13, 2021
Comments Off on How to write data to a blockchain
Blockchain is arguably the most futuristic technology which is growing very rapidly day-by-day. This technology developed alongside the creation of bitcoin, which is a decentralized currency. Although many people associate blockchain with bitcoin, both are of completely different characteristics.
Blockchain is a record-maintaining platform. It records all the transactions directed towards it. Whereas bitcoin is a cryptocurrency that has its value. Blockchain on the other hand is opensource and any developer can use it to build anything he wants to. Before diving into the topic of how blockchain maintains so many records. And how to write data on it. You have to understand the basic analogy of cryptography.
What is Cryptography?
The ‘Crypto’ from cryptography means ‘hidden secret’ in Greek. Whereas ‘Graphy’ means to study. Putting them together cryptography is a study of secure data transmission. It is very useful in cases when messages transmit without public knowledge. So, that people cannot read sensitive information. It works on certain pre-decided protocols that can decipher the messages.
What is a Block-Chain?
It is important to understand Cryptography first before diving into the blockchain. In this technology, multiple blocks interlink with the help of cryptography. Where each block has its predecessor’s hash, data, and timestamp. Most companies use it as a ledger to maintain full-proof records. Because you cannot reverse the transaction once recorded on a Blockchain.
Hashing
It is the conversion of unified data into unique combinations. When you transact via blockchain and the verification of that transaction is complete. Then that data is treated using a hashing algorithm. Where the data converts into unique numbers and letters so that the system can add that detail to the block. Hashes are very peculiar in terms of blockchain because it only works one way. Although the combination of similar data will create the same hash every time. Reversal of hash is almost impossible. Because even a slight change in data will change the unique hash number.
How is data written to a blockchain?
Blockchain has a decentralized database. Due to which data never accommodates in a single place. Its distribution is to all the systems available in the network known as nodes. Were, each device or node stores blockchain data in the form of a copy. Let’s see an example to understand that:
Taking 2 parties into consideration, one is Alex, & the other is Stella.
Let’s suppose Alex is sending a payment to Stella. For that, he will use his private key along with Stella’s blockchain address. When he transacts, there is an allocation made to a block. This block is then verified by multiple algorithms on the network.
Once the block validates, it is then added to the blockchain. After which Stella will receive her payment. Then data with details of this transaction will be present on that block forever.
Is storing data on a Blockchain costly?
The data which you can store on a blockchain is very limited. Most of the chains do not allow more than few kilobytes. Storing data across blockchain is also very expensive. Because you not only pay the base price of storing data, but there are also charges as per the size of data you store. The fees for Fast smart contracts are even higher.