Struct bdk_chain::bitcoin::key::TweakedKeypair
pub struct TweakedKeypair(/* private fields */);
Expand description
Tweaked BIP-340 key pair
§Examples
// There are various conversion methods available to get a tweaked pubkey from a tweaked keypair.
let (_pk, _parity) = keypair.public_parts();
let _pk = TweakedPublicKey::from_keypair(keypair);
let _pk = TweakedPublicKey::from(keypair);
Implementations§
§impl TweakedKeypair
impl TweakedKeypair
pub fn dangerous_assume_tweaked(pair: Keypair) -> TweakedKeypair
pub fn dangerous_assume_tweaked(pair: Keypair) -> TweakedKeypair
Creates a new TweakedKeypair
from a Keypair
. No tweak is applied, consider
calling tap_tweak
on an UntweakedKeypair
instead of using this constructor.
This method is dangerous and can lead to loss of funds if used incorrectly. Specifically, in multi-party protocols a peer can provide a value that allows them to steal.
pub fn public_parts(&self) -> (TweakedPublicKey, Parity)
pub fn public_parts(&self) -> (TweakedPublicKey, Parity)
Returns the TweakedPublicKey
and its Parity
for this TweakedKeypair
.
Trait Implementations§
§impl Clone for TweakedKeypair
impl Clone for TweakedKeypair
§fn clone(&self) -> TweakedKeypair
fn clone(&self) -> TweakedKeypair
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 more§impl Debug for TweakedKeypair
impl Debug for TweakedKeypair
§impl<'de> Deserialize<'de> for TweakedKeypair
impl<'de> Deserialize<'de> for TweakedKeypair
§fn deserialize<__D>(
__deserializer: __D
) -> Result<TweakedKeypair, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<TweakedKeypair, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<TweakedKeypair> for Keypair
impl From<TweakedKeypair> for Keypair
§fn from(pair: TweakedKeypair) -> Keypair
fn from(pair: TweakedKeypair) -> Keypair
Converts to this type from the input type.
§impl From<TweakedKeypair> for TweakedPublicKey
impl From<TweakedKeypair> for TweakedPublicKey
§fn from(pair: TweakedKeypair) -> TweakedPublicKey
fn from(pair: TweakedKeypair) -> TweakedPublicKey
Converts to this type from the input type.
§impl Hash for TweakedKeypair
impl Hash for TweakedKeypair
§impl Ord for TweakedKeypair
impl Ord for TweakedKeypair
§impl PartialEq for TweakedKeypair
impl PartialEq for TweakedKeypair
§fn eq(&self, other: &TweakedKeypair) -> bool
fn eq(&self, other: &TweakedKeypair) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for TweakedKeypair
impl PartialOrd for TweakedKeypair
§fn partial_cmp(&self, other: &TweakedKeypair) -> Option<Ordering>
fn partial_cmp(&self, other: &TweakedKeypair) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl Serialize for TweakedKeypair
impl Serialize for TweakedKeypair
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for TweakedKeypair
impl Eq for TweakedKeypair
impl StructuralPartialEq for TweakedKeypair
Auto Trait Implementations§
impl Freeze for TweakedKeypair
impl RefUnwindSafe for TweakedKeypair
impl Send for TweakedKeypair
impl Sync for TweakedKeypair
impl Unpin for TweakedKeypair
impl UnwindSafe for TweakedKeypair
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more