ElementsProject / elements-miniscript

Creative Commons Zero v1.0 Universal
11 stars 14 forks source link

CT descriptor: remove generic from blinding key #59

Closed LeoComandini closed 10 months ago

LeoComandini commented 11 months ago

The generic was only used by the Bare variant, which was inconsistent with its corresponding "secret" variant, View.

The generic could be used to handle the conversion from ConfidentialDescriptor<DescriptorPublicKey> to Descriptor<DefiniteDescriptorKey>, specifically making sure that the descriptor blinding key does not have wildcards.

For the Bare variant this could be done, but this cannot happen for the View variant, since we don't have the definite version of DescriptorSecretKey.

The proposed solution consists in:

apoelstra commented 11 months ago

Yeah, this solution seems good to me. It's not great but nothing I could come up with was great either.

I'd like to fix CI though before moving forward on this.

LeoComandini commented 11 months ago

fix CI

Fixed by @RCasatta in #60 , I'll rebase on top of that once merged

LeoComandini commented 11 months ago

Proposed additional test vectors for ELIP-150 (will post there once this gets a round of review)

View Descriptor with wildcard: ct(xprv9s21ZrQH143K28NgQ7bHCF61hy9VzwquBZvpzTwXLsbmQLRJ6iV9k2hUBRt5qzmBaSpeMj5LdcsHaXJvM7iFEivPryRcL8irN7Na9p65UUb/*,elwpkh(xpub661MyMwAqRbcEcT9W98HZP2kFzyzQQZkYnrRnrM8uD8kH8kSeFoQHq1x2iihLgC6PXGy5LrjCL66uSNhJ8pwjfx2rMUTLWuRMns2EG9xnjs/*))#

Non-View Descriptor with wildcard: ct(xpub661MyMwAqRbcEcT9W98HZP2kFzyzQQZkYnrRnrM8uD8kH8kSeFoQHq1x2iihLgC6PXGy5LrjCL66uSNhJ8pwjfx2rMUTLWuRMns2EG9xnjs/*,elwpkh(xpub661MyMwAqRbcEcT9W98HZP2kFzyzQQZkYnrRnrM8uD8kH8kSeFoQHq1x2iihLgC6PXGy5LrjCL66uSNhJ8pwjfx2rMUTLWuRMns2EG9xnjs/*))#

LeoComandini commented 10 months ago

fix CI

Fixed by @RCasatta in #60 , I'll rebase on top of that once merged

@apoelstra rebased and CI is now green

apoelstra commented 10 months ago

Looks good to me. Obviously there are still some open API questions about doing derivations but the result of this is much better than the existing code.