Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 2.85 KB

README.md

File metadata and controls

60 lines (40 loc) · 2.85 KB

coinbase OP_RETURN explorer

View this at: https://opreturn.live/

Overview

Bitcoin miners can sometimes include data within the coinbase transaction of a block by using an OP_RETURN transaction output.

The overall goal of this project is to decode and display OP_RETURN data so that anyone can understand what other entities are associated with a block being mined by a pool.

What are we decoding?

Take a look at an example coinbase transaction: https://mempool.space/tx/bbc74341be5a5b89ef876540453fd97acd6bab414612a37364b359ca9aa9e677

Look at the Inputs & Outputs section and notice that there are some outputs called OP_RETURN with a 0 BTC amount.

In this case, you see 3 OP_RETURN outputs:

  1. OP_RETURN !D&'u39 q#me r/
  2. OP_RETURN COREd$b-(N>,KT2+0
  3. OP_RETURN RSKBLOCK:K__mu-^Y\Bua

These look like a bunch of gibberish because it's typical in block explorers to convert the actual script (stored in hex) into ASCII to make it readable by humans. But each of these OP_RETURNs actually mean something and they typically follow a spec and they can be decoded into something that makes sense rather than ASCII text.

Here are the the decoded OP_RETURNs from the above transaction.

image

Notice that OP_RETURN #1 contains the merkle root of some transaction witness data. OP_RETURN #2 is for merged mining with coredao.org and we're able to decode the details and see which validator they are staking with as well as the rewards address. OP_RETURN #3 is for merged mining with rootstock.io and the data includes the associated "Merged Mining" hash, which can be cross-referenced in the https://explorer.rootstock.io/ block explorer.

Check out specific implementations details below to see how each of these are decoded.

Implementation Details

Core

Summary

If anyone can explain this, please open a PR with details.


Rootstock

Summary

If anyone can explain this, please open a PR with details.


HathorNetwork

Summary

If anyone can explain this, please open a PR with details.


Witness data

Summary

The merkle root for the witness data is in an OP_RETURN output.