bip44

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DeterministicWalletsPurpose Purpose 44'
	DeterministicWalletsPurpose = uint32(0x8000002C)

	// CoinTypeBitcoin Coin type 0'
	CoinTypeBitcoin = uint32(0x80000000)
	// CoinTypeEther Coin type 60'
	CoinTypeEther = uint32(0x8000003c)
	// CoinTypeSolana Coin type 501'
	CoinTypeSolana = uint32(0x800001f5)

	// Bitcoin the derive key path of Bitcoin
	Bitcoin = DerivePath("m/44’/0’/0’/0/0")
	// Ethereum the derive key path of Ethereum
	Ethereum = DerivePath("m/44'/60'/0'/0/0")

	Solana = DerivePath("m/44'/501'/0'/0'/0")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DerivePath

type DerivePath string

DerivePath is the key path of Hierarchical Deterministic Wallets

func (DerivePath) ToParams

func (p DerivePath) ToParams() (*DerivePathParams, error)

ToParams converts a string derive path to DerivePathParams

type DerivePathParams

type DerivePathParams struct {
	// Purpose is the purpose field of BIP44. Must be 44'
	Purpose uint32
	// CoinType is the coin type for BIP44.
	// 0' for Bitcoin, 60' for Ethereum, 501' for Solana
	// See https://github.com/satoshilabs/slips/blob/master/slip-0044.md for detail.
	CoinType                      uint32
	Account, Change, AddressIndex uint32
	// Extra for any possible path
	Extra []uint32
	// Depth for the actual depth of the path
	Depth uint
}

DerivePathParams is the BIP44 params of a derived path

func (*DerivePathParams) Indexes

func (p *DerivePathParams) Indexes() []uint32

Indexes returns child indexes of this derived path.

Jump to

Keyboard shortcuts

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