credentials

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package credentials is related to HD keys management

Index

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

Jump to

Keyboard shortcuts

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