Types of bitcoin payment scripts:
- P2PK - (Pay To Pubkey) is a script pattern that locks an output to a public key. Provide the pubkey and a digital signature to unlock.
- P2PKH - (Pay to Pubkey Hash) similar to P2PK, but the lock contains the hash of a public key instead (and not the public key itself). Key is not revealed until coins are unlocked.
- P2MS - (Pay to MultiSig) is a script pattern that allows you to lock bitcoins to multiple public keys, and require signatures for some (or all) of those public keys to unlock it. Limited to 3 pubkeys, no address format.
- P2SH - (Pay to Script Hash) - transactions are locked behind the hash of an unlocking script. Unlocking script must equal hash and the script must evaluate to true to unlock the coins.
- NULL DATA - Allows one to attach arbitrary data on the blockchain. This locking script cannot be unlocked.
Read more here: https://learnmeabitcoin.com/technical/script
I had a question about P2SH. Suppose P2SH is being used for a 2-of-3 multisig locking script. There are multiple ways to unlock the script. But don't you have to commit to one when generating the script hash? Essentially turning that 2-of-3 multisig into a 2-of-2, whichever pubkeys were picked for the unlocking script?