Merge bitcoin/bitcoin#32305: test: add test for decoding PSBT with MuSig2 PSBT key types (BIP 373)
4b24186756test: add test for decoding PSBT with MuSig2 PSBT key types (BIP 373) (Sebastian Falbesoner)8ba245cb83test: add constants for MuSig2 PSBT key types (BIP 373) (Sebastian Falbesoner) Pull request description: This PR is a follow-up to #31247 (see https://github.com/bitcoin/bitcoin/pull/31247#pullrequestreview-2427834909) and adds a functional test for decoding PSBTs (using the `decodepsbt` RPC) with MuSig2 per-input and per-output types. The first commit adds the new MuSig2 key types to the test frameworks and extends the PSBT serialization to cope with lists of bytestrings. ACKs for top commit: achow101: ACK4b24186756rkrux: re-ACK4b24186Tree-SHA512: f12919f71b3fff74df1d7ddaa8db455b1b139f7abd51d7f3fa5d750fc7dd613454b438c4e0dedad679476d414fa1da43ef1121e486b0bdfd97d5ef8bdf37f060
This commit is contained in:
2 files changed
+82
No files matched your search
@@ -50,6 +50,9 @@ PSBT_IN_TAP_LEAF_SCRIPT = 0x15
|
||||
PSBT_IN_TAP_BIP32_DERIVATION = 0x16
|
||||
PSBT_IN_TAP_INTERNAL_KEY = 0x17
|
||||
PSBT_IN_TAP_MERKLE_ROOT = 0x18
|
||||
PSBT_IN_MUSIG2_PARTICIPANT_PUBKEYS = 0x1a
|
||||
PSBT_IN_MUSIG2_PUB_NONCE = 0x1b
|
||||
PSBT_IN_MUSIG2_PARTIAL_SIG = 0x1c
|
||||
PSBT_IN_PROPRIETARY = 0xfc
|
||||
|
||||
# per-output types
|
||||
@@ -61,6 +64,7 @@ PSBT_OUT_SCRIPT = 0x04
|
||||
PSBT_OUT_TAP_INTERNAL_KEY = 0x05
|
||||
PSBT_OUT_TAP_TREE = 0x06
|
||||
PSBT_OUT_TAP_BIP32_DERIVATION = 0x07
|
||||
PSBT_OUT_MUSIG2_PARTICIPANT_PUBKEYS = 0x08
|
||||
PSBT_OUT_PROPRIETARY = 0xfc
|
||||
|
||||
|
||||
@@ -88,6 +92,9 @@ class PSBTMap:
|
||||
for k,v in self.map.items():
|
||||
if isinstance(k, int) and 0 <= k and k <= 255:
|
||||
k = bytes([k])
|
||||
if isinstance(v, list):
|
||||
assert all(type(elem) is bytes for elem in v)
|
||||
v = b"".join(v) # simply concatenate the byte-strings w/o size prefixes
|
||||
m += ser_compact_size(len(k)) + k
|
||||
m += ser_compact_size(len(v)) + v
|
||||
m += b"\x00"
|
||||
|
||||
Reference in new issue
Block a user