Post
Topic
Board Development & Technical Discussion
Re: Types of Different Bitcoin Transaction and Their sizes
by
colatkinson
on 26/12/2017, 09:50:31 UTC
As at 2015/2016, there are five standard transactions which are accepted by the standard client which include Basic, P2SH or Pay-to-Script-Hash, Multisig, RETURN and Non-standard – although some miners will accept a non standard transaction for a price. The most popular type of transaction is the TX_PUBKEY, or Pay to Public Key Transaction (P2PKH) with over 89% of total transaction as at 2015.

The latest transaction type  as at 2017 is SegWit


Thanks. I found a link which says there are 6 types:
https://www.cryptocompare.com/coins/guides/what-are-the-bitcoin-transaction-types/

What is the difference between Pay to public key vs pay to address?

What is estimated size of each type? Here's what I found:

Basic (P2PKH) - assuming 1-2 inputs and two outputs - 438 bytes ( https://bitcointalk.org/index.php?topic=1782523.0 )
P2SH or Pay-to-Script-Hash - Same as P2PKH?
Multisig -  ??
RETURN - ??
Non-standard -  ??
Segwit - ??


By pay to address do you mean P2PKH?

P2PK (pay-to-public-key) is a legacy format that I believe is no longer considered standard. Essentially, the full public key is included in the transaction's output script. The script is thus of the form

Code:
OP_CHECKSIG

With P2PKH, only a hash of the public key is included in the output script. The script is of the form

Code:
OP_DUP OP_HASH160 OP_EQUALVERIFY OP_CHECKSIG

The hash is only 20 bytes, instead of the key's 32, saving some space. The spender includes the public key and signature, the same as with P2PK, but the sender has saved 9 bytes (20 bytes for the hash and 3 for the extra script ops vs 32 bytes for the full pubkey).

P2SH is a whole separate shebang. The output scripts for these are of the form

Code:
OP_HASH160 [20-byte-hash-value] OP_EQUAL

where the hash is that of the redeem script (the script specifying the conditions necessary to spend the funds).