pub enum BitcoinKey {
Fullkey(PublicKey),
XOnlyPublicKey(XOnlyPublicKey),
}
Expand description
This type is exported in elements-miniscript because it also captures information about the type of Extension. For rust-miniscript, this is not an issue because there are no extensions. Internally used enum for different types of bitcoin keys Even though we implement MiniscriptKey for BitcoinKey, we make sure that there are little mis-use
- The only constructors for this are only called in from_txdata that take care using the correct enum variant
- This does not implement ToPublicKey to avoid context dependant encoding/decoding of 33/32 byte keys. This allows us to keep a single NoChecks context instead of a context for for NoChecksSchnorr/NoChecksEcdsa.
Variants§
Trait Implementations§
Source§impl Clone for BitcoinKey
impl Clone for BitcoinKey
Source§fn clone(&self) -> BitcoinKey
fn clone(&self) -> BitcoinKey
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BitcoinKey
impl Debug for BitcoinKey
Source§impl Display for BitcoinKey
impl Display for BitcoinKey
Source§impl From<PublicKey> for BitcoinKey
impl From<PublicKey> for BitcoinKey
Source§impl From<XOnlyPublicKey> for BitcoinKey
impl From<XOnlyPublicKey> for BitcoinKey
Source§fn from(xpk: XOnlyPublicKey) -> Self
fn from(xpk: XOnlyPublicKey) -> Self
Converts to this type from the input type.
Source§impl Hash for BitcoinKey
impl Hash for BitcoinKey
Source§impl MiniscriptKey for BitcoinKey
impl MiniscriptKey for BitcoinKey
Source§type Sha256 = Hash
type Sha256 = Hash
The associated
bitcoin::hashes::sha256::Hash
for this MiniscriptKey
, used in the
sha256 fragment.Source§type Hash256 = Hash
type Hash256 = Hash
The associated
miniscript::hash256::Hash
for this MiniscriptKey
, used in the
hash256 fragment.Source§type Ripemd160 = Hash
type Ripemd160 = Hash
The associated
bitcoin::hashes::ripemd160::Hash
for this MiniscriptKey
type, used
in the ripemd160 fragment.Source§type Hash160 = Hash
type Hash160 = Hash
The associated
bitcoin::hashes::hash160::Hash
for this MiniscriptKey
type, used in
the hash160 fragment.Source§fn num_der_paths(&self) -> usize
fn num_der_paths(&self) -> usize
Returns the number of different derivation paths in this key. Only >1 for keys
in BIP389 multipath descriptors.
Source§fn is_uncompressed(&self) -> bool
fn is_uncompressed(&self) -> bool
Returns true if the pubkey is uncompressed. Defaults to
false
.Source§fn is_x_only_key(&self) -> bool
fn is_x_only_key(&self) -> bool
Returns true if the pubkey is an x-only pubkey. Defaults to
false
.Source§impl Ord for BitcoinKey
impl Ord for BitcoinKey
Source§fn cmp(&self, other: &BitcoinKey) -> Ordering
fn cmp(&self, other: &BitcoinKey) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BitcoinKey
impl PartialEq for BitcoinKey
Source§impl PartialOrd for BitcoinKey
impl PartialOrd for BitcoinKey
impl Copy for BitcoinKey
impl Eq for BitcoinKey
impl StructuralPartialEq for BitcoinKey
Auto Trait Implementations§
impl Freeze for BitcoinKey
impl RefUnwindSafe for BitcoinKey
impl Send for BitcoinKey
impl Sync for BitcoinKey
impl Unpin for BitcoinKey
impl UnwindSafe for BitcoinKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more