Cip1852
CIP-1852 derivation paths for Cardano HD wallets.
CIP-1852 defines the hierarchical deterministic wallet structure for Cardano Shelley-era wallets. It follows the BIP-44 structure with Cardano-specific constants.
Path structure: m / purpose' / coin_type' / account' / role / index
- purpose: 1852' (Cardano Shelley-era)
- coin_type: 1815' (Cardano)
- account: 0', 1', 2', ... (hardened)
- role: 0 (external), 1 (internal/change), 2 (staking), 3 (DRep), 4 (CC cold), 5 (CC hot)
- index: 0, 1, 2, ... (non-hardened)
Attributes
- See also
-
https://cips.cardano.org/cip/CIP-0105 (Conway era key chains)
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Cip1852.type
Members list
Value members
Concrete methods
Build the derivation path for an account root key.
Build the derivation path for an account root key.
Path: m/1852'/1815'/account'
Value parameters
- account
-
the account index (0, 1, 2, ...)
Attributes
- Returns
-
the path string
Build the derivation path for a change (internal) key.
Build the derivation path for a change (internal) key.
Path: m/1852'/1815'/account'/1/index
Value parameters
- account
-
the account index
- index
-
the address index
Attributes
- Returns
-
the path string
Build the derivation path for a DRep (governance) key (CIP-105).
Build the derivation path for a DRep (governance) key (CIP-105).
Path: m/1852'/1815'/account'/3/index
Note: CIP-105 recommends using only index 0 for DRep keys.
Value parameters
- account
-
the account index
- index
-
the DRep key index (usually 0)
Attributes
- Returns
-
the path string
Parse an account-level path.
Parse an account-level path.
Value parameters
- pathStr
-
the path string (e.g., "m/1852'/1815'/0'")
Attributes
- Returns
-
Some(account) if valid account path, None otherwise
Parse a CIP-1852 path string into components.
Parse a CIP-1852 path string into components.
Value parameters
- pathStr
-
the path string (e.g., "m/1852'/1815'/0'/0/0")
Attributes
- Returns
-
Some((account, role, index)) if valid CIP-1852 path, None otherwise
Build a generic derivation path.
Build a generic derivation path.
Value parameters
- account
-
the account index
- index
-
the address/key index
- role
-
the key role (0=external, 1=internal, 2=staking, 3=drep, 4=cc-cold, 5=cc-hot)
Attributes
- Returns
-
the path string
Build the derivation path for a payment (external) key.
Build the derivation path for a payment (external) key.
Path: m/1852'/1815'/account'/0/index
Value parameters
- account
-
the account index
- index
-
the address index
Attributes
- Returns
-
the path string
Build the derivation path for a staking key.
Build the derivation path for a staking key.
Path: m/1852'/1815'/account'/2/index
Note: Typically index is 0 for the primary staking key.
Value parameters
- account
-
the account index
- index
-
the staking key index (usually 0)
Attributes
- Returns
-
the path string
Concrete fields
Coin type constant for Cardano (registered at SLIP-44).
Coin type constant for Cardano (registered at SLIP-44).
Attributes
Purpose constant for Cardano Shelley-era wallets.
Purpose constant for Cardano Shelley-era wallets.
Attributes
Role for Constitutional Committee cold keys (CIP-105).
Role for Constitutional Committee cold keys (CIP-105).
Attributes
Role for Constitutional Committee hot keys (CIP-105).
Role for Constitutional Committee hot keys (CIP-105).
Attributes
Role for DRep (governance) keys (CIP-105).
Role for DRep (governance) keys (CIP-105).
Attributes
Role for external (receiving) addresses.
Role for external (receiving) addresses.
Attributes
Role for internal (change) addresses.
Role for internal (change) addresses.
Attributes
Role for staking keys.
Role for staking keys.