pub struct DerivedAccount { /* private fields */ }Expand description
A derived HD account — unified across all chains.
Holds the derivation path, a 32-byte private key, a chain-specific public key (33 B compressed / 65 B uncompressed secp256k1 or 32 B Ed25519 / x-only), and the on-chain address string. The private key is zeroized on drop.
Fields are private; use the accessor methods to read them. Hex-encoded
views (private_key_hex,
public_key_hex) are computed on demand.
Implementations§
Source§impl DerivedAccount
impl DerivedAccount
Sourcepub const fn new(
path: String,
private_key: Zeroizing<[u8; 32]>,
public_key: Vec<u8>,
address: String,
) -> Self
pub const fn new( path: String, private_key: Zeroizing<[u8; 32]>, public_key: Vec<u8>, address: String, ) -> Self
Construct a derived account from its raw components.
This is the single entry point; chain crates call it after completing their derivation pipeline.
Sourcepub const fn private_key_bytes(&self) -> &Zeroizing<[u8; 32]>
pub const fn private_key_bytes(&self) -> &Zeroizing<[u8; 32]>
Raw 32-byte private key (zeroized on drop).
Sourcepub fn private_key_hex(&self) -> Zeroizing<String>
pub fn private_key_hex(&self) -> Zeroizing<String>
Lowercase hex-encoded private key (64 chars, zeroized on drop).
Sourcepub fn public_key_bytes(&self) -> &[u8] ⓘ
pub fn public_key_bytes(&self) -> &[u8] ⓘ
Chain-specific public key bytes.
Length: 33 (compressed secp256k1), 65 (uncompressed secp256k1), or 32 (Ed25519 / BIP-340 x-only).
Sourcepub fn public_key_hex(&self) -> String
pub fn public_key_hex(&self) -> String
Lowercase hex-encoded public key.
Trait Implementations§
Source§impl Clone for DerivedAccount
impl Clone for DerivedAccount
Source§fn clone(&self) -> DerivedAccount
fn clone(&self) -> DerivedAccount
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more