• Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

how does node validate scriptSig

Started by Bitcoin, Feb 19, 2022, 06:11 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

how does node validate scriptSig

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 ?


Source: how does node validate scriptSig