Can you explain how op_return is used for thw witness committment?

npub1lw78wl9c4fryld489hvune6hgykx92alvnjzzrddxkycxk6ew5jsvramt7

https://learnmeabitcoin.com/technical/script/return/

Reply to this note

Please Login to reply.

Discussion

It's part of Segwit, and a bit complex

Segwit blocks can be more than 1MB, but the pre-segwit nodes (they still work) look at just the first 1MB and therefore the blockhash is the hash of just the first 1MB

Therefore, in order to have some hashing of the entire Segwit block, necessary to make sure we all agree on what is in the entire block, the hash of the remainder of the block has to be snuck into the first 1MB.

The way they chose to do this was by putting it into an OP_RETURN in the coinbase transaction. i.e. that has the hash of all the witness data of that block