From c4648bae6b2cdcb705c07984678876f1d604e3fe Mon Sep 17 00:00:00 2001 From: jasonandjay <342690199@qq.com> Date: Sun, 15 Feb 2026 09:58:44 +0800 Subject: [PATCH] fix: use correct leafVersion in control block byte for non-default version leaves The P2MR control block's first byte encodes both the leaf version and parity bit: controlBlock[0] = (leafVersion & 0xfe) | parityBit. For the leaf with leafVersion 250 (0xFA), the correct first byte is 0xFB (with parity bit 1), not 0xC1 (which corresponds to leafVersion 192). Fix p2mr_different_version_leaves scriptPathControlBlocks[1] first byte from c1 to fb. --- bip-0360/ref-impl/common/tests/data/p2mr_construction.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bip-0360/ref-impl/common/tests/data/p2mr_construction.json b/bip-0360/ref-impl/common/tests/data/p2mr_construction.json index f6d76d07ca..35bdf8bea6 100644 --- a/bip-0360/ref-impl/common/tests/data/p2mr_construction.json +++ b/bip-0360/ref-impl/common/tests/data/p2mr_construction.json @@ -87,7 +87,7 @@ "bip350Address": "bc1zdskuzp4ts94h87ws0c7drmev3sf9dagewj8qsylyahfyqhf800hsam4d6e", "scriptPathControlBlocks": [ "c1f224a923cd0021ab202ab139cc56802ddb92dcfc172b9212261a539df79a112a", - "c18ad69ec7cf41c2a4001fd1f738bf1e505ce2277acdcaa63fe4765192497f47a7" + "fb8ad69ec7cf41c2a4001fd1f738bf1e505ce2277acdcaa63fe4765192497f47a7" ] } },