0

I've read this great Explanation of what an OP_RETURN transaction looks like and now I have only one question. Imagine that someone want to store some data in Bitcoin's blockchain. Why should he use OP_RETURN?

I mean, I know that it's impolite to store a lot of data in blockchain as it is, because it makes blockchain bigger, pollutes it, etc. But in fact, is there any hindrance, which makes it at least difficult?

For example, is it possible to store string like >>> "123123" * 100 in transaction locking script field? Why?

1 Answer 1

3

There are two reasons why you should prefer a scriptPubKey of OP_RETURN <data> over <data>.

The first reason is that the non-OP_RETURN output is not prunable, and is actually anyone-can-spend if the data is non-zero. Non-prunable outputs make the unspent transaction set larger, which slows down initial block verification and block propagation times.

The second reason is that the non-OP_RETURN output is nonstandard, meaning that not all miners will mine it. Therefore, it will take longer to get into the blockchain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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