Monday, November 4, 2024

transactions – What’s the level of getting a script language now?

Once I first began studying how transaction are validated, it made sense why a script language was wanted: the scriptPubKey was executed alongside the scriptSig, the software program simply executes this “blindly”, following the principles of what every Op_code does.

That is the way in which the primary transaction sorts (P2PK and P2PKH) are literally validated, and that is how I believed all transactions had been validated: you’ve got a script language with which you’ll be able to create all kinds of unique spending circumstances, and the software program simply executes the scriptPubKeypt alongside the scriptSig to see if the transaction is legitimate. It is easy and it is smart.

However now enter P2SH transactions. It took me a very long time to get that now, the script shouldn’t be truly blindly validated by the software program anymore. We truly inform the software program what it’s imagined to do when it encounters such a transactions: it has to confirm the locking script offered corresponds with the hash within the scriptPubKey, after which confirm the scriptSig with the locking script.

The identical is true with Segwit transactions. Right here the scriptPubKey is nothing greater than a push information of a hashed public key. Now we have to explicitly inform the software program what to do, find out how to deal with such transactions. There’s not even a checksig anymore within the scriptPubKey, or any Op_code in any respect for that matter, within the scriptPubKey or within the witness.

This all appears much less “pure” and natural than the earlier method of verifying transactions, that’s the software program blindly operating the scriptPubKey and the scriptSig.

And in any case this I’m wondering what’s even the purpose of getting a script language in any respect, if we truly must explictly inform the software program find out how to deal with every transaction kind?

To be clear, I am not for or in opposition to something particularly, I am simply within the matter and making an attempt to be taught.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles