user138274: I've been working on a bitcoin miner that uses BIP-0034 (block v2).
I'm confused about the coinbase transaction of block v2. Does block v2 only accept P2PKH type of address to allow me to receive a reward for solving a block? Because the first block v2 uses P2PKH address on the coinbase tx.
So my question is can I use other types of address for coinbase transaction inside block v2 or I can only use the P2PKH address?

user5406: No, there is no restriction. Any transaction (including coinbase transactions) can create any output type. The block reward can be spent to P2PK, P2PKH, P2SH, P2SH-P2WPKH, P2SH-P2WSH, P2WPKH, P2WSH, P2TR, or even a bare script regardless of the version of the block.

138274: <p>I've been working on a bitcoin miner that uses BIP-0034 (block v2).</p>
<p>I'm confused about the coinbase transaction of block v2. Does block v2 only accept P2PKH type of address to allow me to receive a reward for solving a block? Because the <a href="https://www.blockchain.com/explorer/blocks/btc/227836" rel="nofollow noreferrer">first block v2</a> uses P2PKH address on the coinbase tx.</p>
<p>So my question is can I use other types of address for coinbase transaction inside block v2 or I can only use the P2PKH address?</p>
 5406: <p>No, there is no restriction. Any transaction (including coinbase transactions) can create any output type. The block reward can be spent to P2PK, P2PKH, P2SH, P2SH-P2WPKH, P2SH-P2WSH, P2WPKH, P2WSH, P2TR, or even a bare script regardless of the version of the block.</p>
