1

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 ?

2
  • Related: bitcoin.stackexchange.com/questions/3374/…
    – Ava Chow
    Sep 25, 2020 at 18:52
  • 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 ? Sep 25, 2020 at 19:12

1 Answer 1

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?

2
  • message signed by the signature or private key ? Sep 25, 2020 at 19:29
  • The message covered by the signature. I.e. what the signature commits to.
    – Ava Chow
    Sep 26, 2020 at 3:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.