Skip to content

Taproot keys implementation strategy #588

@dr-orlovsky

Description

@dr-orlovsky

After #561 (comment) and #561 (comment)

  1. Leave bitcoin::PublicKey as is, probably adding bitcoin::util::ecdsa::PublicKey alias to it (the same for private keys).
  2. Re-export Taproot keys under bitcoin::util::schnorr
  3. Change ExtendedP(ub/priv)Key to hold secp256k1::Key rather than bitcoin equivalents. It is a necessary change anyway, since BIP32 does not support uncompressed keys and using type with compression flag is a mistake
  4. Introduce to Extended*key* functions to_ecdsa (returning always compressed ECDSA key) and to_shchnorr.
    ... and that's all for the first non-API breaking release.

Next, more invasive change will be:

  1. Remove bitcoin::PublicKey type
  2. Create UncompressedKey types (for legacy purposes) and
  3. Introduce PublicKey enum with just Compressed and Taproot variants (such that it can be used in SegWit miniscript/descriptor context without the need for errors/panics).

The first phase is implemented with the following PRs:

Metadata

Metadata

Labels

API breakThis PR requires a version bump for the next releaseminor API ChangeThis PR should get a minor version bump

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions