Post
Topic
Board Development & Technical Discussion
Re: Is the OP_RETURN for contracts and smart properties?
by
mtomcdev
on 26/07/2014, 10:59:16 UTC
Standard OP_RETURN output is for attaching arbitrary data (e.g. a hash of some document). How do you use it - it's your problem. But you are encouraged to add this data as OP_RETURN output instead of, say, a 1 satoshi fake address output. This way the index of unspent outputs will not be cluttered with provably unspent outputs (my opinion: that does not matter, UTXO will grow huge anyway; we need other ways to optimize it).

For smart contracts there is an entire scripting language built-in. And there are some wiki pages on how you can build cool contracts with it: https://en.bitcoin.it/wiki/Contracts



Thanks for your help!

I have gone through a few times on the wiki page that you have pointed out before I posted here, it is very interesting material, but there is not much there that would help implement the actual solution. At least I couldn't find it in the wiki article.

The transaction_tests.cpp test_IsStandard test gives me some idea how to create an OP_RETURN  output, I guess this is how to create the transaction
// 40-byte TX_NULL_DATA (standard)
t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3 8");

To experiment with OP_RETURN output do I need to create a new app based on the bitcoin source  by putting my own code to create the transaction or is it possible to create an OP_RETURN output using the bitcoind app?



Proof of existence is a pretty slick new service that automates OP_RETURN transactions for you.

http://www.proofofexistence.com/about

Thanks for the info. That's a really good and smart service that utilizes the OP_RETURN output. As the description of the service says that could be very useful in IP ownership disputes. The source there helps me to understand better how OP_RETURN output works.