Documentation ¶
Index ¶
- Constants
- Variables
- func GetPrimaryAddress(seed []byte) (*types.Address, error)
- func Menmonic(entropy []byte, passphrase string) error
- func RandomMnemonic12(passphrase string) error
- func RandomMnemonic24(passphrase string) error
- type Key
- func (k Key) Address() (address *types.Address, err error)
- func (k *Key) Derive(i uint32) (*Key, error)
- func (k Key) PrivateKey() (ed25519.PrivateKey, error)
- func (k Key) PublicKey() (ed25519.PublicKey, error)
- func (k *Key) RawSeed() [32]byte
- func (k Key) SignData(message []byte) (signData []byte, pub ed25519.PublicKey, err error)
- func (k Key) StringPair() (seed string, address string, err error)
Constants ¶
View Source
const ( ViteAccountPrefix = "m/44'/666666'" VitePrimaryAccountPath = "m/44'/666666'/0'" ViteAccountPathFormat = "m/44'/666666'/%d'" FirstHardenedIndex = 1 << 31 // bip 44, hardened child key mast begin with 2^32 )
Variables ¶
View Source
var ( ErrInvalidPath = errors.New("invalid derivation path") ErrNoPublicDerivation = errors.New("no public derivation for ed25519") )
Functions ¶
func RandomMnemonic12 ¶
func RandomMnemonic24 ¶
Types ¶
type Key ¶
func DeriveForPath ¶
DeriveForPath derives key for chain path in BIP-44 format and chain seed. Ed25119 derivation operated on hardened keys only.
func NewMasterKey ¶
func (Key) PrivateKey ¶
func (k Key) PrivateKey() (ed25519.PrivateKey, error)
Click to show internal directories.
Click to hide internal directories.