Skip to content

jet: populate Bitcoin CMR table - #386

Draft
delta1 wants to merge 1 commit into
BlockstreamResearch:masterfrom
delta1:pr/bitcoin-cmr-cost-tables
Draft

delta1 wants to merge 1 commit into
BlockstreamResearch:masterfrom
delta1:pr/bitcoin-cmr-cost-tables

Conversation

@delta1

@delta1 delta1 commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Depends on #385 (Bitcoin transaction environment).

Replaces the unimplemented!() stub in Bitcoin::cmr() with the full
match table of 32-byte Commitment Merkle Root (CMR) values, one entry
per jet in the Bitcoin jet set. Each value is taken directly from the
canonical primitiveJetNode.inc in libsimplicity, so the table is a
transcription, not a derivation -- no new CMR computation logic is
introduced here.

Bitcoin::cost() remains a stub; the cost table and the CMR/cost
self-check tests (which assert this table against
primitiveJetNode.inc in code) land in the next PR in the stack.

@ivanlele

ivanlele commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Was this updated with ./update_jets.sh?

@apoelstra

Copy link
Copy Markdown
Collaborator

I cannot accept this unless it was generated with ./update_jets.sh.

@delta1

delta1 commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Understood will fix after #385

@apoelstra

Copy link
Copy Markdown
Collaborator

85cf694 needs rebase

apoelstra added a commit that referenced this pull request Oct 23, 2026
579d1f9 bitcoin: extract annex per BIP341 instead of Witness::taproot_annex (Byron Hambly)
9aa64bb jet: populate annexes in Bitcoin environment (Andrew Poelstra)
61593d5 jet: implement Rust bitcoin environment (Andrew Poelstra)
738f01c jet: drop unnecessary Arcs in environments (Andrew Poelstra)
09220af jet: generalize JetEnvironment impls to use Borrow<T> (Byron Hambly)
b5e0cbe simplicity-sys: update libsimplicity to 3f0bb69c (Byron Hambly)
f48c90a jet: switch from Deref to Borrow for transaction environments (Andrew Poelstra)
40838c1 simplicity-sys: define bitcoin transaction environment (Andrew Poelstra)
46528e5 simplicity-sys: split env.c into bitcoin_env.c (Byron Hambly)

Pull request description:

  Redux of  #331. 
  
  Covers the same ground: vendoring the bitcoin-env libsimplicity branch and adding the Rust `BitcoinEnv`/`JetEnvironment` plumbing.
  
  Why a new branch instead of updating #331:
  
  - Vendored libsimplicity rev differs: this PR pins `ba967b1a` (the rev shipped with simplicity-lang 0.9.0, already on `master`); 
  - Symbol version differs as a direct consequence: this PR's C/FFI layer targets `rustsimplicity_0_8_*`.
  - `CoreEnv::EMPTY` (added in `b0a25c2`) is not needed or referenced by this series and is intentionally omitted.
  
  Three additional PRs stack on this one: #386 #387 #388


ACKs for top commit:
  stringhandler:
    ACK 579d1f9
  apoelstra:
    ACK 579d1f9; successfully ran local tests


Tree-SHA512: b5618d0cbc85d989da0e6423fcc36dce6bfe7379f6519acdf6bc54759cbc967e434e52e03de20041c56753880c30fbbcfa6847ed7f00183a4045dc96732767e3
Replace the unimplemented!() stub in Bitcoin::cmr() with a match table
of 32-byte CMR values. Each entry is derived from the canonical
primitiveJetNode.inc in libsimplicity. The table covers all jets in the
Bitcoin jet set.

The cost() method remains a stub pending a separate commit.
@delta1
delta1 force-pushed the pr/bitcoin-cmr-cost-tables branch from 85cf694 to 02d0390 Compare October 26, 2026 14:29
@delta1

delta1 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased

@delta1
delta1 marked this pull request as draft October 26, 2026 14:38
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.

3 participants