wallet

package
v0.10.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2021 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BtcBaseDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000 + 0, 0x80000000 + 0, 0, 0}
View Source
var BtcRootDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000 + 0, 0x80000000 + 0, 0}

BTC Path

View Source
var EthBaseDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000 + 60, 0x80000000 + 0, 0, 0}

EthBaseDerivationPath is the base path from which custom derivation endpoints are incremented. As such, the first account will be at m/44'/60'/0'/0, the second at m/44'/60'/0'/1, etc.

View Source
var EthLedgerBaseDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000 + 60, 0x80000000 + 0, 0}

EthLedgerBaseDerivationPath is the base path from which custom derivation endpoints are incremented. As such, the first account will be at m/44'/60'/0'/0, the second at m/44'/60'/0'/1, etc.

View Source
var EthRootDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000 + 60, 0x80000000 + 0, 0}

EthRootDerivationPath is the root path to which custom derivation endpoints are appended. As such, the first account will be at m/44'/60'/0'/0, the second at m/44'/60'/0'/1, etc.

View Source
var QitmeerBaseDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000 + 223, 0x80000000 + 0, 0, 0}
View Source
var QitmeerRootDerivationPath = DerivationPath{0x80000000 + 44, 0x80000000 + 223, 0x80000000 + 0, 0}

Use 223 0x800000df for now, change in the future https://github.com/satoshilabs/slips/blob/master/slip-0044.md

Functions

This section is empty.

Types

type DerivationPath

type DerivationPath []uint32

DerivationPath represents the computer friendly version of a hierarchical deterministic wallet account derivaion path.

The BIP-32 spec https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki defines derivation paths to be of the form:

m / purpose' / coin_type' / account' / change / address_index

The BIP-44 spec https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki defines that the `purpose` be 44' (or 0x8000002C) for crypto currencies, and SLIP-44 https://github.com/satoshilabs/slips/blob/master/slip-0044.md assigns the `coin_type` 60' (or 0x8000003C) to Ethereum.

The root path for Ethereum is m/44'/60'/0'/0 according to the specification from https://github.com/ethereum/EIPs/issues/84, albeit it's not set in stone yet whether accounts should increment the last component or the children of that. We will go with the simpler approach of incrementing the last component.

func ParseDerivationPath

func ParseDerivationPath(path string) (DerivationPath, error)

ParseDerivationPath converts a user specified derivation path string to the internal binary representation.

Full derivation paths need to start with the `m/` prefix, relative derivation paths (which will get appended to the default root path) must not have prefixes in front of the first element. Whitespace is ignored.

func (DerivationPath) String

func (path DerivationPath) String() string

String implements the stringer interface, converting a binary derivation path to its canonical representation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL