12

I am wondering if it is possible to give someone a bitcoin transaction ID and with that he can read some hidden data, like the blockchain.info notes on transactions, but for real, stored in the blockchain forever.

I had this idea but I don't think if it would be a good practice:

Send the minimum amount of BTC possible, wich is 0.00000001 BTC, or 1 satoshi, to an address, and in that address would be the data.

1 ArFAXhvMbwJuub4ujnVbLFszqX3McuzsX

As far as I know, the address is formed by 30 letters in base58, but since the first char must be 1 and the last four have to be the checksum, then you have 25 letters in base58, and that's like 17 bytes.

So, you have to pay like 0.0001 BTC for the transaction fee, and after that you can add data to that transaction at a price of 17bytes per 1 satoshi, by sending satoshis to many addresses that contains the whole data. Imagine if we could store data there forever,.. and communicate with the future...

Is there any other technique of doing this? Is this technique a good practice?

  • Please don't encourage this misuse of the blockchain. There are altcoins for this purpose. – Jus12 Feb 7 '16 at 17:37
  • I'm even more confused now. Reinsurance companies are starting to promote/investigate using the blockchain to store contracts/claims. But the answers given here suggest its a dreadful idea. What am I missing ?www2.deloitte.com/content/dam/Deloitte/uk/Documents/Innovation/… – Mike Gledhill Oct 31 '16 at 13:46
  • Jus12 - which altcoins are for this purpose? – frabcus Jan 17 '17 at 16:56
  • OriginStamp is doing something similar: app.originstamp.org/home – user75407 Jan 26 '18 at 20:16
8

then you have 25 letters in base58, and that's like 17 bytes.

20, actually.

So, you have to pay like 0.0001 BTC for the transaction fee, and after that you can add data to that transaction at a price of 17bytes per 1 satoshi, by sending satoshis to many addresses that contains the whole data. Imagine if we could store data there forever,.. and communicate with the future...

You're going to run into two problems with this: transaction fees and dust rules. Transaction fees mean that each transaction will cost you a couple of cents. Dust rules mean that transactions with outputs below a certain size will simply be dropped. The rationale behind this is that you're sending a transaction so small that the fee required to redeem it will be more than the money that you're sending.

In the longer term, the data you're sending is going to look identical to all of the other data that's in the blockchain. That means that you need to identify your transaction somehow. That's usually done by providing the txid, which is 32 bytes.

Is this technique a good practice?

It depends on what you're trying to accomplish. For example, are you trying to communicate anonymously? You should use BitMessage via Tor instead. Do you want to embed transactional data, like Counterparty does? Embedding the data in Bitcoin is probably the best solution for that.

... and communicate with the future...

Well, the Internet Archive crawls all webpages (including this one!) so you're already uploading the things you've typed into a distributed, long-lasting datastore.

  • Thank you for the answer. How do you calculate that it's exactly 20 bytes? I am sure it must be very easy but I can't think of it. – Nathan Parker Sep 2 '15 at 3:20
  • 1
    @NathanParker I didn't calculate it. Pay to Public Key Hash outputs have a 20-byte HASH160 hash, and that's what the main part of an address encodes. – Nick ODell Sep 2 '15 at 3:53
  • 1
    So, an address is the hash of a public key? Then how do you know the public key given the address? How can you know a transaction was signed using his priv key if you don't know the public to compare? The only way I think of doing this would be by adding the public key in the transaction data.. ? – Nathan Parker Sep 2 '15 at 13:51
  • 2
    They reveal the pubkey when spending it. – Nick ODell Sep 2 '15 at 17:18
  • 1
    I forgot to thank you for this. So, thank you very much :) – Nathan Parker Dec 22 '15 at 17:18
5

It's been done. It's lame. It's spam. You're incurring cost on the whole network for perpetuity (and no, the fee doesn't pay for that).

If you really can't stop yourself look at OP_RETURN as that's at least a much more network friendly way of doing it.

2

Bitcoin is for transactions, not storage. A bitcoin-derived system like Ethereum can be used to implement this. StorJ or FileCoin are special blockchain-like systems just for storage.

2

You could use the OP_RETURN operation in your pubkey script. It gives you 80 bytes of free data (I think it is upgraded from 40 bytes recently you could check).

If you are a developer you could create a program based on bitcoinj which helps you to add an OP_RETURN operation to a transaction.

Script script = new ScriptBuilder().op(ScriptOpCodes.OP_RETURN).data("your message".getBytes()).build();
                tx.addOutput(Transaction.MIN_NONDUST_OUTPUT, script);

you could also look at these solutions :

0

Is this technique a good practice?

NO!

Is there any other technique of doing this?

Yes, there is a number of ways.

http://www.righto.com/2014/02/ascii-bernanke-wikileaks-photographs.html

https://bitcointalk.org/index.php?topic=1023190.0

https://github.com/petertodd/python-bitcoinlib/blob/master/examples/publish-text.py

  • 3
    You should explain why you think the technique is bad practice. In particular, the ascii bernake used essentially the same technique as the asker, just with larger outputs. – Nick ODell Sep 1 '15 at 19:06
-4

As far my knowledge, data can be stored in blockchain by deploying smart contracts,using solidity compiler. The data that we want to store can be stored in struct variables of the smart contract and in form of strings. Once the contract is deployed, a hash is generated. The hash is then stored in the blockchain in form of linked list structure,which is interconnected with other hashes.

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.