Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle and test sortedmulti descriptors #488

Merged
merged 1 commit into from Mar 11, 2021

Conversation

achow101
Copy link
Member

Implements better handling of sortedmulti descriptors. This is an API breaking change as display_multisig_address is changed to take the underlying MultisigDescriptor directly instead of the parameters stored within it.

For BitBox02 and Coldcard, since they only use BIP 67, they now require sortedmulti descriptors only.

For Trezors, sortedmulti is now being handled correctly. If a sortedmulti is provided, then the keys will be sorted appropriately prior to being sent to the Trezor for handling.

Lastly, tests are added to test both multi and sortedmulti, as well as both hex pubkeys and xpubs.

Fixes #487

@achow101 achow101 added this to the 2.0.0 milestone Mar 10, 2021
@instagibbs
Copy link
Collaborator

typecheck fail

thanks for tackling this

@achow101
Copy link
Member Author

Fixed the type check error.

@instagibbs
Copy link
Collaborator

utACK 3fad663

moar tests 👍

@craigraw mind testing this to see if any more issues pop up?

@craigraw
Copy link

Confirmed sortedmulti is working on Trezor, Coldcard and Bitbox02 using hwi.py. Using multi works on Trezor, and fails on Coldcard and Bitbox02 with an appropriate error message.

Oddly enough I can't seem to get a fully working binary from this branch - when communicating with the BitBox02 (for example with enumerate) the binary from contrib/build_bin.sh returns

Traceback (most recent call last):
  File "hwi.py", line 7, in <module>
  File "hwilib/_cli.py", line 305, in main
  File "hwilib/_cli.py", line 269, in process_commands
  File "hwilib/_cli.py", line 62, in enumerate_handler
  File "hwilib/commands.py", line 112, in enumerate
  File "importlib/__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "PyInstaller/loader/pyimod03_importers.py", line 627, in exec_module
  File "hwilib/devices/bitbox02.py", line 63, in <module>
.....
ValueError: source code string cannot contain null bytes
[17741] Failed to execute script hwi

@achow101 achow101 merged commit 0ad25a7 into bitcoin-core:master Mar 11, 2021
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.

Use of sortedmulti in displayaddress descriptor produces inconsistent results
3 participants