pub enum KeyTreeNode {
Leaf([u8; 33]),
Internal(Vec<KeyTreeNode>),
}Expand description
A node in a MuSig2 key tree.
Variants§
Leaf([u8; 33])
A leaf node: a single public key (33 bytes compressed).
Internal(Vec<KeyTreeNode>)
An internal node: a MuSig2 aggregation of child nodes.
Implementations§
Source§impl KeyTreeNode
impl KeyTreeNode
Sourcepub fn effective_pubkey(&self) -> Result<[u8; 33], SignerError>
pub fn effective_pubkey(&self) -> Result<[u8; 33], SignerError>
Compute the effective public key for this node.
For a leaf, returns the key directly. For an internal node, recursively aggregates child keys using MuSig2.
Sourcepub fn key_agg_context(&self) -> Result<KeyAggContext, SignerError>
pub fn key_agg_context(&self) -> Result<KeyAggContext, SignerError>
Get the key aggregation context for this node (only valid for Internal nodes).
Sourcepub fn leaf_count(&self) -> usize
pub fn leaf_count(&self) -> usize
Count the total number of leaf keys in the tree.
Trait Implementations§
Source§impl Clone for KeyTreeNode
impl Clone for KeyTreeNode
Source§fn clone(&self) -> KeyTreeNode
fn clone(&self) -> KeyTreeNode
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 moreAuto Trait Implementations§
impl Freeze for KeyTreeNode
impl RefUnwindSafe for KeyTreeNode
impl Send for KeyTreeNode
impl Sync for KeyTreeNode
impl Unpin for KeyTreeNode
impl UnsafeUnpin for KeyTreeNode
impl UnwindSafe for KeyTreeNode
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