Closed kdmukai closed 4 months ago
Did some testing on this. One issue I ran into is there does not appear to be a way to export a p2sh multisig xpub. At least I could not get it to work in Sparrow until I added:
elif origin.components[0].index == 45: # P2SH Multisig
ur_outputs.append(Output([SCRIPT_EXPRESSION_TAG_MAP[400]],self.ur_hdkey))
to src/seedsigner/models/encode_qr.py
on line 514.
The additions here LGTM. Tested with the only issue being xpub export. This can be added/corrected in a separate PR.
Description
Adds p2sh nonsegwit legacy multisig support.
The intention is to at least support bip45 (
m/45'
) p2sh multisig, which is the format used by Unchained. There may be some assumptions baked in here that might not fully support all arbitrary p2sh scripts.embit_utils
andpsbt_parser
to support p2sh.Additional tests:
test_embit_utils
test_psbt_parser
.Misc:
test_psbt_parser.py
was using tab indents which have now been changed to spaces in this PR (which is why the otherwise unaltered p2tr test shows up in this diff).To aid testing, here is the p2sh multisig descriptor used in the psbt_parser test:
The descriptor from the test can also be imported into Sparrow for more interactive testing / sanity checking:
-n regtest
Additional resources:
This pull request is categorized as a:
Checklist
pytest
and made sure all unit tests pass before sumbitting the PRIf you modified or added functionality/workflow, did you add new unit tests?
I have tested this PR on the following platforms/os: