<p>What you are asking about is the message covered by the signature. In Bitcoin, this message is defined by the consensus rules and is a modification of the transaction the signature is contained in.</p>
<p>The exact form of this message for non-segwit transactions is explained in <a href="https://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx">How to redeem a basic Tx?</a></p>

CC BY-SA 4.0
2020-09-25T19:29:48.677Z
message signed by the signature or private key ?
Nika Kurashvili
CC BY-SA 4.0
2020-09-26T03:54:16.350Z
The message *covered* by the signature. I.e. what the signature commits to.
Ava Chow
CC BY-SA 4.0
2020-09-25T19:28:49.473Z
2020-09-26T03:54:23.167Z
2020-09-26T03:54:23.167Z
Ava Chow
<p>Let's say I sent some BTC to Bob, so I created a transaction (forget about scriptPubKey) since let's say I was able to prove it by executing scriptPubKey. so After I sent BTC to BOB, new transaction's input looks like this:</p>
<pre><code>in: [
  {
     &quot;prev_out&quot;: {
        &quot;hash&quot;: txId,
        &quot;n&quot;: 0
     },
     scriptSig:&quot;3045....e5f5&quot;
  }
],
</code></pre>
<p>Now, this scriptSig exists because when other nodes come and see this, they should be able to validate it. Now, all we have here is the signature , public key (mine), txId(output transaction that I used).</p>
<p><strong>How can another Node which got this transaction validate it ?</strong></p>
<p>You might say: he will see signature + public key of yours. so what will it do to validate it ? if you say that it will try to decrypt signature with public key, that's not enough. Because what I could do is encrypt <code>blablabla</code> string my private key and I'd put that signature there.</p>
<p>So I guess, my question relates to: how Node will prove I proved that I had BTC with scriptSig + txId ?</p>

CC BY-SA 4.0
2020-09-25T18:52:26.060Z
Related: https://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx
Ava Chow
CC BY-SA 4.0
2020-09-25T19:12:52.187Z
hi Andrew, it's kind of a huge explanation and was looking for a easy one. my question simply relates to only one thing: when node looks at scriptSig of the input, how does it know that it's legit ?
Nika Kurashvili
<bitcoin-core><blockchain><bitcoind><blockchain.info>
how does node validate scriptSig
Nika Kurashvili
# how does node validate scriptSig

(Asked by: username_0 on 2020-09-25)

Let's say I sent some BTC to Bob, so I created a transaction (forget about scriptPubKey) since let's say I was able to prove it by executing scriptPubKey. so After I sent BTC to BOB, new transaction's input looks like this:

```
in: [
  {
     "prev_out": {
        "hash": txId,
        "n": 0
     },
     scriptSig:"3045....e5f5"
  }
],

```

Now, this scriptSig exists because when other nodes come and see this, they should be able to validate it. Now, all we have here is the signature , public key (mine), txId(output transaction that I used).

**How can another Node which got this transaction validate it ?**

You might say: he will see signature + public key of yours. so what will it do to validate it ? if you say that it will try to decrypt signature with public key, that's not enough. Because what I could do is encrypt `blablabla` string my private key and I'd put that signature there.

So I guess, my question relates to: how Node will prove I proved that I had BTC with scriptSig + txId ?

**Tags:** bitcoin-core, blockchain, bitcoind, blockchain.info

> **Comments:**
> **username_1**: Related: https://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx  
> **username_0**: hi Andrew, it's kind of a huge explanation and was looking for a easy one. my question simply relates to only one thing: when node looks at scriptSig of the input, how does it know that it's legit ?  

---

## 1 answers

### Answer by username_1 on 2020-09-25. Score: 0

What you are asking about is the message covered by the signature. In Bitcoin, this message is defined by the consensus rules and is a modification of the transaction the signature is contained in.

The exact form of this message for non-segwit transactions is explained in [How to redeem a basic Tx?](https://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx)

> **Comments:**
> **username_0**: message signed by the signature or private key ?  
> **username_1**: The message *covered* by the signature. I.e. what the signature commits to.  

---

