Commit 897e3f8
committed
Merge #231: Add CMR to compiler JSON output
5c63de2 Add CMR to compiler output (0ceanslim)
Pull request description:
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.
ACKs for top commit:
apoelstra:
ACK 5c63de2; successfully ran local tests
Tree-SHA512: f04ae3a9baeafc4b37941dc5979ab2d73456009158a933789c893331a8f7f724d7153381488f378372ae9012046da07fdafa0be85abb7ea6f758746fef8c19a51 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
162 | 166 | | |
| 167 | + | |
163 | 168 | | |
164 | 169 | | |
165 | 170 | | |
| |||
0 commit comments