pub struct ExtendedSigningKey {
pub depth: u8,
pub child_index: ChildIndex,
pub signing_key: SigningKey,
pub chain_code: [u8; 32],
}Expand description
An Ed25519 signing key plus the chain code needed to derive its children.
signing_key holds the 32-byte seed form of the Ed25519 key (what
SigningKey::as_bytes returns), which is what did:key encoding and
Secret::generate_ed25519 consume — the reason SLIP-0010 fits this
workspace and BIP32-Ed25519 does not.
Fields§
§depth: u8Derivation depth: 0 for the master key.
child_index: ChildIndexThe index this key was derived under. Normal(0) for the master key,
which matches SLIP-0010 and the crate this replaces.
signing_key: SigningKeyThe Ed25519 signing key at this path.
chain_code: [u8; 32]The chain code, mixed into every child derivation.
Implementations§
Source§impl ExtendedSigningKey
impl ExtendedSigningKey
Sourcepub fn from_seed(seed: &[u8]) -> Result<Self, Slip10Error>
pub fn from_seed(seed: &[u8]) -> Result<Self, Slip10Error>
Derive the master key from a seed.
Errors if the seed is shorter than MIN_SEED_LEN.
Sourcepub fn derive<P: AsRef<[ChildIndex]>>(
&self,
path: &P,
) -> Result<Self, Slip10Error>
pub fn derive<P: AsRef<[ChildIndex]>>( &self, path: &P, ) -> Result<Self, Slip10Error>
Derive along a whole path. An empty path returns a clone of self.
Sourcepub fn derive_child(&self, index: ChildIndex) -> Result<Self, Slip10Error>
pub fn derive_child(&self, index: ChildIndex) -> Result<Self, Slip10Error>
Derive a single child.
Refuses non-hardened indexes — Ed25519 has no normal derivation.
Sourcepub fn verifying_key(&self) -> VerifyingKey
pub fn verifying_key(&self) -> VerifyingKey
The public key for this signing key.
Trait Implementations§
Source§impl Clone for ExtendedSigningKey
impl Clone for ExtendedSigningKey
Source§impl Debug for ExtendedSigningKey
Redacted on purpose: the crate this replaces derived Debug, which prints
the private key bytes. Anything that logged an ExtendedSigningKey — or a
struct containing one — leaked a key into the log.
impl Debug for ExtendedSigningKey
Redacted on purpose: the crate this replaces derived Debug, which prints
the private key bytes. Anything that logged an ExtendedSigningKey — or a
struct containing one — leaked a key into the log.