HdWallet class

BIP-0044 Multi-Account Hierarchy for Deterministic Wallets is a Bitcoin standard defining a structure and algorithm to build a hierarchy tree of keys from a single root private key. Note that this is the derivation scheme used by Icarus / Yoroi which are Cardano wallets.

It is built upon BIP-0032 and is a direct application of BIP-0043. It defines a common representation of addresses as a multi-level tree of derivations:

Topl adoption: m / 1852' / 7091' / 0' / change_chain --> role / address_ix

Where m is the private key, purpose is 1852 for Topl, coin_type is 7091 for φ (Poly) change_chain is generaly 1 for change, address_ix is a zero-based index defaulting to 0. see https://docs.cardano.org/projects/cardano-wallet/en/latest/About-Address-Derivation.html

Constructors

HdWallet({required Bip32SigningKey rootSigningKey, String password = ''})
HdWallet.fromEntropy({required Uint8List entropy, String password = ''})
HdWallet.fromHexEntropy(String hexEntropy, {String password = ''})
factory
HdWallet.fromMnemonic(String mnemonic, {String language = 'english', String password = ''})
factory

Properties

entropy Uint8List
latefinal
hashCode int
The hash code for this object.
no setterinherited
password String
final
rootVerifyKey → Bip32VerifyKey
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

derive({Bip32KeyPair? keys, required int index}) Bip32KeyPair
BIP-44 path: m / purpose' / coin_type' / account_ix' / change_chain / address_ix
deriveAddress({int purpose = defaultPurpose, int coinType = defaultCoinType, int account = defaultAccountIndex, int change = defaultChange, int address = defaultAddressIndex}) Bip32KeyPair
deriveBaseAddress({int purpose = defaultPurpose, int coinType = defaultCoinType}) Bip32KeyPair
deriveLastThreeLayers({int account = defaultAccountIndex, int change = defaultChange, int address = defaultAddressIndex}) Bip32KeyPair
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toBaseAddress({required Bip32PublicKey spend, NetworkId networkId = 0x10}) ToplAddress
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited