1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-07-27 18:13:38 +00:00
Commit Graph

5 Commits

Author SHA1 Message Date
notmike
2706a6181d bip360: Optional type removed / no longer needed 2026-06-26 19:35:32 -06:00
conduition
1325ccc7db return type is not optional anymore 2026-06-27 01:15:28 +00:00
conduition
98c0289805 bip360: simplify computing control blocks using explicit traversal paths
This refactors `compute_control_block` to improve performance, and make
the function simpler to read (to me at least).

The previous version walked the entire script tree searching for the
first matching instance of the leaf node.

The new version expects the caller to pass in an explicit `path`
parameter, which tells us exactly where the leaf node lives, with
left/right steps encoded as bits in an integer. We walk down the
tree straight to that leaf node, and build the control block as we go.

This might not be the best DX for a real-world API or library, but this
is just reference code, so we can accept poor usage ergonomics if it makes
the code clearer and more explicit.
2026-06-27 01:11:26 +00:00
notmike
29e1a158e7 bip-0360: added python reference example; test vector fixes
This commit adds a python reference example for construction of BIP-360 outputs and control blocks.
This commit also updates the test vectors.
2026-06-26 13:20:03 -06:00
Hunter Beast
eae7d9fc57 BIP360: Pay to Merkle Root (P2MR) (#1670)
Review comments and assistance by:
  Armin Sabouri <armins88@gmail.com>
  D++ <82842780+dplusplus1024@users.noreply.github.com>
  Jameson Lopp <jameson.lopp@gmail.com>
  jbride <jbride2001@yahoo.com>
  Joey Yandle <xoloki@gmail.com>
  Jon Atack <jon@atack.com>
  Jonas Nick <jonasd.nick@gmail.com>
  Kyle Crews <kylecrews@Kyles-Mac-Studio.local>
  Mark "Murch" Erhardt <murch@murch.one>
  notmike-5 <notmike-5@users.noreply.github.com>
  Vojtěch Strnad <43024885+vostrnad@users.noreply.github.com>

Co-authored-by: Ethan Heilman <ethan.r.heilman@gmail.com>
Co-authored-by: Isabel Foxen Duke <110147802+Isabelfoxenduke@users.noreply.github.com>
2026-02-11 13:01:47 -08:00