Documentation ¶
Index ¶
Constants ¶
const KeySize = 32
KeySize denotes the size of the low-level public and private keys.
Variables ¶
var WordlistEnglish = []string{}/* 1626 elements not displayed */
Functions ¶
This section is empty.
Types ¶
type Network ¶
type Network string
Network denotes a type of Monero network to gather information about.
func (Network) PublicAddressBase58Prefix ¶
type Seed ¶
type Seed struct {
// contains filtered or unexported fields
}
Seed encapsulates funcionality that arised from the knowledge of a private spend key.
Differently from Bitcoin, Monero users posses two sets of private and public keys:
private | public ------- | ------ ks | Ks spend kv | Kv view
From the private spend key, a private view key is derived. Of each of them, a corresponding public key is formed.
func NewSeed ¶
func NewSeed(privateSpendKey []byte, opts ...SeedOption) *Seed
NewSeed instantiates a new Seed instance based on a byte array that contains the secret number that derives all three other keys.
As mentioned before, although here we store two private keys, ultimately, this `privateSpendKey` (an immense number "impossible" to guess that here is represented as a 32-byte array) is the only one key that is _really_ important to safe-guard as the other one is derived out of it.
func (*Seed) Mnemonic ¶
Mnemonic converts a private spend key (that gigantic number represented as a 32-byte array) to a 25-element list of carefully chosen words in a particular language (a 1626 dictionary whose words have some nice properties).
The first 24 words correspond to the key, with the 25-th being a CRC32 checksum used for error-checking.
ps.: in this implementation, only support for the English wordlist is provided.
func (*Seed) PrimaryAddress ¶
PrimaryAddress gives the base58-formatted representation of the primary address of this seed.
func (*Seed) PrivateSpendKey ¶
func (*Seed) PrivateViewKey ¶
func (*Seed) PublicSpendKey ¶
func (*Seed) PublicViewKey ¶
type SeedOption ¶
type SeedOption func(s *Seed)
SeedOption describes the type of functional options that can be provided to the constructor to override default settings.
func WithNetwork ¶
func WithNetwork(n Network) SeedOption
WithNetwork overrides the default network set for Seed instances.