<p>In short, yes. The <code>prev_out</code> field is a field of the transaction, AND part of the transaction which gets signed. Note that not all fields in a transaction are signed. What is signed depends on the <a href="https://raghavsood.com/blog/2018/06/10/bitcoin-signature-types-sighash" rel="nofollow noreferrer">SIGHASH_FLAG</a>. Additionally, since each input has its own signature(s), the same fields/data are not signed for each signature in a transaction.</p>
<p><strong>Signature Creation Background:</strong></p>
<p>To create an ECDSA or Schnorr Signature of certain data, you take the hash (hash256) of that data (an integer), and sign that. Effectively, whatever data is hashed and then signed is committed to, making it immutable.</p>
<p><strong>Bitcoin Signatures</strong></p>
<p>In a transaction with 3 inputs, each input will require at least one signature. The signature for each input will sign the transaction, including the <code>version</code>, <code>input_count</code>, <code>prev_outs</code>, <code>output_count</code>, and <code>outputs</code> but ignore the ScriptSig field of the other two inputs. Read more about this process here: <a href="https://github.com/jimmysong/programmingbitcoin/blob/master/ch05.asciidoc" rel="nofollow noreferrer">https://github.com/jimmysong/programmingbitcoin/blob/master/ch05.asciidoc</a></p>

CC BY-SA 4.0
2021-10-04T08:34:55.213Z
2021-10-04T08:34:55.213Z
Sachin Meier
<p><a href="https://i.sstatic.net/gnj2Y.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/gnj2Y.png" alt="enter image description here" /></a></p>
<ol>
<li>What is signed by scriptSig? I use my private key to sign data from the unspent transaction? I sign the &quot;prev_out&quot; object?</li>
<li>I read that the signature in &quot;prev_out&quot; is there to secure &quot;prev_out&quot; from being changed. But if the whole transaction is signed, doesn't that secure also the &quot;prev_out&quot; objects?</li>
</ol>

<bitcoin-core><hash><signature><utxo><transaction-input>
What exactly is signed in "prev_out"?
Rony Tesler
# What exactly is signed in "prev_out"?

(Asked by: username_0 on 2021-09-21)

[![enter image description here](https://i.sstatic.net/gnj2Y.png)](https://i.sstatic.net/gnj2Y.png)

1. What is signed by scriptSig? I use my private key to sign data from the unspent transaction? I sign the "prev\_out" object?
2. I read that the signature in "prev\_out" is there to secure "prev\_out" from being changed. But if the whole transaction is signed, doesn't that secure also the "prev\_out" objects?

**Tags:** bitcoin-core, hash, signature, utxo, transaction-input


---

## 1 answers

### Answer by username_1 on 2021-10-04. Score: 1

In short, yes. The `prev_out` field is a field of the transaction, AND part of the transaction which gets signed. Note that not all fields in a transaction are signed. What is signed depends on the [SIGHASH\_FLAG](https://raghavsood.com/blog/2018/06/10/bitcoin-signature-types-sighash). Additionally, since each input has its own signature(s), the same fields/data are not signed for each signature in a transaction.

**Signature Creation Background:**

To create an ECDSA or Schnorr Signature of certain data, you take the hash (hash256) of that data (an integer), and sign that. Effectively, whatever data is hashed and then signed is committed to, making it immutable.

**Bitcoin Signatures**

In a transaction with 3 inputs, each input will require at least one signature. The signature for each input will sign the transaction, including the `version`, `input_count`, `prev_outs`, `output_count`, and `outputs` but ignore the ScriptSig field of the other two inputs. Read more about this process here: <https://github.com/jimmysong/programmingbitcoin/blob/master/ch05.asciidoc>


---

