rust-bitcoin-unsafe-fast/src
Andrew Poelstra 0d5565e131
Merge rust-bitcoin/rust-bitcoin#839: feat: Add Address.is_related_to_*_key()
51fef76129 feat: Add Address.is_related_to_pubkey() (Andrew Ahlers)

Pull request description:

  ## Motivation

  This is addressing the second half of this comment: https://github.com/rust-bitcoin/rust-bitcoin/pull/684#issuecomment-1012136845

  > but would accept a PR (or two PRs) that returns Result<bool, UnsupportedAddress> and a method to check if a PublicKey is associated with an address.

  (The first half was addressed [here](https://github.com/rust-bitcoin/rust-bitcoin/pull/819))

  These changes will help build out and improve message signature verification. We don't necessarily need to add it to this crate but it allows for easy verification with something such as:
  1. recovering a pubkey
  2. checking if that pubkey relates to the given address

  ## Possible Improvements

  - There is likely a better name than `is_related_to_secp256k1_key()`
  - This could drop the `secp256k1` part of the name and take in a Pubkey enum that also supports Schnorr pubkeys and then this could be used for taproot addresses as well. This felt like a much larger change that will likely get turned down. Verifying taproot is simple enough and if absolutely desired, similar functions can be added for schnorr keys (tweaked and untweaked)

ACKs for top commit:
  Kixunil:
    ACK 51fef76129 for merging after TR
  apoelstra:
    ACK 51fef76129

Tree-SHA512: c9ab8c0f101fb4c647713e7f500656617025d8741676e8eb8a3132009dde9937d50cf9ac3d8055feb14452324a292397e46639cbaca71cac77af4b06dc42d09d
2022-03-28 17:29:48 +00:00
..
blockdata Remove deprecated method use for sighash conversion 2022-03-28 09:54:13 +02:00
consensus Use less vertical lines 2022-03-14 13:52:13 +11:00
network Use less vertical lines 2022-03-14 13:52:13 +11:00
util Merge rust-bitcoin/rust-bitcoin#839: feat: Add Address.is_related_to_*_key() 2022-03-28 17:29:48 +00:00
hash_types.rs Order impl_hashencode lines 2022-03-09 13:18:48 +11:00
internal_macros.rs Merge rust-bitcoin/rust-bitcoin#903: Improve `SchnorrSigHashType` 2022-03-24 08:02:27 +02:00
lib.rs Re-export public map types from root level 2022-01-18 12:56:47 +11:00
policy.rs Flatten the policy module 2022-03-09 10:20:18 +11:00
serde_utils.rs Refactor where statements 2022-03-14 13:52:13 +11:00
test_macros.rs Refactor whitespace 2022-03-14 13:51:50 +11:00