Documentation ¶
Overview ¶
Package sakg implements ADR 0008: Standard Account Key Generation.
Index ¶
Constants ¶
const ( // BIP32PathMnemonicComponent is the string representing the mnemonic // (first) component of a BIP-0032 path. BIP32PathMnemonicComponent = "m" // BIP32HardenedComponentSuffix is the string representing the suffix of a // hardened component of a BIP-00032 path. BIP32HardenedComponentSuffix = "'" )
const BIP32PathPrefix = "m/44'/474'"
BIP32PathPrefix is the Oasis Network's BIP-0032 path prefix as defined by ADR 0008.
const HardenedKeysIndexStart = uint32(0x80000000)
HardenedKeysIndexStart is the index of the first hardened BIP-0032 key.
const MaxAccountKeyNumber = uint32(0x7fffffff)
MaxAccountKeyNumber is the maximum allowed key number when using ADR 0008.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BIP32Path ¶
type BIP32Path []uint32
BIP32Path represents a BIP-0032 path.
func GetAccountSigner ¶
func GetAccountSigner( mnemonic string, passphrase string, number uint32, ) (signature.Signer, BIP32Path, error)
GetAccountSigner generates a signer for the given mnemonic, passphrase and account according to ADR 0008.
func NewBIP32Path ¶
NewBIP32Path creates a BIP32Path object from the given BIP-0032 path's string representation.
func (BIP32Path) MarshalText ¶
MarshalText encodes a BIP-0032 path into text form.
func (BIP32Path) String ¶
String returns the string representation of a BIP-0032 path.
NOTE: Hardened paths are marked with BIP32HardenedComponentSuffix.
func (*BIP32Path) UnmarshalText ¶
UnmarshalText decodes a text marshaled BIP-0032 path.