bip32

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

README

BIP 32: Hierarchical Deterministic Wallets

Specification

This BIP describes hierarchical deterministic wallets (or "HD Wallets"): wallets which can be shared partially or entirely with different systems, each with or without the ability to spend coins.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	// Version bytes.
	Version [4]byte
	// Depth, 0x00 for master nodes, 0x01 for level-1 derived keys, ...
	Depth [1]byte
	// Fingerprint of the parent's key (0x00000000 if master key).
	FingerPrint [4]byte
	// Child number (0x00000000 if master key).
	ChildNumber [4]byte
	// Chain code.
	ChainCode [32]byte
	// KeyData for the public/private key.
	PrivateKeyData [32]byte
	PublicKeyData  [33]byte

	IsPublic bool // Internal use.
}

func Deserialize

func Deserialize(data []byte) (Key, error)

func NewMasterKey

func NewMasterKey(seed []byte) (Key, error)

A seed sequence between 128 and 512 bits; 256 bits is advised.

func (Key) NewChildKey

func (k Key) NewChildKey(index uint32) (Key, error)

func (Key) PublicKey

func (k Key) PublicKey() Key

func (Key) Serialize

func (k Key) Serialize() ([]byte, error)

func (Key) String

func (k Key) String() string

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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