Skip to content

Add CMR to compiler JSON output#231

Open
0ceanSlim wants to merge 1 commit intoBlockstreamResearch:masterfrom
0ceanSlim:add-cmr-to-output
Open

Add CMR to compiler JSON output#231
0ceanSlim wants to merge 1 commit intoBlockstreamResearch:masterfrom
0ceanSlim:add-cmr-to-output

Conversation

@0ceanSlim
Copy link

The compiler currently outputs only the program binary (base64). Callers deploying programs on-chain also need the Commitment Merkle Root (CMR) to:

  • Derive the taproot address (P2TR scriptPubKey)
  • Build the control block for script-path spending

Without CMR in the output, callers must reimplement the entire commitment hash computation externally. Since the CMR is already computed internally during compilation, this patch exposes it by adding a cmr field (hex string) to
both the Output struct and the JSON output (--json flag). The human-readable display also prints it. The change is
non-breaking — existing callers that ignore unknown JSON fields are unaffected.

@0ceanSlim 0ceanSlim requested a review from delta1 as a code owner March 10, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant