I have some doubts about P2SH-P2WPKH BIP16. I can read the 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"
]
}
}
]
}