2

I am looking through the bitcoin github history. I am trying to find the commit where OP_RETURN became accepted as a standard tx. This was included in the changelog for Bitcoin Core 0.90. Any help would be appreciated.

I'm looking through the Script Solver and see where OP_RETURN is included as a type in the template, but don't see where it returns true for any null data case.

Thanks.

2 Answers 2

4

This is the PR that made OP_RETURN outputs standard:

https://github.com/bitcoin/bitcoin/pull/2738

The commit:

https://github.com/jgarzik/bitcoin/commit/a79342479f577013f2fd2573fb32585d6f4981b3

The current code:

https://github.com/bitcoin/bitcoin/blob/v0.11.0/src/script/standard.cpp#L56-L58

    if (GetBoolArg("-datacarrier", true))
        mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN << OP_SMALLDATA));
    mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN));
0
1

Here:

bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsigned char> >& vSolutionsRet)
[...]
    // Empty, provably prunable, data-carrying output
    if (GetBoolArg("-datacarrier", true))
        mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN << OP_SMALLDATA));
    mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN));

https://github.com/bitcoin/bitcoin/blob/ddd8d80c63182aefea56abf743bb9199d9602544/src/script/standard.cpp#L40

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.