Storing data on the blockchain

by Héctor Ugarte

On Bitcoin blockchain.
There are different ways to store data on top of the Bitcoin blockchain.
1.Value: Encode data in the number of satoshis being sent to an address.
2.Vanity address: Brute force through keys until you get an address that encodes your data.
3.Fake Address: Encode data in the Address itself. Because the Address encodes data of your choice it cannot have been the result of a derivation from a private key 1 of N.
4.MultisigAddress: These are more complex Bitcoin addresses that require one key out of N to redeem.
5.OPRETURN: Command in the Bitcoin scripting language that was specifically added to allow the inclusion of metadata on the block chain. Currently 40 bytes.
6.Sequence: This is an unused integer.
7.Coinbase: Miners can include data in a coinbase transaction.

chart

On Ethereum blockchain (Ethereum data storage).
Every contracts on Ethereum’s blockchain has its own storage which only it can write to. This is known as the contracts state and it is a flexible database which allows you almost unlimited storage space. A contract’s storage is at its most basic a key-value store with 2256 possible keys and 2256. This makes for sufficient possible storage to create database structures of any type imaginable, but there exists limits in terms of processing speed, since on average every 12.7 seconds the state of the database is updated. In the other hand each computation has a fixed gas(fees) cost and miners pick what ether price to charge for the gas. That is why storage on Ethereum blockchain is more for storing variables like a user’s balance etc. Large text files would be very expensive. Other companion technologies to Ethereum, current on development like Swarm will allow to work with bigger data.

Advertisements