- Stumble across Bitcoin, heard about it's P2P aspect
- Initially thought fees are calculated in proportion to the payment amount
- Quickly learned about UTXOs, TX input + output etc
- Confused as to why some TXs have cheaper or more expensive TX fee even though they looked similar from quick glance
- Learned script types, tryna find out how each script type are weighted and found these 1, 2 tools
- Interested to know more & want to verify the information by myself
- Conduct my own investigation
- Results found, decided to share it on SN
- Am i cooking ?
Script Type | Other | |
---|
P2PK | Coinbase | Input-only (can't spend to Coinbase) |
P2PKH | OP_Return | Output-only (can't spend from OP_Return) |
P2MS | P2QRH | Still in the proposal-phase, add it anyway |
P2SH | P2A | Haven't learned much of it, add it anyway |
P2WPKH | Non-standard | |
P2WSH | | |
P2TR | | |
| Pre-SegWit | Post-SegWit |
---|
Overhead | nVersion | nVersion |
| Input Count | Input Count |
| Output Count | Output Count |
| nLocktime | nLocktime |
| | Mark & Flag |
Input Field | Outpoint | Outpoint |
| scriptSig Length | scriptSig Length |
| scriptSig | nSequence |
| nSequence | Witness Items |
Output Field | nValue | nValue |
| scriptPubkey length | scriptPubkey Length |
| scriptPubkey | scriptPubkey |
Block Size/Weight 1 | 1 Megabyte | 4 Million Weight Units |
| | 4 Mega Virtual Bytes |
| Overhead | Input VSize | Output VSize |
---|
Coinbase | | ≥ 48 ? | |
OP_Returm | | | ≥ 34 ? |
P2PK | 10 | 113 ~ 115 | 76 |
P2PK (Raw) | 10 | 114 | 44 |
P2PKH | 10 | 147 ~ 149 | 34 |
P2PKH | 10 | 179 ~ 181 | 34 |
P2MS 1-of-1 | 10 | 113 ~ 115 | 46 or 78 |
P2MS 1-of-1 | 10 | 148 ~ 154 | 46 |
P2MS 1-of-2 | 10 | 114 ~ 116 | 80 or 112 or 144 |
P2MS 2-of-2 | 10 | 187 ~ 189 | 80 or 144 |
P2MS 1-of-3 | 10 | 114 ~ 115 | 114 or 146 |
P2MS 2-of-3 | 10 | 186 ~ 189 | 114 or 210 |
P2MS 3-of-3 | 10 | 258 | 114 or 210 |
P2SH 1-of-1 | 10 | 79 or 153 | 32 |
P2SH 1-of-1 | 10 | 184 ~ 186 | 32 |
P2SH 1-of-2 | 10 | 186 ~ 188 | 32 |
P2SH 1-of-2 | 10 | 252 | 32 |
P2SH 2-of-2 | 10 | 260 ~ 261 | 32 |
P2SH 2-of-2 | 10 | 326 ~ 328 | 32 |
P2SH 2-of-3 | 10 | 293 ~ 298 | 32 |
P2SH 2-of-3 | 10 | 329 | 32 |
P2SH 2-of-4 | 10 | 331 | 32 |
P2SH 3-of-4 | 10 | 530 ~ 534 | 32 |
P2SH 2-of-5 | 10 | 364 | 32 |
P2SH 3-of-5 | 10 | 436 ~ 438 | 32 |
P2SH 8-of-9 | 10 | 936 ~ 939 | 32 |
P2SH-P2WPKH | 10.5 | 90.75 ~ 91 | 32 |
P2SH-P2WSH 1-of-1 | 10.5 | 104 | 32 |
P2SH-P2WSH 2-of-2 | 10.5 | 130.75 ~ 131 | 32 |
P2SH-P2WSH 2-of-3 | 10.5 | 139 ~ 139.25 | 32 |
P2WPKH | 10.5 | 67.5 ~ 68 | 31 |
P2WSH 1-of-1 | 10.5 | 69.25 | 43 |
P2WSH 2-of-2 | 10.5 | 95.75 ~ 96 | 43 |
P2WSH 2-of-3 | 10.5 | 104 ~ 104.5 | 43 |
P2WSH 3-of-5 | 10.5 | 139.25 ~ 139.75 | 43 |
P2WSH 11-of-15 | 10.5 | 397.25 ~ 398.75 | 43 |
P2TR | 10.5 | 57.5 ~ 57.75 | 43 |
Part | Size | Transactions Example |
---|
P2PK input | 113 | 1, 2, 3, 4 |
| 114 | 1, 2, 3 |
| 115 | 1, 2 |
Raw P2PK input | 114 | 1, 2 |
Raw P2PK output | 44 | 1, 2 |
P2PKH input | 147 | 1, 2, 3, 4 |
| 148 | 1 (2nd), 2 (except 1st), 3 (1st), 4 (all) |
| 149 | 1, 2, 3, 4 (1st) |
| 179 | 1, 2, 3 (2nd), 4 (2nd) |
| 180 | 1, 2, 3, 4 |
| 181 | 1, 2, 3 (all), 4 (1st) |
P2MS 1-of-1 input | 113 | 1 |
| 115 | 1 |
| 148 | 1 |
| 154 | 1 |
P2MS 1-of-1 output | 46 | 1, 2, 3, 4 |
| 78 | 1 |
P2MS 1-of-2 input | 114 | 1, 2, 3, 4 |
| 115 | 1, 2, 3, 4 |
| 116 | 1 |
P2MS 1-of-2 output | 80 | 1, 2, 3, 4 |
| 112 | 1, 2, 3 |
| 144 | 1 |
P2MS 2-of-2 input | 187 | 1, 2 (2nd) |
| 188 | 1, 2 (1st), 3 (2nd), 4 (2nd) |
| 189 | 1, 2, 3 (1st), 4 |
P2MS 2-of-2 output | 80 | 1, 2, 3 |
| 144 | 1, 2, 3, 4 |
P2MS 1-of-3 input | 114 | 1 (1st), 2 (2nd), 3 (2nd) |
| 115 | 1 (3rd), 2 (2nd) |
P2MS 1-of-3 output | 114 | 1, 2, 3 (3rd), 4 |
| 146 | 1, 2, 3, 4 |
P2MS 2-of-3 input | 186 | 1, 2 |
| 187 | 1, 2, 3, 4 |
| 188 | 1, 2, 3, 4 |
| 189 | 1 |
P2MS 2-of-3 output | 114 | 1, 2, 3 |
| 210 | 1, 2, 3, 4 |
P2MS 3-of-3 input | 258 | 1 |
P2MS 3-of-3 output | 114 | 1 |
| 210 | 1 |
P2SH 1-of-1 input | 79 | 1 |
| 153 | 1 |
| 184 | 1 |
| 185 | 1, 2 (all) |
| 186 | 1, 2 |
P2SH 1-of-2 input | 186 | 1, 2 |
| 187 | 1, 2 (3rd), 3, 4 |
| 188 | 1, 2 |
| 252 | 1 |
P2SH 2-of-2 input | 260 | 1, 2 |
| 261 | 1 |
| 326 | 1, 2 |
| 327 | 1, 2 |
| 328 | 1 |
P2SH 2-of-3 input | 293 | 1 (1st), 2 |
| 296 | 1, 2 (4th), 3 |
| 297 | 1 (all), 2 |
| 298 | 1 (5th), 2 |
| 329 | 1 |
P2SH 2-of-4 input | 331 | 1 |
P2SH 3-of-4 input | 530 | 1 (1st) |
| 531 | 1 (2nd), 2, 3 (1st) |
| 533 | 1 (2nd) |
| 534 | 1 (3rd) |
P2SH 2-of-5 input | 364 | 1 |
P2SH 3-of-5 inout | 436 | 1, 2 |
| 437 | 1, 2 |
| 438 | 1 |
P2SH 8-of-9 input | 936 | 1 (3rd) |
| 938 | 1, 2 (2nd) |
| 939 | 1 (1nd) |
P2SH-P2WPKH input | 90.75 | 1 (2nd), 2 |
| 91 | 1 (1st), 2, 3, 4 |
P2SH-P2WSH 1-of-1 input | 104 | 1 |
P2SH-P2WSH 2-of-2 input | 130.75 | 1, 2 |
| 131 | 1 (1st) |
P2SH-P2WSH 2-of-3 input | 139 | 1 |
| 139.25 | 1, 2, 3, 4 |
P2WPKH input | 67.75 | 1 (1st & 4th), 2, 3, 4 |
| 68 | 1, 2 (2nd & 3rd), 3, 4 |
P2WSH 1-of-1 input | 69.25 | 1 |
P2WSH 2-of-2 input | 95.75 | 1, 2, 3 (1st), 4 (1st) |
| 96 | 1 (2nd) |
P2WSH 2-of-3 input | 104 | 1, 2, 3, 4 |
| 104.25 | 1, 2 |
| 104.5 | 1 |
P2WSH 3-of-5 input | 139.25 | 1, 2 |
| 139.5 | 1 (all), 2 |
| 139.75 | 1 |
P2WSH 11-of-15 input | 397.25 | 1 (3rd) |
| 397.5 | 1, 2 |
| 397.75 | 1, 2 (2nd), 3, 4 |
| 398 | 1, 2, 3 (all), 4 |
| 398.25 | 1, 2, 3, 4 |
| 398.5 | 1 (1st), 2, 3, 4 |
| 398.75 | 1 |
P2TR input | 57.5 | 1, 2, 3, 4 |
| 57.75 | 1 (all), 2, 3, 4 |
Tools used :
Aight, i can't get any example of Pay-to-Anchor TX on mainnet yet. But who's gonna stop me from mentioning it ? Here are several examples of P2A TX on Testnet4 :
As output (receiver side) | As input (spender side) |
---|
1 | 1 |
2 | 2 |
Now, if the law of TX size calculation on Testnet4 is the same as Mainnet, then a P2A script would have 13 vb output size or 41 vb input size. CMIIW tho, i only sampled one address i found
here.
Historically, we've gotten a new address type every 4 years (P2SH 2012, SegWit 2017, Taproot 2021), but given the slow adaptation of P2TR and long process of development, we are not gonna get P2QRH next year. Read the documentation
here.