Home Business & Finance
Supported Transaction Types
Bitcoin supports a number of default transaction types. Typically, only supported transaction types are broadcasted and validated within the network. Transactions that do not match the standard transaction type are generally discarded. Note that because transactions can have multiple outputs, different output types can be combined within a single transaction.
Figure 3.2 An example of a transaction with a single input spending (w + x) BTCs to two output addresses (X and Y).
Pay To Public Key Hash (P2PKH) A P2PKH transaction output contains the following opcodes:
Pay To Script Hash (P2SH) A P2SH transaction output can only be redeemed by an input that provides a script that matches to the hash of the corresponding
Figure 3.3 The input of transaction 2 points to the output of transaction 1.
Transaction Format Within a Bitcoin Block
Transaction Input Format
output. For example, a P2SH output contains the following transaction outputs:
The redeeming input consequently needs to provide a redeemScript, that hashes to the input’s hash. Note that every standard script can be used for this purpose:
P2SH outputs are currently widely used in multisignature (multisig) transactions.
Multisig A multisignature (or commonly referred to as multisig) transaction requires multiple signatures in order to be redeemable. Multisig transaction outputs are usually denoted as m-of-n, m being the minimum number of signatures that are required for the transaction output to be redeemable, out of the n possible signatures that correspond to the public keys defined in the transaction output. An example transaction output is:
Transaction Output Format
while the redeeming input follows this structure:
Note that P2SH allows an entity to create a transaction so that the responsibility for providing the redeem conditions is pushed from the sender to the redeemer of the funds. Consequently, the sender is not required to pay an excess in transaction fees if the redeem script happens to be complex. Multisignature transactions can be realized with either M-of-N output scripts as well as P2SH.