<blockquote>
<p>For node &gt; 0.13 is it a trigger the say to node, Hey, I'm a segwit transaction! check in Txinwitness!</p>
<p>For node &lt; 0.13 Push ScriptSig inside and that's it, the transaction is ANYONE_CAN_SPEND</p>
</blockquote>
<p>Almost exactly right.</p>
<p>Segwit validation code was added in Bitcoin Core 0.13.0, but mainnet activation logic was only added in 0.13.1. That means that 0.13.0 will not enforce these things on mainnet yet (and 0.13.1 will only do it for the part of the blockchain after block 477120).</p>

CC BY-SA 4.0
2020-04-04T18:39:08.787Z
2020-04-04T18:39:08.787Z
2020-06-16T11:10:03.350Z
Pieter Wuille
<p>I have some doubts about P2SH-P2WPKH BIP16.
I can read the <a href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#witness-program" rel="nofollow noreferrer">witness program</a> and I understand that a node is triggered when find 0 and 20 o 32 bytes in scriptSig or ScriptpubKey, more precisely:</p>

<p>If is <em>P2WPKH nested in BIP16 P2SH</em> node check inside scriptSig and search 0-20 bytes (witness program). the witness program must be uguale to redeem script. (address start with 3)</p>

<p>If is <em>P2WPKH</em> scriptSig must be empty. and the witness program is inside scriptPubKey (address start with bc1)</p>

<p>Here I have a P2WPKH nested in BIP16 P2SH transaction output. I can see <code>160014fdda5544c22213f51080d48da9521b452b99a92c</code> in scriptsig.</p>

<blockquote>
  <p>the question is:</p>
</blockquote>

<p>For node > 0.13
is it a trigger the say to node, Hey, I'm a segwit transaction! check in Txinwitness!</p>

<p>For node &lt; 0.13
Push ScriptSig inside and that's it, the transaction is ANYONE_CAN_SPEND</p>

<pre><code>    {
  "txid": "1fef9c4f076c7dcd92b623bd68136938da4cac6f20fe5384e05c2856e6ec96cc",
  "hash": "df766b607caec934ce35fb0fad6d9caecdc376766135d6f76f5e5c0fad907815",
  "version": 2,
  "size": 215,
  "vsize": 134,
  "weight": 533,
  "locktime": 0,
  "vin": [
    {
      "txid": "5b263a77d64d1aa9d71335f31a46fa6e29212f164d14faea6e7340ae45f5efe6",
      "vout": 0,
      "scriptSig": {
        "asm": "0014fdda5544c22213f51080d48da9521b452b99a92c",
        "hex": "160014fdda5544c22213f51080d48da9521b452b99a92c"
      },
      "txinwitness": [
        "30440220341fd51d549c0ac8269e3711012c91dc4795bc70944ae4fbe77e0bb163977987022076150a459ec655082cae691833d205bb512e926b16511ec7ccf1785ca08476b001",
        "023bbedf4ba488bc1c0c422d14e8f5a151feeb14dae93e891d17489ec007b654ce"
      ],
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 49.991,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_HASH160 09731285fcf96b502243a34e2447ee9a9ffac839 OP_EQUAL",
        "hex": "a91409731285fcf96b502243a34e2447ee9a9ffac83987",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2Mt7BvNshtjdEHRysNdaBi7T82nUCEVZjoW"
        ]
      }
    }
  ]
}
</code></pre>

CC BY-SA 4.0
2020-04-04T18:14:18.813Z
What is your question?
Pieter Wuille
CC BY-SA 4.0
2020-04-04T18:32:37.077Z
@PieterWuille I updated my question. it's just a doubt. Thanks
monkeyUser
<transactions><segregated-witness><p2wpkh>
ScriptSig in P2SH-P2WPKH BIP16
monkeyUser
# ScriptSig in P2SH-P2WPKH BIP16

(Asked by: username_0 on 2020-04-04)

I have some doubts about P2SH-P2WPKH BIP16.
I can read the [witness program](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#witness-program) and I understand that a node is triggered when find 0 and 20 o 32 bytes in scriptSig or ScriptpubKey, more precisely:

If is *P2WPKH nested in BIP16 P2SH* node check inside scriptSig and search 0-20 bytes (witness program). the witness program must be uguale to redeem script. (address start with 3)

If is *P2WPKH* scriptSig must be empty. and the witness program is inside scriptPubKey (address start with bc1)

Here I have a P2WPKH nested in BIP16 P2SH transaction output. I can see `160014fdda5544c22213f51080d48da9521b452b99a92c` in scriptsig.

> the question is:

For node > 0.13
is it a trigger the say to node, Hey, I'm a segwit transaction! check in Txinwitness!

For node < 0.13
Push ScriptSig inside and that's it, the transaction is ANYONE\_CAN\_SPEND

```
    {
  "txid": "1fef9c4f076c7dcd92b623bd68136938da4cac6f20fe5384e05c2856e6ec96cc",
  "hash": "df766b607caec934ce35fb0fad6d9caecdc376766135d6f76f5e5c0fad907815",
  "version": 2,
  "size": 215,
  "vsize": 134,
  "weight": 533,
  "locktime": 0,
  "vin": [
    {
      "txid": "5b263a77d64d1aa9d71335f31a46fa6e29212f164d14faea6e7340ae45f5efe6",
      "vout": 0,
      "scriptSig": {
        "asm": "0014fdda5544c22213f51080d48da9521b452b99a92c",
        "hex": "160014fdda5544c22213f51080d48da9521b452b99a92c"
      },
      "txinwitness": [
        "30440220341fd51d549c0ac8269e3711012c91dc4795bc70944ae4fbe77e0bb163977987022076150a459ec655082cae691833d205bb512e926b16511ec7ccf1785ca08476b001",
        "023bbedf4ba488bc1c0c422d14e8f5a151feeb14dae93e891d17489ec007b654ce"
      ],
      "sequence": 4294967295
    }
  ],
  "vout": [
    {
      "value": 49.991,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_HASH160 09731285fcf96b502243a34e2447ee9a9ffac839 OP_EQUAL",
        "hex": "a91409731285fcf96b502243a34e2447ee9a9ffac83987",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2Mt7BvNshtjdEHRysNdaBi7T82nUCEVZjoW"
        ]
      }
    }
  ]
}

```

**Tags:** transactions, segregated-witness, p2wpkh

> **Comments:**
> **username_1**: What is your question?  
> **username_0**: @username_1 I updated my question. it's just a doubt. Thanks  

---

## 1 answers

### Answer by username_1 on 2020-04-04. Score: 3 | Accepted answer

> For node > 0.13 is it a trigger the say to node, Hey, I'm a segwit transaction! check in Txinwitness!
>
> For node < 0.13 Push ScriptSig inside and that's it, the transaction is ANYONE\_CAN\_SPEND

Almost exactly right.

Segwit validation code was added in Bitcoin Core 0.13.0, but mainnet activation logic was only added in 0.13.1. That means that 0.13.0 will not enforce these things on mainnet yet (and 0.13.1 will only do it for the part of the blockchain after block 477120).


---

