3

I'm involved in a Proof of Existence project and I need to know if it is convenient to create a private blockchain or we can use Bitcoin or Ethereum.

I would like to know the price of storing a SHA3 hash in Bitcoin and Ethereum blockchains.

5

In Bitcoin, you can store 80 bytes in one transaction with OP_RETURN. SHA-3(256) has a size of 32 bytes and can be stored in one transaction. The fee for the OP_RETURN transaction is 0.0001 BTC. By today's price, it's $0.177 per tx. You can optimize it by using aggregations services, such as Open Timestamps

In Ethereum, there are at two options to store data in the blockchain.

  • store in a contract's state
  • store in a blockchain log

To store one byte in contract's state you need 0.000035 ETH or $0.003115 if 1 ETH worth $89. To store 32 bytes you need $0.09968

to store 32 bytes in a log you need only 8*32=256 gas

Disadvantage of logs is that you can not access logs' data from contracts. Quote from Technical Introduction to Events and Logs in Ethereum

Logs were designed to be a form of storage that costs significantly less gas than contract storage. Logs basically cost 8 gas per byte, whereas contract storage costs 20,000 gas per 32 bytes. Although logs offer gargantuan gas savings, logs are not accessible from any contracts.

  • 1
    If you're making that comparison the Ethereum number should probably use the cost of writing to the event log rather than to storage. You need to write to storage if you want to do something with the stored data in a subsequent transaction, but you can't do anything useful with something stored in OP_RETURN either. – Edmund Edgar May 17 '17 at 0:35
  • @EdmundEdgar thank you for pointing out about writing to the log. I updated my answer. The disadvantage of storing proof of existence data in the log is that you can't read it from contracts. But it is significantly cheaper – Igor Barinov May 17 '17 at 0:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.