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

Use algorithm for ECDH that is described in the specification #724

Closed
wants to merge 1 commit into from

Conversation

jakubtrnka
Copy link
Contributor

suggestion for issue #723

@Sjors
Copy link
Collaborator

Sjors commented Jan 22, 2024

Doing this on the Bitcoin Core side requires accessing lower level libsecp functions, which might raise some review eyebrows.

@Sjors
Copy link
Collaborator

Sjors commented Jan 22, 2024

I would have to use CKey::UnhashedECDH that's introduced in bitcoin/bitcoin#28122 for Silent Payments. That will probably slow down review by a lot.

@Fi3
Copy link
Collaborator

Fi3 commented Jan 22, 2024

Do you think that could make sense/is possible. To modify the spec in order to avoid it?

@Sjors
Copy link
Collaborator

Sjors commented Jan 22, 2024

@Fi3 using EllSwift avoids this problem. Bitcoin Core has a nice high-level method for it, already used for BIP324 encryption.

Option 2 from stratum-mining/sv2-spec#65 avoids the problem as well, but it still requires something new to be merged into libsecp. So it's slower.

@Fi3
Copy link
Collaborator

Fi3 commented Jan 22, 2024

Ok so we can wait the decision on EllSwift. If we go with it this PR get closed otherwise we merge it

@jakubtrnka
Copy link
Contributor Author

Generally I disagree that the specification should be modified according to the needs of a specific codebase (speaking of the bitcoin-core that @Sjors mentioned).
The concept suggested in this PR is either right or wrong:

  1. If it is right, it should be adopted because this was the core idea that makes the use of XOnlyPublicKey consistent.
  2. If it is wrong, I'd like to hear and understand why.

But let's wait for the Ellswift discussions

@Sjors
Copy link
Collaborator

Sjors commented Jan 22, 2024

I disagree that the specification should be modified according to the needs of a specific codebase

That's true, but I think there is a good reason Bitcoin Core is (probably) reluctant to add this approach. It's a non-standard way of using a cryptographic function.

@lorbax
Copy link
Collaborator

lorbax commented Jan 26, 2024

According to what we've discussed in the last call
this solution won't be adopted. The solution with more consensus was ElligatorSwift and its ecdh procedure in libsecp256k1 and changing the specs accordingly.
See also these notes some background

@Fi3 Fi3 closed this Jan 26, 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.

4 participants