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 foundations of what every Op_code does.
That is the way in which the primary transaction varieties (P2PK and P2PKH) are literally validated, and that is how I believed all transactions have been validated: you will have a script language with which you’ll create all kinds of unique spending situations, and the software program simply executes the scriptPubKeypt alongside the scriptSig to see if the transaction is legitimate. It is easy and it is sensible.
However now enter P2SH transactions. It took me a very long time to get that now, the script just isn’t really blindly validated by the software program anymore. We really inform the software program what it’s imagined to do when it encounters such a transactions: it has to confirm the locking script supplied 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 knowledge of a hashed public key. We have now to explicitly inform the software program what to do, the best way 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 means of verifying transactions, that’s the software program blindly working the scriptPubKey and the scriptSig.
And in spite of everything this I ponder what’s even the purpose of getting a script language in any respect, if we really should explictly inform the software program the best way to deal with every transaction sort?
To be clear, I am not for or towards something specifically, I am simply within the subject and attempting to study.