The following is a breakdown of Bitcoin transaction output types. Below, we explain each output type, its corresponding Bitcoin classification, and its role, starting with a summary of older bitcoin output types:
Bitcoin has several old output types that were commonly used before the introduction of newer formats like Segregated Witness (SegWit). Here are some of the older output types:
P2PKH (Pay-to-Pubkey-Hash): This type of output locks the transaction output to a hash of a public key. It requires the spender to provide a signature and public key that match the hash in the output script.
The output script typically looks like OP_DUP OP_HASH160 <20-byte-hash> OP_EQUALVERIFY OP_CHECKSIG.
P2SH (Pay-to-Script-Hash): This type locks the output to a hash of a script. It requires the spender to provide a script that matches the hash in the output script. This allows for more complex spending conditions, such as multisig transactions.
The output script is usually OP_HASH160 <20-byte-hash> OP_EQUAL.
P2PK (Pay-to-Pubkey): This type locks the transaction output directly to a public key. It requires the spender to…