Documentation ¶
Index ¶
- Constants
- Variables
- func IsValidPath(path string) bool
- type Node
- func (k *Node) Derive(i uint32) (*Node, error)
- func (k *Node) Keypair() (ed25519.PublicKey, ed25519.PrivateKey)
- func (k Node) MarshalJSON() ([]byte, error)
- func (k *Node) PrivateKey() []byte
- func (k *Node) PublicKeyWithPrefix() []byte
- func (k *Node) RawSeed() []byte
- func (k *Node) UnmarshalJSON(b []byte) error
Constants ¶
View Source
const ( // FirstHardenedIndex is the index of the first hardened key (2^31). // https://youtu.be/2HrMlVr1QX8?t=390 FirstHardenedIndex = uint32(0x80000000) )
Variables ¶
View Source
var ( ErrInvalidPath = fmt.Errorf("invalid derivation path") ErrNoPublicDerivation = fmt.Errorf("no public derivation for ed25519") )
Functions ¶
func IsValidPath ¶
IsValidPath check whether or not the path has valid segments.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func DeriveForPath ¶
DeriveForPath derives key for a path in BIP-44 format and a seed. Ed25119 derivation operated on hardened keys only.
func NewMasterNode ¶
NewMasterNode generates a new master key from seed.
func (*Node) Keypair ¶
func (k *Node) Keypair() (ed25519.PublicKey, ed25519.PrivateKey)
Keypair returns the public and private key.
func (Node) MarshalJSON ¶
func (*Node) PrivateKey ¶
PrivateKey returns private key seed bytes
func (*Node) PublicKeyWithPrefix ¶
PublicKeyWithPrefix returns public key with 0x00 prefix, as specified in the slip-10 https://github.com/satoshilabs/slips/blob/master/slip-0010/testvectors.py#L64
func (*Node) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.