<p>Inside script sig, there's a signature <code>3045022100cfa7d65576fafd8f827904a1292b55d234898c1e444cd2dfc05f5e15b6f69e4402200b7ea6a9e3da80ea771fe1170795adcbea88d67eb8d82828e85d4b5883b9f9a801</code>, and signature itself is appended with sighash type(which is '01' here, SIGHASH_ALL).</p>
<p>If there's nothing appended within signature, it's SIGHASH_DEFAULT(can only be used in taproot transaction)</p>

CC BY-SA 4.0
2024-04-23T06:35:49.173Z
2024-04-23T06:35:49.173Z
Hyunhum Cho
<p>How to know which sighash type we have to append to the trimmed transaction at the time of input scripts verification, take reference from the below example:</p>
<pre class="lang-json prettyprint-override"><code>{
  &quot;version&quot;: 2,
  &quot;locktime&quot;: 0,
  &quot;vin&quot;: [
    {
      &quot;txid&quot;: &quot;f7268fdc3dd4ab2ce606a9857f321f9c9d94a7cc4ca7d31db481938ce222403e&quot;,
      &quot;vout&quot;: 28,
      &quot;prevout&quot;: {
        &quot;scriptpubkey&quot;: &quot;76a9145ae0dedcb9a96b8d4310e4ff137a22e0233258e988ac&quot;,
        &quot;scriptpubkey_asm&quot;: &quot;OP_DUP OP_HASH160 OP_PUSHBYTES_20 5ae0dedcb9a96b8d4310e4ff137a22e0233258e9 OP_EQUALVERIFY OP_CHECKSIG&quot;,
        &quot;scriptpubkey_type&quot;: &quot;p2pkh&quot;,
        &quot;scriptpubkey_address&quot;: &quot;19HXCYbrynpvTMYkQoneBgo3xEnXPFDd4z&quot;,
        &quot;value&quot;: 150653
      },
      &quot;scriptsig&quot;: &quot;483045022100cfa7d65576fafd8f827904a1292b55d234898c1e444cd2dfc05f5e15b6f69e4402200b7ea6a9e3da80ea771fe1170795adcbea88d67eb8d82828e85d4b5883b9f9a80121038e464810ac06e1a7589e58bd9050ff1fc4d4768f00aaeedb2d4b5c231ac8851d&quot;,
      &quot;scriptsig_asm&quot;: &quot;OP_PUSHBYTES_72 3045022100cfa7d65576fafd8f827904a1292b55d234898c1e444cd2dfc05f5e15b6f69e4402200b7ea6a9e3da80ea771fe1170795adcbea88d67eb8d82828e85d4b5883b9f9a801 OP_PUSHBYTES_33 038e464810ac06e1a7589e58bd9050ff1fc4d4768f00aaeedb2d4b5c231ac8851d&quot;,
      &quot;witness&quot;: null,
      &quot;is_coinbase&quot;: false,
      &quot;sequence&quot;: 4294967293,
      &quot;inner_redeemscript_asm&quot;: null
    }
  ],
  &quot;vout&quot;: [
    {
      &quot;scriptpubkey&quot;: &quot;0014bc2870381de4d706a92105419f0c3072e26532d1&quot;,
      &quot;scriptpubkey_asm&quot;: &quot;OP_0 OP_PUSHBYTES_20 bc2870381de4d706a92105419f0c3072e26532d1&quot;,
      &quot;scriptpubkey_type&quot;: &quot;v0_p2wpkh&quot;,
      &quot;scriptpubkey_address&quot;: &quot;bc1qhs58qwqauntsd2fpq4qe7rpswt3x2vk3krdvhh&quot;,
      &quot;value&quot;: 147107
    }
  ]
}
</code></pre>

<transactions><validation><sighash-flags>
Which SIGHASH type we have to append at the end of the trimmed transaction in OP_CHECKSIG
lladane
# Which SIGHASH type we have to append at the end of the trimmed transaction in OP_CHECKSIG

(Asked by: username_0 on 2024-03-26)

How to know which sighash type we have to append to the trimmed transaction at the time of input scripts verification, take reference from the below example:

```json
{
  "version": 2,
  "locktime": 0,
  "vin": [
    {
      "txid": "f7268fdc3dd4ab2ce606a9857f321f9c9d94a7cc4ca7d31db481938ce222403e",
      "vout": 28,
      "prevout": {
        "scriptpubkey": "76a9145ae0dedcb9a96b8d4310e4ff137a22e0233258e988ac",
        "scriptpubkey_asm": "OP_DUP OP_HASH160 OP_PUSHBYTES_20 5ae0dedcb9a96b8d4310e4ff137a22e0233258e9 OP_EQUALVERIFY OP_CHECKSIG",
        "scriptpubkey_type": "p2pkh",
        "scriptpubkey_address": "19HXCYbrynpvTMYkQoneBgo3xEnXPFDd4z",
        "value": 150653
      },
      "scriptsig": "483045022100cfa7d65576fafd8f827904a1292b55d234898c1e444cd2dfc05f5e15b6f69e4402200b7ea6a9e3da80ea771fe1170795adcbea88d67eb8d82828e85d4b5883b9f9a80121038e464810ac06e1a7589e58bd9050ff1fc4d4768f00aaeedb2d4b5c231ac8851d",
      "scriptsig_asm": "OP_PUSHBYTES_72 3045022100cfa7d65576fafd8f827904a1292b55d234898c1e444cd2dfc05f5e15b6f69e4402200b7ea6a9e3da80ea771fe1170795adcbea88d67eb8d82828e85d4b5883b9f9a801 OP_PUSHBYTES_33 038e464810ac06e1a7589e58bd9050ff1fc4d4768f00aaeedb2d4b5c231ac8851d",
      "witness": null,
      "is_coinbase": false,
      "sequence": 4294967293,
      "inner_redeemscript_asm": null
    }
  ],
  "vout": [
    {
      "scriptpubkey": "0014bc2870381de4d706a92105419f0c3072e26532d1",
      "scriptpubkey_asm": "OP_0 OP_PUSHBYTES_20 bc2870381de4d706a92105419f0c3072e26532d1",
      "scriptpubkey_type": "v0_p2wpkh",
      "scriptpubkey_address": "bc1qhs58qwqauntsd2fpq4qe7rpswt3x2vk3krdvhh",
      "value": 147107
    }
  ]
}

```

**Tags:** transactions, validation, sighash-flags


---

## 1 answers

### Answer by username_1 on 2024-04-23. Score: 1

Inside script sig, there's a signature `3045022100cfa7d65576fafd8f827904a1292b55d234898c1e444cd2dfc05f5e15b6f69e4402200b7ea6a9e3da80ea771fe1170795adcbea88d67eb8d82828e85d4b5883b9f9a801`, and signature itself is appended with sighash type(which is '01' here, SIGHASH\_ALL).

If there's nothing appended within signature, it's SIGHASH\_DEFAULT(can only be used in taproot transaction)


---

