bip32

package
v0.0.0-...-6e9d532 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: ISC Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BitcoinMainnetPrivate = [4]byte{
	0x04,
	0x88,
	0xad,
	0xe4,
}

BitcoinMainnetPrivate is the version that is used for bitcoin mainnet bip32 private extended keys. Ecnodes to xprv in base58.

View Source
var BitcoinMainnetPublic = [4]byte{
	0x04,
	0x88,
	0xb2,
	0x1e,
}

BitcoinMainnetPublic is the version that is used for bitcoin mainnet bip32 public extended keys. Ecnodes to xpub in base58.

View Source
var C4exDevnetPrivate = [4]byte{
	0x03,
	0x8b,
	0x3d,
	0x80,
}

C4exDevnetPrivate is the version that is used for c4ex devnet bip32 public extended keys. Ecnodes to kdrv in base58.

View Source
var C4exDevnetPublic = [4]byte{
	0x03,
	0x8b,
	0x41,
	0xba,
}

C4exDevnetPublic is the version that is used for c4ex devnet bip32 public extended keys. Ecnodes to xdub in base58.

View Source
var C4exMainnetPrivate = [4]byte{
	0x03,
	0x8f,
	0x2e,
	0xf4,
}

C4exMainnetPrivate is the version that is used for c4ex mainnet bip32 private extended keys. Ecnodes to xprv in base58.

View Source
var C4exMainnetPublic = [4]byte{
	0x03,
	0x8f,
	0x33,
	0x2e,
}

C4exMainnetPublic is the version that is used for c4ex mainnet bip32 public extended keys. Ecnodes to kpub in base58.

View Source
var C4exSimnetPrivate = [4]byte{
	0x03,
	0x90,
	0x42,
	0x42,
}

C4exSimnetPrivate is the version that is used for c4ex simnet bip32 public extended keys. Ecnodes to ksrv in base58.

View Source
var C4exSimnetPublic = [4]byte{
	0x03,
	0x90,
	0x46,
	0x7d,
}

C4exSimnetPublic is the version that is used for c4ex simnet bip32 public extended keys. Ecnodes to xsub in base58.

View Source
var C4exTestnetPrivate = [4]byte{
	0x03,
	0x90,
	0x9e,
	0x07,
}

C4exTestnetPrivate is the version that is used for c4ex testnet bip32 public extended keys. Ecnodes to ktrv in base58.

View Source
var C4exTestnetPublic = [4]byte{
	0x03,
	0x90,
	0xa2,
	0x41,
}

C4exTestnetPublic is the version that is used for c4ex testnet bip32 public extended keys. Ecnodes to ktub in base58.

Functions

func GenerateSeed

func GenerateSeed() ([]byte, error)

GenerateSeed generates seed that can be used to initialize a master key.

Types

type ExtendedKey

type ExtendedKey struct {
	Version           [4]byte
	Depth             uint8
	ParentFingerprint [4]byte
	ChildNumber       uint32
	ChainCode         [32]byte
	// contains filtered or unexported fields
}

ExtendedKey is a bip32 extended key

func DeserializeExtendedKey

func DeserializeExtendedKey(extKeyString string) (*ExtendedKey, error)

DeserializeExtendedKey deserialized the given base58 string and returns an extended key

func NewMaster

func NewMaster(seed []byte, version [4]byte) (*ExtendedKey, error)

NewMaster returns a new extended private key based on the given seed and version

func NewMasterWithPath

func NewMasterWithPath(seed []byte, version [4]byte, pathString string) (*ExtendedKey, error)

NewMasterWithPath returns a new master key based on the given seed and version, with a derivation to the given path.

func NewPublicMasterWithPath

func NewPublicMasterWithPath(seed []byte, version [4]byte, pathString string) (*ExtendedKey, error)

NewPublicMasterWithPath returns a new public master key based on the given seed and version, with a derivation to the given path.

func (*ExtendedKey) Child

func (extKey *ExtendedKey) Child(i uint32) (*ExtendedKey, error)

Child return the i'th derived child of extKey.

func (*ExtendedKey) DeriveFromPath

func (extKey *ExtendedKey) DeriveFromPath(pathString string) (*ExtendedKey, error)

DeriveFromPath returns the extended key derived from the given path

func (*ExtendedKey) IsPrivate

func (extKey *ExtendedKey) IsPrivate() bool

IsPrivate returns whether the extended key is private

func (*ExtendedKey) PrivateKey

func (extKey *ExtendedKey) PrivateKey() *secp256k1.ECDSAPrivateKey

PrivateKey returns the ECDSA private key associated with the extended key

func (*ExtendedKey) Public

func (extKey *ExtendedKey) Public() (*ExtendedKey, error)

Public returns public version of the extended key

func (*ExtendedKey) PublicKey

func (extKey *ExtendedKey) PublicKey() (*secp256k1.ECDSAPublicKey, error)

PublicKey returns the ECDSA public key associated with the extended key

func (*ExtendedKey) String

func (extKey *ExtendedKey) String() string

Directories

Path Synopsis
Package base58 provides an API for working with modified base58 and Base58Check encodings.
Package base58 provides an API for working with modified base58 and Base58Check encodings.

Jump to

Keyboard shortcuts

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