2

Do all transactions that are included in a valid block have to have at least one bitcoin address as part of their outputs (vout)?

I found this to be similar: Are Bitcoin transactions permitted to have no outputs (i.e. all inputs become transaction fee)? although not quite the same.

Doug Peters
  • 1,366
  • 14
  • 23

1 Answers1

3

No. A notable example of a pubkey script that doesn't typically include addresses or keys is the nulldata standard transaction type. Examples of pubkey scripts that include public keys but not addresses are pay-to-pubkey (P2PK)[1] and "bare" multisig.

Although I'm not absolutely sure, I believe its allowed to have an empty pubkey script. (That is, the compactSize uint that describes the size of the pubKey script is 0x00.)

Note: Bitcoin Core's getrawtransaction RPC, decodetransaction RPC, and other RPCs will display the public keys in P2PK, bare multisig, and redeem scripts as addresses---which can be a bit confusing.

[1] P2PK was formerly used for most coinbase transactions, but that usage has mostly disappeared on mainnet with pooled mining. It's still a standard transaction type and quite common for coinbase transactions on testnet.

David A. Harding
  • 11,626
  • 2
  • 44
  • 71
  • Great answer David, thanks! Do all transactions have to have at least one output amount (value)? – Doug Peters Dec 23 '14 at 18:55
  • 1
    You're welcome. All transactions must have at least one output. All outputs must have a value, but that value can be 0 satoshis. For example, in order to be standard, a nulldata standard transaction must have a value of 0. – David A. Harding Dec 23 '14 at 19:43
  • 1
    +1 for the additional note, been banging my head against the wall due to this for hours. – Priidu Neemre Jun 10 '15 at 10:35