Skip to content

Conversation

@achow101
Copy link
Member

@achow101 achow101 commented Oct 4, 2019

Adds a sortedmulti() descriptor as mentioned in #17023 (comment).

sortedmulti() works in the same way as multi does but sorts the pubkeys in the resulting scripts in lexicographic order as described in BIP67. Note that this does not add support for BIP67 nor is BIP67 fully supported by this descriptor (which is why it is not named multi67()) as it does not require compressed pubkeys.

Tests from BIP67 were added and documentation was updated.

@fanquake fanquake requested a review from sipa October 4, 2019 19:50
@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 4, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #17023 (doc: warn that ranged multi() descriptors are not BIP67 compatible by Sjors)
  • #16889 (Add some general std::vector utility functions by sipa)
  • #16800 (Basic Miniscript support in output descriptors by sipa)
  • #15590 (Descriptor: add GetAddressType() and IsSegWit() by Sjors)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko maflcko changed the title Introduce sortedmulti descriptor descriptors: Introduce sortedmulti descriptor Oct 5, 2019
@Sjors
Copy link
Member

Sjors commented Oct 5, 2019

Concept ACK

@peter-conalgo does this match the BIP67 implementation in ColdCard? (assuming compressed public keys). E.g. https://github.com/Coldcard/firmware/blob/master/testing/test_multisig.py#L232-L255 and https://github.com/Coldcard/firmware/blob/master/shared/multisig.py#L412-L414

Copy link
Member

@Sjors Sjors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested with cryptoadvance/specter-desktop#8 that ColdCard simulator no longer complains about a change address that it complained about before.

Code review ACK d5a925b except for the functional test issue.

@Sjors
Copy link
Member

Sjors commented Oct 6, 2019

ACK a6dd441cb2d8325dd968897776e7f8389cda359c

Copy link
Contributor

@bitcoinhodler bitcoinhodler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 9214dd6f91, add release notes and call it a day.

@achow101
Copy link
Member Author

achow101 commented Oct 7, 2019

Added a release note.

@achow101 achow101 force-pushed the sortedmulti-desc branch 2 times, most recently from 8ece050 to 2638791 Compare October 8, 2019 04:03
@laanwj laanwj added the Feature label Oct 8, 2019
@instagibbs
Copy link
Member

utACK 2638791

@promag
Copy link
Contributor

promag commented Oct 8, 2019

ACK 2638791a4f25394dc241367c933a2d27ed981197, only changes are the suggestion in the test and added the release note.

@fanquake fanquake requested a review from Sjors October 8, 2019 14:04
Copy link
Member

@Sjors Sjors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-ACK 2638791a4f25394dc241367c933a2d27ed981197

@sipa
Copy link
Member

sipa commented Oct 8, 2019

ACK 2638791a4f25394dc241367c933a2d27ed981197. Agree on calling it sortedmulti as it's indeed more generic than bip67.

Copy link
Member

@Sjors Sjors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-ACK 4bb660b

@instagibbs
Copy link
Member

re-ACK 4bb660b

fanquake added a commit that referenced this pull request Oct 8, 2019
4bb660b Add release note (Andrew Chow)
ed96b29 Update descriptors.md to include sortedmulti (Andrew Chow)
80be78e Test sortedmulti descriptor using BIP 67 tests (Andrew Chow)
6f588fd Add sortedmulti descriptor and unit tests (Andrew Chow)

Pull request description:

  Adds a `sortedmulti()` descriptor as mentioned in #17023 (comment).

  `sortedmulti()` works in the same way as `multi` does but sorts the pubkeys in the resulting scripts in lexicographic order as described in [BIP67](https://github.com/bitcoin/bips/blob/master/bip-0067.mediawiki). Note that this does not add support for BIP67 nor is BIP67 fully supported by this descriptor (which is why it is not named `multi67()`) as it does not require compressed pubkeys.

  Tests from BIP67 were added and documentation was updated.

ACKs for top commit:
  instagibbs:
    re-ACK 4bb660b
  Sjors:
    re-ACK 4bb660b

Tree-SHA512: 93b21112a74ebe0bf316d8f3e0291f69fd975cf0a29332f9728e7b880cad312b8b14007e86adcd7899f117b9303cbcf4cb35f3bb2f2f648d1a446f83f75a70a5
@fanquake fanquake merged commit 4bb660b into bitcoin:master Oct 8, 2019
@Sjors Sjors mentioned this pull request Oct 29, 2019
2 tasks
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Nov 15, 2019
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Nov 15, 2019
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Oct 8, 2020
Summary:
4bb660be90a2811b53855bf1fd33a8dd9ba3db47 Add release note (Andrew Chow)
ed96b295d747738334459490c79b7360ab85aaf7 Update descriptors.md to include sortedmulti (Andrew Chow)
80be78ea75ac9833ee3db3d468ed09fc4fe6274c Test sortedmulti descriptor using BIP 67 tests (Andrew Chow)
6f588fd2276e5b713c6d36e3b01288484ddb59c0 Add sortedmulti descriptor and unit tests (Andrew Chow)

Pull request description:

  Adds a `sortedmulti()` descriptor as mentioned in bitcoin/bitcoin#17023 (comment).

  `sortedmulti()` works in the same way as `multi` does but sorts the pubkeys in the resulting scripts in lexicographic order as described in [BIP67](https://github.com/bitcoin/bips/blob/master/bip-0067.mediawiki). Note that this does not add support for BIP67 nor is BIP67 fully supported by this descriptor (which is why it is not named `multi67()`) as it does not require compressed pubkeys.

  Tests from BIP67 were added and documentation was updated.

ACKs for top commit:
  instagibbs:
    re-ACK bitcoin/bitcoin@4bb660b
  Sjors:
    re-ACK 4bb660be90a2811b53855bf1fd33a8dd9ba3db47

---

Depends on D7828

Backport of Core [[bitcoin/bitcoin#17056 | PR17056]]

Test Plan:
  ninja all check check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7832
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants