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

PSBT BIP32 keys using to Secp256k1 keys instead of bitcoin ECDSA #591

Merged
merged 1 commit into from Jan 11, 2022
Merged

PSBT BIP32 keys using to Secp256k1 keys instead of bitcoin ECDSA #591

merged 1 commit into from Jan 11, 2022

Conversation

dr-orlovsky
Copy link
Collaborator

@dr-orlovsky dr-orlovsky commented Apr 12, 2021

Fourth step in implementation of Schnorr key support after #588. This PR is a follow-up to non-API breaking #589 and API-breaking #590, which must be reviewed and merged first. (The current PR includes all commits from #589 and #590, which should be reviewed there. The only commit specific to this PR is b8105e9)

UPDATE: All related PRs are merged now and this PR is ready for the review

PR description:
While PSBT BIP174 does not specify whether uncompressed keys are supported in BIP32-related fields, from BIP32 it follows that it is impossible to use uncompressed keys within the extended keys. This PR fixes this situation and is a companion to BIP174 PR clarifying key serialization: bitcoin/bips#1100

@dr-orlovsky dr-orlovsky added the API break This PR requires a version bump for the next release label Apr 12, 2021
@dr-orlovsky dr-orlovsky added this to the 0.27.0 milestone Apr 12, 2021
@dr-orlovsky dr-orlovsky added this to Ready for Review in Taproot Apr 12, 2021
@dr-orlovsky dr-orlovsky changed the title PSBT BIP32 keys moved to Secp256k1 from bitcoin ECDSA PSBT BIP32 keys using to Secp256k1 keys instead of bitcoin ECDSA Apr 12, 2021
@dr-orlovsky dr-orlovsky mentioned this pull request May 14, 2021
20 tasks
@dr-orlovsky
Copy link
Collaborator Author

Rebased. Should be reviewed after #590

@sanket1729
Copy link
Member

Concept ACK for this. But the interesting part is how do we deal with partial_sigs part. Since, we would have sigs for schnorr::PublicKey and ecdsa::PublicKey

@dr-orlovsky
Copy link
Collaborator Author

@sanket1729 the goal of this PR is not to add Taproot support to PSBT, but just make existing PSBT more logical. For Taproot support we clearly need a new PR adding new key types according to the latest changes. So, current signatures for already defined keys should remain to be ECDSA signatures

@sanket1729
Copy link
Member

Sorry, I should read the description/code 🤦 . Will review after the other related PRs

@GeneFerneau
Copy link

utACK b8105e9

Fourth step in implementation of Schnorr key support after #588.

While PSBT BIP174 does not specify whether uncompressed keys are supported in BIP32-related fields, from BIP32 it follows that it is impossible to use uncompressed keys within the extended keys.  This PR fixes this situation and is a companion to BIP174 PR clarifying key serialization: bitcoin/bips#1100
@dr-orlovsky dr-orlovsky requested review from Kixunil and sanket1729 and removed request for Kixunil January 10, 2022 09:18
@dr-orlovsky
Copy link
Collaborator Author

Re-based after #590 merge, ready for review

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 a6e8f58

I kinda feel that we should PR to the Bitcoin BIPs repo to suggest this, but it's almost obvious (since BIP32 does not support uncompressed keys) so it's probably fine.

@dr-orlovsky
Copy link
Collaborator Author

@apoelstra did BIP PR last April, but it has stuck: bitcoin/bips#1100

Copy link
Member

@sanket1729 sanket1729 left a comment

Choose a reason for hiding this comment

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

ACK a6e8f58. Not sure which order to merge since there are many ready PRs which that would break each other.

Taproot automation moved this from Ready for Review to Ready for merge Jan 11, 2022
@dr-orlovsky
Copy link
Collaborator Author

Can we pls merge this in front of other approved PRs?

@sanket1729 sanket1729 merged commit e4d5039 into rust-bitcoin:master Jan 11, 2022
Taproot automation moved this from Ready for merge to Done Jan 11, 2022
sanket1729 added a commit to sanket1729/rust-bitcoin that referenced this pull request Feb 17, 2022
This changes the type of secp signature from secp256k1::Signature to
bitcoin::PublicKey. Psbt allows storing signatures for both compressed
as well as uncompressed keys. This bug was introduced in rust-bitcoin#591 while
trying to change the type of BIP32 keys from bitcoin::PublicKey to
secp256k1::PublicKey.
apoelstra added a commit that referenced this pull request Feb 17, 2022
…coin key

4e19973 Add a breaking test (sanket1729)
69c6eb6 Bug: Change type of pbst partial sig from secp key to bitcoin key (sanket1729)

Pull request description:

  This changes the type of secp signature from secp256k1::PublicKey to
  bitcoin::PublicKey. Psbt allows storing signatures for both compressed
  as well as uncompressed keys. This bug was introduced in #591 while
  trying to change the type of BIP32 keys from bitcoin::PublicKey to
  secp256k1::PublicKey.

ACKs for top commit:
  Kixunil:
    ACK 4e19973
  apoelstra:
    ACK 4e19973

Tree-SHA512: 2a326bafc050cd101e75899c32224a9ac2fcb2ec0b9f7f173404a46f2b3a92ecb78d0002db252a5af06705566bdc10102d20f4718eaeeebd3730fdb5ee89ff5a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API break This PR requires a version bump for the next release
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants