pub struct XOnlyPubKey { /* private fields */ }Expand description
Implementations§
Source§impl XOnlyPubKey
impl XOnlyPubKey
Sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
| Test whether this is the 0 key (the result | of default construction). This implies | !IsFullyValid(). |
pub fn data(&self) -> *const u8
pub fn size() -> usize
pub fn begin(&self) -> *const u8
pub fn end(&self) -> *const u8
pub fn begin_mut(&mut self) -> *mut u8
pub fn end_mut(&mut self) -> *mut u8
Sourcepub fn get_key_ids(&self) -> Vec<KeyID>
pub fn get_key_ids(&self) -> Vec<KeyID>
| Returns a list of CKeyIDs for the CPubKeys | that could have been used to create this | | XOnlyPubKey. | | This is needed for key lookups since | keys are indexed by CKeyID. |
Sourcepub fn is_fully_valid(&self) -> bool
pub fn is_fully_valid(&self) -> bool
| Determine if this pubkey is fully valid. | This is true for approximately 50% of | all possible 32-byte arrays. If false, | | VerifySchnorr and CreatePayToContract | will always fail. |
Sourcepub fn verify_schnorr(&self, msg: &u256, sigbytes: &[u8]) -> bool
pub fn verify_schnorr(&self, msg: &u256, sigbytes: &[u8]) -> bool
| Verify a Schnorr signature against | this public key. sigbytes must be exactly | 64 bytes. |
Sourcepub fn compute_tap_tweak_hash(&self, merkle_root: *const u256) -> u256
pub fn compute_tap_tweak_hash(&self, merkle_root: *const u256) -> u256
| Compute the Taproot tweak as specified | in BIP341, with *this as internal key: | | - if merkle_root == nullptr: H_TapTweak(xonly_pubkey) | | - otherwise: H_TapTweak(xonly_pubkey || *merkle_root) | | ———– | @note | | the behavior of this function with merkle_root | != nullptr is consensus critical. |
Sourcepub fn check_tap_tweak(
&self,
internal: &XOnlyPubKey,
merkle_root: &u256,
parity: bool,
) -> bool
pub fn check_tap_tweak( &self, internal: &XOnlyPubKey, merkle_root: &u256, parity: bool, ) -> bool
| Verify that this is a Taproot tweaked | output point, against a specified internal | key, | | Merkle root, and parity. |
Sourcepub fn create_tap_tweak(
&self,
merkle_root: *const u256,
) -> Option<(XOnlyPubKey, bool)>
pub fn create_tap_tweak( &self, merkle_root: *const u256, ) -> Option<(XOnlyPubKey, bool)>
| Construct a Taproot tweaked output | point with this point as internal key. |
Trait Implementations§
Source§impl Default for XOnlyPubKey
impl Default for XOnlyPubKey
Source§fn default() -> XOnlyPubKey
fn default() -> XOnlyPubKey
Source§impl From<&[u8]> for XOnlyPubKey
impl From<&[u8]> for XOnlyPubKey
Source§impl From<&PubKey> for XOnlyPubKey
impl From<&PubKey> for XOnlyPubKey
Source§impl Index<i32> for XOnlyPubKey
impl Index<i32> for XOnlyPubKey
Source§impl Ord for XOnlyPubKey
impl Ord for XOnlyPubKey
Source§fn cmp(&self, other: &XOnlyPubKey) -> Ordering
fn cmp(&self, other: &XOnlyPubKey) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for XOnlyPubKey
impl PartialEq for XOnlyPubKey
Source§impl PartialOrd for XOnlyPubKey
impl PartialOrd for XOnlyPubKey
impl Eq for XOnlyPubKey
Auto Trait Implementations§
impl Freeze for XOnlyPubKey
impl RefUnwindSafe for XOnlyPubKey
impl Send for XOnlyPubKey
impl Sync for XOnlyPubKey
impl Unpin for XOnlyPubKey
impl UnwindSafe for XOnlyPubKey
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.