pub struct TweakedPublicKey(/* private fields */);Expand description
Tweaked BIP-340 X-coord-only public key
Implementations§
Source§impl TweakedPublicKey
impl TweakedPublicKey
Sourcepub fn from_keypair(keypair: TweakedKeypair) -> TweakedPublicKey
pub fn from_keypair(keypair: TweakedKeypair) -> TweakedPublicKey
Returns the TweakedPublicKey for keypair.
Sourcepub fn dangerous_assume_tweaked(key: XOnlyPublicKey) -> TweakedPublicKey
pub fn dangerous_assume_tweaked(key: XOnlyPublicKey) -> TweakedPublicKey
Creates a new TweakedPublicKey from a XOnlyPublicKey. No tweak is applied, consider
calling tap_tweak on an UntweakedPublicKey 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.
Sourcepub fn to_x_only_public_key(self) -> XOnlyPublicKey
pub fn to_x_only_public_key(self) -> XOnlyPublicKey
Returns the underlying x-only public key.
Sourcepub fn as_x_only_public_key(&self) -> &XOnlyPublicKey
pub fn as_x_only_public_key(&self) -> &XOnlyPublicKey
Returns a reference to the underlying x-only public key.
Trait Implementations§
Source§impl Clone for TweakedPublicKey
impl Clone for TweakedPublicKey
Source§fn clone(&self) -> TweakedPublicKey
fn clone(&self) -> TweakedPublicKey
Returns a duplicate 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 TweakedPublicKey
impl Debug for TweakedPublicKey
Source§impl<'de> Deserialize<'de> for TweakedPublicKey
impl<'de> Deserialize<'de> for TweakedPublicKey
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TweakedPublicKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TweakedPublicKey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TweakedPublicKey
impl Display for TweakedPublicKey
Source§impl From<TweakedKeypair> for TweakedPublicKey
impl From<TweakedKeypair> for TweakedPublicKey
Source§fn from(pair: TweakedKeypair) -> TweakedPublicKey
fn from(pair: TweakedKeypair) -> TweakedPublicKey
Converts to this type from the input type.
Source§impl From<TweakedPublicKey> for XOnlyPublicKey
impl From<TweakedPublicKey> for XOnlyPublicKey
Source§fn from(pair: TweakedPublicKey) -> XOnlyPublicKey
fn from(pair: TweakedPublicKey) -> XOnlyPublicKey
Converts to this type from the input type.
Source§impl Hash for TweakedPublicKey
impl Hash for TweakedPublicKey
Source§impl LowerHex for TweakedPublicKey
impl LowerHex for TweakedPublicKey
Source§impl Ord for TweakedPublicKey
impl Ord for TweakedPublicKey
Source§fn cmp(&self, other: &TweakedPublicKey) -> Ordering
fn cmp(&self, other: &TweakedPublicKey) -> 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 TweakedPublicKey
impl PartialEq for TweakedPublicKey
Source§impl PartialOrd for TweakedPublicKey
impl PartialOrd for TweakedPublicKey
Source§impl Serialize for TweakedPublicKey
impl Serialize for TweakedPublicKey
Source§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 TweakedPublicKey
impl Eq for TweakedPublicKey
impl StructuralPartialEq for TweakedPublicKey
Auto Trait Implementations§
impl Freeze for TweakedPublicKey
impl RefUnwindSafe for TweakedPublicKey
impl Send for TweakedPublicKey
impl Sync for TweakedPublicKey
impl Unpin for TweakedPublicKey
impl UnwindSafe for TweakedPublicKey
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