pull down to refresh
10 sats \ 0 replies \ @5 OP 23 Nov 2023 \ parent \ on: Is there a mempool notifier for when it is more affordable again? bitcoin
Thanks good idea
1. P2PKH (Pay-to-Public-Key-Hash) UTXO
- Size: ~148 vB
- Structure:
- A P2PKH transaction includes a scriptSig (signature script) in each input, which contains a cryptographic signature and the public key of the sender. This is the traditional way of making transactions in Bitcoin.
- The scriptSig in P2PKH transactions is relatively large because it includes both the signature and the full public key.
- Why the Size?
- The scriptSig (around 107 bytes), combined with other input fields (like previous transaction reference and sequence), accounts for the larger size of P2PKH UTXOs.
2. P2SH (Pay-to-Script-Hash) UTXO
- Size: Typically 91 vB to 102 vB
- Structure:
- P2SH transactions allow the sender to lock funds to a script hash instead of a public key hash. The actual spending conditions are revealed and verified only when the funds are spent.
- This method is used for more complex transactions like multisig wallets, where multiple signatures are required to spend the funds.
- Why the Size?
- The scriptSig for P2SH is variable depending on the complexity of the script. For a simple multisig, it might be shorter than a P2PKH scriptSig, but for more complex scripts, it can be longer.
3. P2WPKH (Pay-to-Witness-Public-Key-Hash) UTXO
- Size: Approximately 68 vB
- Structure:
- P2WPKH is part of the Segregated Witness (SegWit) update, which was designed to reduce the size of transactions and improve scalability.
- The signature and public key information (the witness data) are separated from the main transaction structure.
- Why the Size?
- Since witness data is discounted in the calculation of virtual bytes, P2WPKH transactions are smaller in size. This makes them more efficient in terms of space usage on the blockchain.
4. P2WSH (Pay-to-Witness-Script-Hash) UTXO
- Size: Varies based on script complexity
- Structure:
- Similar to P2WPKH, P2WSH is a SegWit version of P2SH. The script conditions for spending the UTXOs are stored outside of the main transaction structure.
- Why the Size?
- The size varies greatly depending on the complexity of the script. Since the witness data is segregated and discounted, P2WSH can accommodate more complex scripts without excessively increasing the transaction size.
Transaction Size Comparison Table
UTXO Type | Number of Inputs | Number of Outputs | Average Size per UTXO (vB) | Total Transaction Size (vB) |
---|---|---|---|---|
P2PKH | 1 | 2 | 148 | 226 |
P2SH | 3 | 2 | 100 (Approx.) | 378 |
P2WPKH | 2 | 1 | 68 | 180 |
P2WSH | 1 | 2 | 120 (Approx.) | 198 |
Explanation:
-
P2PKH Scenario:
- Calculation: Transaction overhead (10 vB) + 1 input (148 vB) + 2 outputs (34 vB each) = 10 + 148 + 68 = 226 vB
-
P2SH Scenario:
- Calculation: Transaction overhead (10 vB) + 3 inputs (100 vB each, approx.) + 2 outputs (34 vB each) = 10 + 300 + 68 = 378 vB
-
P2WPKH Scenario:
- Calculation: Transaction overhead (10 vB) + 2 inputs (68 vB each) + 1 output (34 vB) = 10 + 136 + 34 = 180 vB
-
P2WSH Scenario:
- Calculation: Transaction overhead (10 vB) + 1 input (120 vB, approx.) + 2 outputs (34 vB each) = 10 + 120 + 68 = 198 vB
GENESIS