Skip to content

Conversation

@LeoComandini
Copy link
Contributor

@LeoComandini LeoComandini commented Dec 22, 2023

In ELIP150, descriptor blinding keys cannot be x-only pubkeys. Thus if we have a 64 hex char descriptor blinding key, we need to interpret is as a single view descriptor blinding key.

@apoelstra
Copy link
Member

Compressed public keys are allowed, but these are 66 bytes, not 64.

You mean to say that x-only pubkeys, which are 64 bytes, are disallowed.

You also need to change your test vectors.

In ELIP150, descriptor blinding keys cannot be x-only pubkeys.
Thus if we have a 64 hex char descriptor blinding key, we need to
interpret is as a single view descriptor blinding key.
@LeoComandini LeoComandini force-pushed the 2023-12-elip150-compressed-pubkey branch from 5bd5a3d to e6d6028 Compare December 22, 2023 15:23
@LeoComandini LeoComandini changed the title elip150: handle compressed pubkeys elip150: handle x-only pubkeys Dec 22, 2023
@LeoComandini
Copy link
Contributor Author

LeoComandini commented Dec 22, 2023

You mean to say that x-only pubkeys

yes, my bad, replaced "compressed" with "x-only"

You also need to change your test vectors.

removed a forgotten println!, or did you mean something else?

@RCasatta
Copy link
Collaborator

RCasatta commented Jan 2, 2024

utACK e6d6028

@apoelstra
Copy link
Member

removed a forgotten println!, or did you mean something else?

You are testing 66-char hex strings, but these are uninteresting because they're unambiguously compressed pubkeys. You mean to test 64-char hex strings, which could be parsed as x-only keys but shouldn't be.

@LeoComandini
Copy link
Contributor Author

@apoelstra

You are testing 66-char hex strings, but these are uninteresting because they're unambiguously compressed pubkeys. You mean to test 64-char hex strings, which could be parsed as x-only keys but shouldn't be.

I still don't get it,
in view_xonly_pubkey_descriptor I'm testing
ct(ab16855a17319477d4283fe5c29cc7d047f81e8ffb199e20d9be1bc31a751c4c,elwpkh(021a8fb6bd5a653b021b98a2a785725b8ddacfe3687bc043aa7f4d25d3a48d40b5))#n9uc7tzt
which now parses a CT descriptor with a view key,
but before this commit was parsing as a CT descriptor with a bare key.
Since ab16855a17319477d4283fe5c29cc7d047f81e8ffb199e20d9be1bc31a751c4c (64 chars) parses both as a x-only public key and as a descriptor private blinding key.

@apoelstra
Copy link
Member

Oh! You're right, I misread your test. You are using the 33-byte key pk but not as the view key.

Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK e6d6028

@apoelstra apoelstra merged commit 353005c into ElementsProject:master Jan 2, 2024
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.

3 participants