bip44

package
v1.10.0-beta.20201225 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PathFormat      = "m/44'/%d'"
	FullPathFormat  = "m/44'/%d'/0'/0/0"
	FullPathFormat4 = "m/44'/%d'/%d'/%d/%d" //symbol,account,0|1 external|internal(change), index
	Password        = "DASafe360"

	// ChangeTypeExternal 通常用于收款,对外部可见
	ChangeTypeExternal = 0
	// ChangeTypeInternal 通常用于找零,通常不对外可见
	ChangeTypeInternal = 1
)

Variables

This section is empty.

Functions

func GetCoinDerivationPath

func GetCoinDerivationPath(path, symbol string) (derivationPath accounts.DerivationPath, err error)

GetCoinDerivationPath get actual path for coin

func GetCoinType

func GetCoinType(symbol string) (coinType uint32, err error)

GetCoinType get bip44 id for symbol,

func GetDerivePath

func GetDerivePath(path string, symbolID uint32, ap *AdditionalDeriveParam) (accounts.DerivationPath, error)

GetDerivePath provide path, symbole id (and other param ) to get bip44 derivation path

Types

type AdditionalDeriveParam

type AdditionalDeriveParam struct {
	AccountIndex, ChangeType, Index int
}

AdditionalDeriveParam 额外的推导参数

type Deriver

type Deriver interface {
	// DeriveAddress derives the account address of the derivation path.
	DeriveAddress() (address string, err error)
	// DerivePublicKey derives the public key of the derivation path.
	DerivePublicKey() (publicKey string, err error)
	// DerivePrivateKey derives the private key of the derivation path.
	DerivePrivateKey() (privateKey string, err error)
}

Deriver derives address/publicKey/privateKey

Jump to

Keyboard shortcuts

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