<p>This is the PR that made OP_RETURN outputs standard:</p>

<blockquote>
  <p><a href="https://github.com/bitcoin/bitcoin/pull/2738" rel="nofollow">https://github.com/bitcoin/bitcoin/pull/2738</a></p>
</blockquote>

<p>The commit:</p>

<blockquote>
  <p><a href="https://github.com/jgarzik/bitcoin/commit/a79342479f577013f2fd2573fb32585d6f4981b3" rel="nofollow">https://github.com/jgarzik/bitcoin/commit/a79342479f577013f2fd2573fb32585d6f4981b3</a></p>
</blockquote>

<p>The current code:</p>

<blockquote>
  <p><a href="https://github.com/bitcoin/bitcoin/blob/v0.11.0/src/script/standard.cpp#L56-L58" rel="nofollow">https://github.com/bitcoin/bitcoin/blob/v0.11.0/src/script/standard.cpp#L56-L58</a></p>
</blockquote>

<pre><code>    if (GetBoolArg("-datacarrier", true))
        mTemplates.insert(make_pair(TX_NULL_DATA, CScript() &lt;&lt; OP_RETURN &lt;&lt; OP_SMALLDATA));
    mTemplates.insert(make_pair(TX_NULL_DATA, CScript() &lt;&lt; OP_RETURN));
</code></pre>

CC BY-SA 3.0
2015-08-27T17:18:32.847Z
2015-08-27T17:18:32.847Z
morsecoder
<p>Here:</p>

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

<p><a href="https://github.com/bitcoin/bitcoin/blob/ddd8d80c63182aefea56abf743bb9199d9602544/src/script/standard.cpp#L40" rel="nofollow">https://github.com/bitcoin/bitcoin/blob/ddd8d80c63182aefea56abf743bb9199d9602544/src/script/standard.cpp#L40</a></p>

CC BY-SA 3.0
2015-08-27T17:09:20.940Z
2015-08-27T17:09:20.940Z
Nick ODell
<p>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. </p>

<p>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.</p>

<p>Thanks.</p>

<transactions><script><standard><op-return><non-standard-transaction>
Where is the code making OP_RETURN a standard transaction type?
Matthew Darnell
# Where is the code making OP_RETURN a standard transaction type?

(Asked by: username_0 on 2015-08-27)

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.

**Tags:** transactions, script, standard, op-return, non-standard-transaction


---

## 2 answers

### Answer by username_1 on 2015-08-27. Score: 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));

```


---

### Answer by username_2 on 2015-08-27. Score: 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>


---

