Module derivation_path

Source
Expand description

§Key derivation path handling for Spark wallet

This module implements the key derivation scheme for the Spark wallet, following BIP43 conventions with a custom purpose identifier. The scheme is structured as:

  • Identity key: m/8797555’/account’/0’
  • Base signing key: m/8797555’/account’/1’
  • Temporary signing key: m/8797555’/account’/2’

For leaf keys, an additional index is derived from the leaf ID:

  • Leaf key: m/8797555’/account’/1’/hash(leaf_id)’

The purpose value 8797555 is derived as the last 3 bytes of sha256(“spark”) in decimal (863d73).

All indices use hardened derivation (denoted by the apostrophe) for enhanced security. Account indices should start from 0.

§Security and Compatibility

This derivation path scheme is critical for compatibility with other Spark wallets. All Spark wallets must follow this exact scheme to ensure interoperability and proper handling of funds within the Spark ecosystem.

§WARNING

Implementing this trait with non-standard derivation paths will make your wallet incompatible with the Spark ecosystem. Only implement this trait if you fully understand the consequences and are intentionally creating a non-standard wallet.

Structs§

SparkDerivationPath
Represents a BIP32 derivation path for wallet keys.

Enums§

SparkKeyType
Key types for Spark wallet.

Traits§

SparkSignerDerivationPath
Trait for key derivation operations in the Spark wallet.