DerivationPath (Class)¶
A BIP-32 derivation path for hierarchical key derivation.
Represents a path like "m/44'/111111'/0'/0/0" for deriving keys.
__new__
¶
__new__(path: str) -> DerivationPath
Create a derivation path from a string.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
A path string (e.g., "m/44'/111111'/0'").
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
DerivationPath
|
A new DerivationPath instance.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
Exception
|
If the path format is invalid. |
is_empty
¶
Check if the path is empty (no components).
| RETURNS | DESCRIPTION |
|---|---|
bool
|
True if empty.
TYPE:
|
length
¶
Get the number of path components.
| RETURNS | DESCRIPTION |
|---|---|
int
|
The path length.
TYPE:
|
parent
¶
parent() -> Optional[DerivationPath]
Get the parent path (one level up).
| RETURNS | DESCRIPTION |
|---|---|
Optional[DerivationPath]
|
DerivationPath | None: The parent path, or None if at root. |
push
¶
Append a child index to the path.
| PARAMETER | DESCRIPTION |
|---|---|
child_number
|
The child index.
TYPE:
|
hardened
|
Whether to use hardened derivation (default: False).
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
Exception
|
If the child number is invalid. |
to_string
¶
Convert to string representation.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The path as a string (e.g., "m/44'/111111'/0'").
TYPE:
|