1
The example is in here: https://www.blockchain.com/btc/tx/63910fdfa84db96bd1f28fead4c32f97388d5368c10059d035aac3c5f72fcdc0
Actually, there are two outputs DUP HASH160 PUSHDATA(20)[78ce48f88c94df3762da89dc8498205373a8ce6f] EQUALVERIFY CHECKSIG and RETURN PUSHDATA(36)[aa21a9ed9463ee420b10cbad1d997bfa132a89dc9ba3de04e7233e6e6954f1bc339ebb1a]
The strange point is the first output has 12.77303443 BTC, the second is 0 BTC.
There are two questions about this transaction.
1) How the coinbase could have more than 12.5 BTC?
2) What is the purpose of the RETURN PUSHDATA(36)(...), actually, in theory, this output can never be consumed by anyone, becuase there is no OP_CHECKSIG or similar OP at the end to return true in the Script stack.
It's technically not free, though because the fee is based on satoshi/kB and the extra data adds some to the size of the tx. – JBaczuk – 2018-09-11T13:45:03.813
@JBaczuk It's a coinbase tx. – MCCCS – 2018-09-11T13:47:07.157
you're right, but it's only free for coinbase not any tx with OP_RETURN – JBaczuk – 2018-09-11T13:48:45.437
@JBaczuk embed data for what, fun or get the right hash of the block(that should be in the coinbase input)? Will UXTO pool hold this output in memory? – Carpemer – 2018-09-11T14:11:56.587
@Capemer It will not store unspendable outputs, there is a check that immediately prunes UTXO that start with
– JBaczuk – 2018-09-11T14:17:17.753OP_RETURN: https://github.com/bitcoin/bitcoin/commit/ec84e81e8383b3b1e1ef4a6dbcb088193d8de5d7@JBaczuk, then what is the purpose of this? – Carpemer – 2018-09-11T14:20:15.293
People abuse it to store any data they want stored "permanently". – JBaczuk – 2018-09-11T14:23:01.063
1
In this case, that output is part of segwit. It is for the witness data commitment. See BIP 141: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#Commitment_structure. The reason OP_RETURN is used is so that the UTXO will not be added to the UTXO set as it is provably unspendable.
– Andrew Chow – 2018-09-11T20:23:38.530