bip32

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT, MIT Imports: 18 Imported by: 0

README

go-bip32

PkgGoDev GitHub release MIT License Contributors

Build check Go Report Card Coverage Status

An implementation of the BIP32 spec for Hierarchical Deterministic Bitcoin addresses as a simple Go library. The semantics of derived keys are up to the user. BIP43 and BIP44 are good schemes to implement with this library. An additional library for either or both of those on top of this library should be developed.

Example

It's very unlikely, but possible, that a given index does not produce a valid private key. Error checking is skipped in this example for brevity but should be handled in real code. In such a case, a ErrInvalidPrivateKey is returned.

ErrInvalidPrivateKey should be handled by trying the next index for a child key.

Any valid private key will have a valid public key so that Key.PublicKey() method never returns an error.

package main

import (
  "github.com/tyler-smith/go-bip32"
  "fmt"
  "log"
)

// Example address creation for a fictitious company ComputerVoice Inc. where
// each department has their own wallet to manage
func main(){
  // Generate a seed to determine all keys from.
  // This should be persisted, backed up, and secured
  seed, err := bip32.NewSeed()
  if err != nil {
    log.Fatalln("Error generating seed:", err)
  }

  // Create master private key from seed
  computerVoiceMasterKey, _ := bip32.NewMasterKey(seed)

  // Map departments to keys
  // There is a very small chance a given child index is invalid
  // If so your real program should handle this by skipping the index
  departmentKeys := map[string]*bip32.Key{}
  departmentKeys["Sales"], _ = computerVoiceMasterKey.NewChildKey(0)
  departmentKeys["Marketing"], _ = computerVoiceMasterKey.NewChildKey(1)
  departmentKeys["Engineering"], _ = computerVoiceMasterKey.NewChildKey(2)
  departmentKeys["Customer Support"], _ = computerVoiceMasterKey.NewChildKey(3)

  // Create public keys for record keeping, auditors, payroll, etc
  departmentAuditKeys := map[string]*bip32.Key{}
  departmentAuditKeys["Sales"] = departmentKeys["Sales"].PublicKey()
  departmentAuditKeys["Marketing"] = departmentKeys["Marketing"].PublicKey()
  departmentAuditKeys["Engineering"] = departmentKeys["Engineering"].PublicKey()
  departmentAuditKeys["Customer Support"] = departmentKeys["Customer Support"].PublicKey()

  // Print public keys
  for department, pubKey := range departmentAuditKeys {
    fmt.Println(department, pubKey)
  }
}

Thanks

The developers at Factom have contributed a lot to this library and have made many great improvements to it. Please check out their project(s) and give them a thanks if you use this library.

Thanks to bartekn from Stellar for some important bug catches.

Documentation

Index

Constants

View Source
const (
	VersionStartIndex     = 0
	VersionEndIndex       = VersionStartIndex + 4
	DepthStartIndex       = VersionEndIndex
	DepthEndIndex         = DepthStartIndex + 1
	FingerPrintStartIndex = DepthEndIndex
	FingerPrintEndIndex   = FingerPrintStartIndex + 4
	ChildNumberStartIndex = FingerPrintEndIndex
	ChildNumberEndIndex   = ChildNumberStartIndex + 4
	ChainCodeStartIndex   = ChildNumberEndIndex
	ChainCodeEndIndex     = ChainCodeStartIndex + 32
	PubKeyStartIndex      = ChainCodeEndIndex
	PvtKeyStartIndex      = PubKeyStartIndex + 1
	PubKeyEndIndex        = PubKeyStartIndex + 33
	PvtKeyEndIndex        = PubKeyEndIndex
)
View Source
const (
	// FirstHardenedChild is the index of the first "hardened" child key as per the
	FirstHardenedChild = uint32(0x80000000)
	// PublicKeyCompressedLength is the byte count of a compressed public key
	PublicKeyCompressedLength = 33
)

Variables

View Source
var (
	// ErrSerializedKeyWrongSize is returned when trying to deserialize a key that
	// has an incorrect length
	ErrSerializedKeyWrongSize = errors.New("serialized keys should by exactly 82 bytes")

	// ErrHardenedChildPublicKey is returned when trying to create a hardened child
	// of the public key
	ErrHardenedChildPublicKey = errors.New("can't create hardened child for public key")

	// ErrInvalidChecksum is returned when deserializing a key with an incorrect
	// ChecksumDblSha256
	ErrInvalidChecksum = errors.New("ChecksumDblSha256 doesn't match")

	// ErrInvalidPrivateKey is returned when a derived private key is invalid
	ErrInvalidPrivateKey = errors.New("invalid private key")

	// ErrInvalidPublicKey is returned when a derived public key is invalid
	ErrInvalidPublicKey = errors.New("invalid public key")

	ErrEmptyKey = errors.New("key is empty")
)
View Source
var (
	ErrUnSupportedHDVersionBytes = errors.New("unsupported hd version bytes")
	ErrInvalidPurpose            = errors.New("invalid purpose")
	ErrInvalidCoin               = errors.New("invalid coin")
)
View Source
var (
	Bitcoinxprvxpub = VersionBytes{
		Coin:          "Bitcoin",
		PvtKeyFlag:    0x0488ade4,
		PvKeyPrefix:   "xprv",
		PubKeyFlag:    0x0488b21e,
		PubKeyPrefix:  "xpub",
		AddrEncodings: []AddrEncoding{P2PKH, P2SH},
		Path:          "m/44'/0'",
	}
	Bitcoinyprvypub = VersionBytes{
		Coin:          "Bitcoin",
		PvtKeyFlag:    0x049d7878,
		PvKeyPrefix:   "yprv",
		PubKeyFlag:    0x049d7cb2,
		PubKeyPrefix:  "ypub",
		AddrEncodings: []AddrEncoding{P2WPKHInP2SH},
		Path:          "m/49'/0'",
	}
	Bitcoinzprvzpub = VersionBytes{
		Coin:          "Bitcoin",
		PvtKeyFlag:    0x04b2430c,
		PvKeyPrefix:   "zprv",
		PubKeyFlag:    0x04b24746,
		PubKeyPrefix:  "zpub",
		AddrEncodings: []AddrEncoding{P2WPKH},
		Path:          "m/84'/0'",
	}
	BitcoinYprvYpub = VersionBytes{
		Coin:          "Bitcoin",
		PvtKeyFlag:    0x0295b005,
		PvKeyPrefix:   "Yprv",
		PubKeyFlag:    0x0295b43f,
		PubKeyPrefix:  "Ypub",
		AddrEncodings: []AddrEncoding{P2WSHInP2SH},
		Path:          "m/84'/0'",
	}
	BitcoinZprvZpub = VersionBytes{
		Coin:          "Bitcoin",
		PvtKeyFlag:    0x02aa7a99,
		PvKeyPrefix:   "Zprv",
		PubKeyFlag:    0x02aa7ed3,
		PubKeyPrefix:  "Zpub",
		AddrEncodings: []AddrEncoding{P2WSH},
		Path:          "m/84'/0'",
	}
	Bitcointprvtpub = VersionBytes{
		Coin:          "Bitcoin Testnet",
		PvtKeyFlag:    0x04358394,
		PvKeyPrefix:   "tprv",
		PubKeyFlag:    0x043587cf,
		PubKeyPrefix:  "tpub",
		AddrEncodings: []AddrEncoding{P2PKH, P2SH},
		Path:          "m/44'/1'",
	}
	Bitcoinuprvupub = VersionBytes{
		Coin:          "Bitcoin Testnet",
		PvtKeyFlag:    0x044a4e28,
		PvKeyPrefix:   "uprv",
		PubKeyFlag:    0x044a5262,
		PubKeyPrefix:  "upub",
		AddrEncodings: []AddrEncoding{P2WPKHInP2SH},
		Path:          "m/49'/1'",
	}
	Bitcoinvprvvpub = VersionBytes{
		Coin:          "Bitcoin Testnet",
		PvtKeyFlag:    0x045f18bc,
		PvKeyPrefix:   "vprv",
		PubKeyFlag:    0x045f1cf6,
		PubKeyPrefix:  "vpub",
		AddrEncodings: []AddrEncoding{P2WPKH},
		Path:          "m/84'/1'",
	}
	BitcoinUprvUpub = VersionBytes{
		Coin:          "Bitcoin Testnet",
		PvtKeyFlag:    0x024285b5,
		PvKeyPrefix:   "Uprv",
		PubKeyFlag:    0x024289ef,
		PubKeyPrefix:  "Upub",
		AddrEncodings: []AddrEncoding{P2WSHInP2SH},
		Path:          "m/84'/1'",
	}
	BitcoinVprvVpub = VersionBytes{
		Coin:          "Bitcoin Testnet",
		PvtKeyFlag:    0x02575048,
		PvKeyPrefix:   "Vprv",
		PubKeyFlag:    0x02575483,
		PubKeyPrefix:  "Vpub",
		AddrEncodings: []AddrEncoding{P2WSH},
		Path:          "m/84'/1'",
	}
	Groestlcoinxprvxpub = VersionBytes{
		Coin:          "Groestlcoin",
		PvtKeyFlag:    0x0488ade4,
		PvKeyPrefix:   "xprv",
		PubKeyFlag:    0x0488b21e,
		PubKeyPrefix:  "xpub",
		AddrEncodings: []AddrEncoding{P2PKH, P2SH},
		Path:          "m/44'/17'",
	}
	Groestlcoinyprvypub = VersionBytes{
		Coin:          "Groestlcoin",
		PvtKeyFlag:    0x049d7878,
		PvKeyPrefix:   "yprv",
		PubKeyFlag:    0x049d7cb2,
		PubKeyPrefix:  "ypub",
		AddrEncodings: []AddrEncoding{P2WPKHInP2SH},
		Path:          "m/49'/17'",
	}
	Groestlcoinzprvzpub = VersionBytes{
		Coin:          "Groestlcoin",
		PvtKeyFlag:    0x04b2430c,
		PvKeyPrefix:   "zprv",
		PubKeyFlag:    0x04b24746,
		PubKeyPrefix:  "zpub",
		AddrEncodings: []AddrEncoding{P2WPKH},
		Path:          "m/84'/17'",
	}
	GroestlcoinYprvYpub = VersionBytes{
		Coin:          "Groestlcoin",
		PvtKeyFlag:    0x0295b005,
		PvKeyPrefix:   "Yprv",
		PubKeyFlag:    0x0295b43f,
		PubKeyPrefix:  "Ypub",
		AddrEncodings: []AddrEncoding{P2WSHInP2SH},
		Path:          "m/84'/17'",
	}
	GroestlcoinZprvZpub = VersionBytes{
		Coin:          "Groestlcoin",
		PvtKeyFlag:    0x02aa7a99,
		PvKeyPrefix:   "Zprv",
		PubKeyFlag:    0x02aa7ed3,
		PubKeyPrefix:  "Zpub",
		AddrEncodings: []AddrEncoding{P2WSH},
		Path:          "m/84'/17'",
	}
	Groestlcointprvtpub = VersionBytes{
		Coin:          "Groestlcoin Testnet",
		PvtKeyFlag:    0x04358394,
		PvKeyPrefix:   "tprv",
		PubKeyFlag:    0x043587cf,
		PubKeyPrefix:  "tpub",
		AddrEncodings: []AddrEncoding{P2PKH, P2SH},
		Path:          "m/44'/1'",
	}
	Groestlcoinuprvupub = VersionBytes{
		Coin:          "Groestlcoin Testnet",
		PvtKeyFlag:    0x044a4e28,
		PvKeyPrefix:   "uprv",
		PubKeyFlag:    0x044a5262,
		PubKeyPrefix:  "upub",
		AddrEncodings: []AddrEncoding{P2WPKHInP2SH},
		Path:          "m/49'/1'",
	}
	Groestlcoinvprvvpub = VersionBytes{
		Coin:          "Groestlcoin Testnet",
		PvtKeyFlag:    0x045f18bc,
		PvKeyPrefix:   "vprv",
		PubKeyFlag:    0x045f1cf6,
		PubKeyPrefix:  "vpub",
		AddrEncodings: []AddrEncoding{P2WPKH},
		Path:          "m/84'/1'",
	}
	GroestlcoinUprvUpub = VersionBytes{
		Coin:          "Groestlcoin Testnet",
		PvtKeyFlag:    0x024285b5,
		PvKeyPrefix:   "Uprv",
		PubKeyFlag:    0x024289ef,
		PubKeyPrefix:  "Upub",
		AddrEncodings: []AddrEncoding{P2WSHInP2SH},
		Path:          "m/84'/1'",
	}
	GroestlcoinVprvVpub = VersionBytes{
		Coin:          "Groestlcoin Testnet",
		PvtKeyFlag:    0x02575048,
		PvKeyPrefix:   "Vprv",
		PubKeyFlag:    0x02575483,
		PubKeyPrefix:  "Vpub",
		AddrEncodings: []AddrEncoding{P2WSH},
		Path:          "m/84'/1'",
	}
	LitecoinLtpvLtub = VersionBytes{
		Coin:          "Litecoin",
		PvtKeyFlag:    0x019d9cfe,
		PvKeyPrefix:   "Ltpv",
		PubKeyFlag:    0x019da462,
		PubKeyPrefix:  "Ltub",
		AddrEncodings: []AddrEncoding{P2PKH, P2SH},
		Path:          "m/44'/2'",
	}
	LitecoinMtpvMtub = VersionBytes{
		Coin:          "Litecoin",
		PvtKeyFlag:    0x01b26792,
		PvKeyPrefix:   "Mtpv",
		PubKeyFlag:    0x01b26ef6,
		PubKeyPrefix:  "Mtub",
		AddrEncodings: []AddrEncoding{P2WPKHInP2SH},
		Path:          "m/49'/2'",
	}
	Litecointtpvttub = VersionBytes{
		Coin:          "Litecoin Testnet",
		PvtKeyFlag:    0x0436ef7d,
		PvKeyPrefix:   "ttpv",
		PubKeyFlag:    0x0436f6e1,
		PubKeyPrefix:  "ttub",
		AddrEncodings: []AddrEncoding{P2PKH, P2SH},
		Path:          "m/44'/1'",
	}
	Nexaxprvxpub = VersionBytes{
		Coin:          "Nexa",
		PvtKeyFlag:    0x426c6b73,
		PvKeyPrefix:   "xprv",
		PubKeyFlag:    0x42696720,
		PubKeyPrefix:  "xpub",
		AddrEncodings: []AddrEncoding{P2PKT, P2PKH, P2SH},
		Path:          "m/44'/29223'",
	}
	Nexaxprvxpub2 = VersionBytes{
		Coin:          "Nexa Testnet",
		PvtKeyFlag:    0x04358394,
		PvKeyPrefix:   "xprv",
		PubKeyFlag:    0x043587cf,
		PubKeyPrefix:  "xpub",
		AddrEncodings: []AddrEncoding{P2PKH, P2SH},
		Path:          "m/44'/1'",
	}
	Polispprvppub = VersionBytes{
		Coin:          "Polis",
		PvtKeyFlag:    0x03e25945,
		PvKeyPrefix:   "pprv",
		PubKeyFlag:    0x03e25d7e,
		PubKeyPrefix:  "ppub",
		AddrEncodings: []AddrEncoding{P2PKH},
		Path:          "m/44'/1997'",
	}
	Syscoinzprvzpub = VersionBytes{
		Coin:          "Syscoin",
		PvtKeyFlag:    0x04b2430c,
		PvKeyPrefix:   "zprv",
		PubKeyFlag:    0x04b24746,
		PubKeyPrefix:  "zpub",
		AddrEncodings: []AddrEncoding{P2WPKH},
		Path:          "m/84'/57'",
	}
	SyscoinZprvZpub = VersionBytes{
		Coin:          "Syscoin",
		PvtKeyFlag:    0x02aa7a99,
		PvKeyPrefix:   "Zprv",
		PubKeyFlag:    0x02aa7ed3,
		PubKeyPrefix:  "Zpub",
		AddrEncodings: []AddrEncoding{P2WSH},
		Path:          "m/84'/57'",
	}
	Vertcoinvtcpvtcv = VersionBytes{
		Coin:          "Vertcoin",
		PvtKeyFlag:    0x0488ade4,
		PvKeyPrefix:   "vtcv",
		PubKeyFlag:    0x0488b21e,
		PubKeyPrefix:  "vtcp",
		AddrEncodings: []AddrEncoding{P2PKH, P2SH},
		Path:          "m/44'/28'",
	}
)
View Source
var CoinTypeToHDBytesSlice = map[uint32][]VersionBytes{}

CoinTypeToHDBytesSlice uint32 value is VersionBytes.CoinVal and not VersionBytes.CoinValFull

View Source
var DefaultMainnetVersion = Bitcoinxprvxpub
View Source
var DefaultTestnetVersion = Bitcointprvtpub
View Source
var (
	ErrUnSupportedOrInvalidPath = errors.New("path is unsupported and/or invalid")
)
View Source
var HDVersionBytesSlice []VersionBytes

HDVersionBytesSlice Slice of All Registered VersionBytes

View Source
var PathRegex = regexp.MustCompile(`^[mM](/\d+')*(/\d+)*$`)

PathToHDBytesSlice Registered HD Version Bytes Path (Two Level) To VersionBytes

View Source
var PubFlagToHDBytesSlice = map[uint32][]VersionBytes{}

PubFlagToHDBytesSlice VersionBytes.PubKeyFlag To slice of VersionBytes

View Source
var PurposeFullToHDBytesSlice = map[uint32][]VersionBytes{}

PurposeFullToHDBytesSlice uint32 value is VersionBytes.PurposeValFull

View Source
var PurposeToHDBytesSlice = map[uint32][]VersionBytes{}

PurposeToHDBytesSlice uint32 value is VersionBytes.PurposeVal

View Source
var PvtFlagToHDBytesSlice = map[uint32][]VersionBytes{}

PvtFlagToHDBytesSlice VersionBytes.PvtKeyFlag To slice of VersionBytes

Functions

func AddChecksumDblSha256ToBytes

func AddChecksumDblSha256ToBytes(data []byte) ([]byte, error)

func ChecksumDblSha256

func ChecksumDblSha256(data []byte) ([]byte, error)

func ExpandPublicKey

func ExpandPublicKey(key []byte) (*big.Int, *big.Int)

As described at https://crypto.stackexchange.com/a/8916

func HashRipeMD160onSha256

func HashRipeMD160onSha256(data []byte) ([]byte, error)

HashRipeMD160onSha256 hashRipeMD160(sha256.Sum256(data))

func NewSeed

func NewSeed() ([]byte, error)

NewSeed returns a cryptographically secure seed

func ValidatePrivateKey

func ValidatePrivateKey(key PvtKeyBytes) error

Types

type AddrEncoding

type AddrEncoding string
const (
	P2PKH        AddrEncoding = "P2PKH"
	P2WPKH       AddrEncoding = "P2WPKH"
	P2WPKHInP2SH AddrEncoding = "P2WPKHInP2SH"
	P2SH         AddrEncoding = "P2SH"
	P2WSH        AddrEncoding = "P2WSH"
	P2WSHInP2SH  AddrEncoding = "P2WSHInP2SH"
	P2PKT        AddrEncoding = "P2PKT"
)

type ChainCode

type ChainCode [32]byte

type ChildNumber

type ChildNumber [4]byte

type Depth

type Depth [1]byte

type FingerPrint

type FingerPrint [4]byte

type Key

type Key [78]byte

Key is [ Version + Depth + FingerPrint + ChildNumber + ChainCode + KeyBytes ]Array m/purpose'/coin_type'/account'/change/address_index

func B58Deserialize

func B58Deserialize(data string) (Key, error)

B58Deserialize deserializes a Key encoded in base58 encoding

func Deserialize

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

Deserialize a byte slice into a Key

func NewMasterKey

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

NewMasterKey creates a new master extended key from a seed VersionBytes.PvtKeyFlagBytes used is DefaultMainnetVersion.PvtKeyFlagBytes

func (*Key) B58Serialize

func (key *Key) B58Serialize() string

B58Serialize encodes the Key in the standard Bitcoin base58 encoding

func (*Key) GetChainCode

func (key *Key) GetChainCode() ChainCode

func (*Key) GetChildNumber

func (key *Key) GetChildNumber() ChildNumber

func (*Key) GetDepth

func (key *Key) GetDepth() Depth

func (*Key) GetFingerPrint

func (key *Key) GetFingerPrint() FingerPrint

func (*Key) GetKeyBytes

func (key *Key) GetKeyBytes() KeyBytes

func (*Key) GetPvtKeyBytes

func (key *Key) GetPvtKeyBytes() PvtKeyBytes

func (*Key) GetVersion

func (key *Key) GetVersion() uint32

func (*Key) IsPrivate

func (key *Key) IsPrivate() bool

func (*Key) IsValid

func (key *Key) IsValid() bool

func (*Key) NewChildKey

func (key *Key) NewChildKey(childIdx uint32) (Key, error)

NewChildKey derives a child key from a given parent as outlined by bip32

func (*Key) PrivateKeyHex

func (key *Key) PrivateKeyHex() string

PrivateKeyHex returns private key in hex string without prefix 0x

func (*Key) PublicKeyExtended

func (key *Key) PublicKeyExtended() Key

PublicKeyExtended returns the public version of key or return a copy The 'Neuter' function from the bip32 spec If corresponding version is not found then default VersionBytes.PubKeyFlagBytes (DefaultMainnetVersion.PubKeyFlagBytes) is used

func (*Key) PublicKeyHex

func (key *Key) PublicKeyHex() string

PublicKeyHex returns public key in hex string without prefix 0x

func (*Key) Serialize

func (key *Key) Serialize() ([]byte, error)

Serialize a Key to a slice of 82 byte (78 byte(s) + 4 byte(s) of checksum)

func (*Key) SetVersion

func (key *Key) SetVersion(v Version)

func (*Key) SetVersionUint32

func (key *Key) SetVersionUint32(v uint32)

func (*Key) String

func (key *Key) String() string

String encodes the Key in the standard Bitcoin base58 encoding Set Version before calling String()

type KeyBytes

type KeyBytes [33]byte

KeyBytes For PrivateKey, index starts from 1 instead of 0

type Path

type Path string

Path is pattern --> m/purpose'/coin_type'/account'/change/address_index Ref https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki and Ref bip32.Key A path component is hardened if it's value is greater than or equal to FirstHardenedChild or if it's value is lesser but contains apostrophe(')

func (Path) Formatted

func (p Path) Formatted() Path

func (Path) IsValid

func (p Path) IsValid() bool

func (Path) ReplaceValueAtDepth

func (p Path) ReplaceValueAtDepth(b byte, val uint32) (Path, error)

func (Path) String

func (p Path) String() string

func (Path) ValueAtDepth

func (p Path) ValueAtDepth(b byte) (uint32, error)

ValueAtDepth Example 0 1 2 3 4 5 m/purpose'/coin_type'/account'/change/address_index

func (Path) ValuesAtDepth

func (p Path) ValuesAtDepth() ([]uint32, error)

ValuesAtDepth (correspondingIndexes)

0    1        2        3      4

m/purpose'/coin_type'/account'/change/address_index Results in []uint32{Purpose,CoinType,Account,Change,AddIndex} Returns real values (i.e. 40 is 40 and not 40 + FirstHardenedChild)

type PvtKeyBytes

type PvtKeyBytes [32]byte // If first byte of KeyBytes is zero

type Version

type Version [4]byte

type VersionBytes

type VersionBytes struct {
	// Coin Name
	Coin string
	// PvtKeyFlag(4 bytes)
	PvtKeyFlag uint32
	// PvKeyPrefix is human-readable, but it's a result of serialization
	// using above Private Key Hex Bytes (the first 4 val of serialized result obtained
	// using above PvtKeyFlag should always match this PvKeyPrefix)
	PvKeyPrefix string
	// PubKeyFlag is similar to PvtKeyFlag but deals with Public Keys
	PubKeyFlag uint32
	// PubKeyPrefix is similar to PvKeyPrefix but deals with Public Keys
	PubKeyPrefix  string
	AddrEncodings []AddrEncoding
	// Path
	Path Path
}

func (VersionBytes) CoinVal

func (h VersionBytes) CoinVal() (uint32, error)

CoinVal returns coinVal in (origVal % FirstHardenedChild), hence it's always less than FirstHardenedChild

func (VersionBytes) CoinValFull

func (h VersionBytes) CoinValFull() (uint32, error)

func (VersionBytes) IsRegistered

func (h VersionBytes) IsRegistered() bool

func (VersionBytes) IsValid

func (h VersionBytes) IsValid() bool

func (VersionBytes) PubKeyFlagBytes

func (h VersionBytes) PubKeyFlagBytes() [4]byte

func (VersionBytes) PurposeVal

func (h VersionBytes) PurposeVal() (uint32, error)

PurposeVal returns purposeVal in (origVal % FirstHardenedChild), hence it's always less than FirstHardenedChild

func (VersionBytes) PurposeValFull

func (h VersionBytes) PurposeValFull() (uint32, error)

func (VersionBytes) PvtKeyFlagBytes

func (h VersionBytes) PvtKeyFlagBytes() [4]byte

Jump to

Keyboard shortcuts

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