how does node validate scriptSig

how does node validate scriptSig

Manage alerts

Loading saved threads...

Nika Kurashvili · External communityPost link
External question — Bitcoin Stack Exchange Author: Nika Kurashvili Original post: https://bitcoin.stackexchange.com/questions/99204 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. 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 ?
Quote
Report
Ava Chow · External communityPost link
External answer — Bitcoin Stack Exchange Author: Ava Chow Original post: https://bitcoin.stackexchange.com/a/99206 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. 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?
Quote
Report
DAAC INSTITUTE · External communityPost link
External answer — Bitcoin Stack Exchange Author: DAAC INSTITUTE Original post: https://bitcoin.stackexchange.com/a/131100 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. The scriptSig validation sequence depends on the type of Bitcoin output being spent, but for a traditional P2PKH transaction, the process can be understood as follows. First, the node retrieves the previous transaction output referenced by the new transaction input. This output contains the scriptPubKey, which defines the conditions that must be satisfied to spend the output. The node then evaluates the spending script using the unlocking data from scriptSig together with the locking conditions from scriptPubKey. For a typical P2PKH output, the scriptSig provides two important values: a digital signature and a public key. The validation process can be simplified into these steps: The node checks that the referenced previous output exists and is unspent. It obtains the scriptPubKey from that previous output. The scriptSig is evaluated, placing its signature and public key onto the stack. The scriptPubKey is then evaluated. It checks the public key hash and verifies that the supplied public key matches the required hash. The CHECKSIG operation verifies that the signature is valid for the transaction and the supplied public key. If script execution completes successfully with a true result, the script conditions are satisfied. The node then continues with the other transaction and consensus checks. The important detail is that scriptSig does not simply get validated in isolation. The unlocking data supplied by the spender must satisfy the conditions established by the previous output's scriptPubKey. For newer output types such as P2SH, SegWit, and Taproot, the validation sequence differs because they use different spending and script rules. Understanding this sequence is useful for anyone learning blockchain development. A Blockchain developer course in Jaipur can cover related concepts such as Bitcoin transactions, cryptographic signatures, scripting, and how nodes verify transaction data. Overall, understanding scriptSig validation provides a useful foundation for learning how cryptographic signatures and Bitcoin's scripting system work together to authorize transactions. https://www.daac.in/blog/a-complete-beginners-guide-to-how-blockchain-works/
Quote
Report

Post Reply

Checking account access…
how does node validate scriptSig | Forex.com.bd