Documentation ¶
Overview ¶
Package credentials is related to HD keys management
Index ¶
- type Credentials
- func New(cfg *config.Config, bitSize int) (*Credentials, error)
- func NewFromMnemonic(cfg *config.Config, mnemonic string) (*Credentials, error)
- func NewFromMnemonicWithPasshprase(cfg *config.Config, mnemonic, passphrase string) (*Credentials, error)
- func NewFromPrivateKey(cfg *config.Config, privateKey string) (*Credentials, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct { RootKey *hdkeychain.ExtendedKey RootPrvKey *btcec.PrivateKey RootPubKey *btcec.PublicKey ReqPrvKey *btcec.PrivateKey ReqPubKey *btcec.PublicKey AccExtKey *hdkeychain.ExtendedKey AccExtPubKey *hdkeychain.ExtendedKey }
Credentials contains is BIP-39 Root Key and derivatives
func New ¶
func New(cfg *config.Config, bitSize int) (*Credentials, error)
New creates new Credentials for livenet and random mnemonic
func NewFromMnemonic ¶
func NewFromMnemonic(cfg *config.Config, mnemonic string) (*Credentials, error)
NewFromMnemonic creates new Credentials based on existing mnemonic
func NewFromMnemonicWithPasshprase ¶
func NewFromMnemonicWithPasshprase(cfg *config.Config, mnemonic, passphrase string) (*Credentials, error)
NewFromMnemonicWithPasshprase creates new Credentials based on existing mnemonic and passphrase
func NewFromPrivateKey ¶
func NewFromPrivateKey(cfg *config.Config, privateKey string) (*Credentials, error)
NewFromPrivateKey creates new Credentials based on existing mnemonic
func (*Credentials) DeriveFromAccount ¶
func (c *Credentials) DeriveFromAccount(path string) (*btcec.PrivateKey, *btcec.PublicKey, error)
DeriveFromAccount derives child key pair from account extended key by provided BIP44-compliant path
Click to show internal directories.
Click to hide internal directories.