<p>The reason is that for now, no native segwit address format exists, so transactions cannot be sent directly to segwit outputs. A <a href="https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki" rel="nofollow noreferrer">proposal for native segwit addresses</a> was created, but it won't be usable until all senders and receivers support it.</p>

<p>Instead, segwit-inside-P2SH is used, where outputs go to a BIP16 output with as hash script the hash of the witness program.</p>

<p>To spend such outputs, we must stay compatible with BIP16, and thus a scriptSig that reveals the full witness program is required. That is what you're seeing in this transaction: a BIP16 scriptSig, which reveals a witness program, which on its turn causes inspection of the witness data for the real verification.</p>

CC BY-SA 3.0
2016-11-05T23:19:07.790Z
Are there any proposals for a native P2WPKH address format? Will such transactions be valid when segwit activates in 0.13.1? Or does all segwit have to be contained in P2SH for now?
pinhead
CC BY-SA 3.0
2016-11-06T00:20:54.187Z
There is no address format for native P2WPKH, but it is included in BIP141, so such outputs are fully consensus valid and standard, there is just no way to ask a sender to construct such an output yet. I'm working on a proposal, though.
Pieter Wuille
CC BY-SA 3.0
2016-11-02T06:53:59.857Z
2017-07-10T22:56:13.913Z
2017-07-10T22:56:13.913Z
Pieter Wuille
<p>segwit if a soft-fork, so it must be compatible with bip16. scriptSig contains a pushstack operation which hash is 2N5SJg3gxB8HNxjnj9ZyrLCTxKNrKGH5dHp</p>

CC BY-SA 3.0
2016-11-02T06:35:47.117Z
2016-11-02T06:35:47.117Z
amaclin
<p>Here's an example of a SegWit transaction that also contains data in the <code>ScriptSig</code> field:</p>

<pre><code>{
  "txid": "954f43dbb30ad8024981c07d1f5eb6c9fd461e2cf1760dd1283f052af746fc88",
  "hash": "a5947589e2762107ff650958ba0e3a3cf341f53281d15593530bf9762c4edab1",
  "size": 231,
  "vsize": 148,
  "version": 1,
  "locktime": 0,
  "vin": [
    {
      "txid": "56f87210814c8baef7068454e517a70da2f2103fc3ac7f687e32a228dc80e115",
      "vout": 4,
      "scriptSig": {
        "asm": "002001d5d92effa6ffba3efa379f9830d0f75618b13393827152d26e4309000e88b1",
        "hex": "22002001d5d92effa6ffba3efa379f9830d0f75618b13393827152d26e4309000e88b1"
      },
      "txinwitness": [
        "3044022038421164c6468c63dc7bf724aa9d48d8e5abe3935564d38182addf733ad4cd81022076362326b22dd7bfaf211d5b17220723659e4fe3359740ced5762d0e497b7dcc01", 
        "21038262a6c6cec93c2d3ecd6c6072efea86d02ff8e3328bbd0242b20af3425990acac"
      ],
      "sequence": 4294967295
    }
  ],
</code></pre>

<p>If the <code>txinwitness</code> is the new location for the "unlocking script" section for a <code>vin</code> (as opposed to the old <code>scriptSig</code> field), then why would this transaction still have data in its <code>scriptSig</code> field?</p>

CC BY-SA 3.0
2016-11-01T17:38:18.050Z
I think its to store the hash of signature. I am not completely sure though.
abeikverdi
<segregated-witness>
What's the purpose of ScriptSig in a SegWit transaction?
inersha
# What's the purpose of ScriptSig in a SegWit transaction?

(Asked by: username_0 on 2016-11-01)

Here's an example of a SegWit transaction that also contains data in the `ScriptSig` field:

```
{
  "txid": "954f43dbb30ad8024981c07d1f5eb6c9fd461e2cf1760dd1283f052af746fc88",
  "hash": "a5947589e2762107ff650958ba0e3a3cf341f53281d15593530bf9762c4edab1",
  "size": 231,
  "vsize": 148,
  "version": 1,
  "locktime": 0,
  "vin": [
    {
      "txid": "56f87210814c8baef7068454e517a70da2f2103fc3ac7f687e32a228dc80e115",
      "vout": 4,
      "scriptSig": {
        "asm": "002001d5d92effa6ffba3efa379f9830d0f75618b13393827152d26e4309000e88b1",
        "hex": "22002001d5d92effa6ffba3efa379f9830d0f75618b13393827152d26e4309000e88b1"
      },
      "txinwitness": [
        "3044022038421164c6468c63dc7bf724aa9d48d8e5abe3935564d38182addf733ad4cd81022076362326b22dd7bfaf211d5b17220723659e4fe3359740ced5762d0e497b7dcc01", 
        "21038262a6c6cec93c2d3ecd6c6072efea86d02ff8e3328bbd0242b20af3425990acac"
      ],
      "sequence": 4294967295
    }
  ],

```

If the `txinwitness` is the new location for the "unlocking script" section for a `vin` (as opposed to the old `scriptSig` field), then why would this transaction still have data in its `scriptSig` field?

**Tags:** segregated-witness

> **Comments:**
> **username_1**: I think its to store the hash of signature. I am not completely sure though.  

---

## 2 answers

### Answer by username_2 on 2016-11-02. Score: 3 | Accepted answer

The reason is that for now, no native segwit address format exists, so transactions cannot be sent directly to segwit outputs. A [proposal for native segwit addresses](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki) was created, but it won't be usable until all senders and receivers support it.

Instead, segwit-inside-P2SH is used, where outputs go to a BIP16 output with as hash script the hash of the witness program.

To spend such outputs, we must stay compatible with BIP16, and thus a scriptSig that reveals the full witness program is required. That is what you're seeing in this transaction: a BIP16 scriptSig, which reveals a witness program, which on its turn causes inspection of the witness data for the real verification.

> **Comments:**
> **username_3**: Are there any proposals for a native P2WPKH address format? Will such transactions be valid when segwit activates in 0.13.1? Or does all segwit have to be contained in P2SH for now?  
> **username_2**: There is no address format for native P2WPKH, but it is included in BIP141, so such outputs are fully consensus valid and standard, there is just no way to ask a sender to construct such an output yet. I'm working on a proposal, though.  

---

### Answer by username_4 on 2016-11-02. Score: 0

segwit if a soft-fork, so it must be compatible with bip16. scriptSig contains a pushstack operation which hash is 2N5SJg3gxB8HNxjnj9ZyrLCTxKNrKGH5dHp


---

