<p>In this particular case, the parameter script code refers to a public key script. </p>

<p>Usually, the function SignatureHash is invoked to either sign a transaction or to verify a signature. Thus it refers to a <strong>transaction input</strong> (this is either the transaction input for which we want to generate the signature that will then be placed in the signature script or the transaction input from which we have extracted the signature that we want to verify). This transaction input refers to an unspent (at the time of creating the transaction) <strong>transaction output</strong>, and this transaction output contains a script that should match the script in the input. It is this script that is passed as a parameter.</p>

<p>On my blog, I have a detailed <a href="https://leftasexercise.com/2018/04/06/signing-and-verifying-bitcoin-transactions/" rel="nofollow noreferrer">post</a> on the process of signing a bitcoin transaction which you might find helpful.</p>

CC BY-SA 3.0
2018-04-11T08:27:03.493Z
2018-04-11T08:27:03.493Z
christianb93
<p>SignatureHash takes in as input a scriptCode:</p>

<pre><code>uint256 SignatureHash(
    const CScript&amp; scriptCode, 
    const CTransaction&amp; txTo, 
    unsigned int nIn, 
    int nHashType, 
    const CAmount&amp; amount, 
    SigVersion sigversion, 
    const PrecomputedTransactionData* cache)
</code></pre>

<p>What is the scriptCode exactly?</p>

<signature><sighash>
SignatureHash description
qweruiop
# SignatureHash description

(Asked by: username_0 on 2018-04-11)

SignatureHash takes in as input a scriptCode:

```
uint256 SignatureHash(
    const CScript& scriptCode, 
    const CTransaction& txTo, 
    unsigned int nIn, 
    int nHashType, 
    const CAmount& amount, 
    SigVersion sigversion, 
    const PrecomputedTransactionData* cache)

```

What is the scriptCode exactly?

**Tags:** signature, sighash


---

## 1 answers

### Answer by username_1 on 2018-04-11. Score: 1

In this particular case, the parameter script code refers to a public key script.

Usually, the function SignatureHash is invoked to either sign a transaction or to verify a signature. Thus it refers to a **transaction input** (this is either the transaction input for which we want to generate the signature that will then be placed in the signature script or the transaction input from which we have extracted the signature that we want to verify). This transaction input refers to an unspent (at the time of creating the transaction) **transaction output**, and this transaction output contains a script that should match the script in the input. It is this script that is passed as a parameter.

On my blog, I have a detailed [post](https://leftasexercise.com/2018/04/06/signing-and-verifying-bitcoin-transactions/) on the process of signing a bitcoin transaction which you might find helpful.


---

