aegis-keys · derivation
Declared module signatures, types, configuration, and source documentation.
Source: aegis/aegis-keys/src/derivation.rs. SHA-256: bf2ba0570408be6fdb11d6e4d93fdfc51255b5970f1a9c2911e6203cbe2bd2de.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
derivation::derive_lineage_key
Derive a lineage key from a parent private key using HKDF-SHA256.
This implements the OAS lineage key derivation scheme where child keys are deterministically derived from parent keys, enabling cryptographic proof of the lineage chain.
Algorithm
HKDF-SHA256(
IKM = parent_private_key (32 bytes),
Salt = child_did_utf8,
Info = "oas-lineage-v1" || generation_be32,
L = 32
)Arguments
parent_private- The parent entity's 32-byte Ed25519 private key material.child_did- The child entity's DID string, used as salt.generation- The lineage generation number (distance from human root).
Returns
32 bytes of derived key material suitable for constructing a child Ed25519 signing key.
Errors
Returns KeyError::DerivationFailed if HKDF expansion fails.
pub fn derive_lineage_key(
parent_private: &[u8; 32],
child_did: &str,
generation: u32,
) -> Result<[u8; 32], KeyError>;Source line: 43.
derivation::derivation_path
Build a BIP-44 derivation path for a given blockchain chain.
Returns the standard m/44'/coin_type'/account'/0/index path
used for HD key derivation across different blockchains.
Arguments
chain- The target blockchain (determines the coin type).account- The account index.index- The address index within the account.
Returns
A BIP-44 derivation path string like m/44'/60'/0'/0/0 for Ethereum.
pub fn derivation_path(chain: Chain, account: u32, index: u32) -> String;Source line: 82.