Documentation ¶
Index ¶
Constants ¶
View Source
const ( FirstHardenedChild = uint32(0x80000000) PublicKeyCompressedLength = 33 )
Variables ¶
View Source
var (
PrivateWalletVersion, _ = hex.DecodeString("0488ADE4")
PublicWalletVersion, _ = hex.DecodeString("0488B21E")
)
View Source
var (
BitcoinBase58Encoding = basen.NewEncoding("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
)
Functions ¶
Types ¶
type Key ¶
type Key struct { Version []byte // 4 bytes Depth byte // 1 bytes ChildNumber []byte // 4 bytes FingerPrint []byte // 4 bytes ChainCode []byte // 32 bytes Key []byte // 33 bytes IsPrivate bool // unserialized }
Represents a bip32 extended key containing key data, chain code, parent information, and other meta data
func NewMasterKey ¶
func NewMasterKey(curve primatives.EllipticCurve, masterSeed []byte, seed []byte) (*Key, error)
Creates a new master extended key from a seed
func (*Key) NewChildKey ¶
func (key *Key) NewChildKey(curve primatives.EllipticCurve, childIdx uint32) (*Key, error)
Derives a child key from a given parent as outlined by bip32
func (*Key) PublicKey ¶
func (key *Key) PublicKey(curve primatives.EllipticCurve) *Key
Create public version of key or return a copy; 'Neuter' function from the bip32 spec
Click to show internal directories.
Click to hide internal directories.