Documentation ¶
Index ¶
- func CreateWallets() (map[string]*Wallet, error)
- func GenerateChecksum(payload []byte) []byte
- func GenerateKeyPair() (ecdsa.PrivateKey, []byte)
- func GeneratePublicKeyHash(pubKey []byte) []byte
- func LoadWalletsFile(wallets *map[string]*Wallet) error
- func SaveWalletsFile(wallets *map[string]*Wallet)
- func ValidateAddress(address string) bool
- type Wallet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateWallets ¶
CreateWallets makes a map of wallets and populates it with data from the wallets file if it exists.
func GenerateChecksum ¶
GenerateChecksum generates a checksum for a public key hash.
func GenerateKeyPair ¶
func GenerateKeyPair() (ecdsa.PrivateKey, []byte)
GenerateKeyPair generates a new ecdsa private and public key pair. As a note, this algorithm can generate 10^77 unique keys which is more than the number of known atoms in the universe O_O
func GeneratePublicKeyHash ¶
GeneratePublicKeyHash generates a hash for a public key using sha256 and ripemd160.
func LoadWalletsFile ¶
LoadWalletsFile loads wallets from a file into a map.
func SaveWalletsFile ¶
SaveWalletsFile saves wallets to a file as bytes to the specified wallets file.
func ValidateAddress ¶
ValidateAddress validates a wallet address.
Types ¶
type Wallet ¶
type Wallet struct { // eliptical curve digital signing algorithm private key PrivateKey ecdsa.PrivateKey PublicKey []byte }
Wallet represents a token wallet for an address.