wallet

package
v0.0.0-...-d1a22ea Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2020 License: ISC Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base58Decode

func Base58Decode(input []byte) []byte

func Base58Encode

func Base58Encode(input []byte) []byte

func CheckSumSlice

func CheckSumSlice(payload []byte) []byte

CheckSumSlice calcola il checksum restituendono i primi checksumLenght byte

func EllipticCurve

func EllipticCurve() elliptic.Curve

EllipticCurve returns the elliptic curve of choice

func NewKeyPair

func NewKeyPair() (ecdsa.PrivateKey, []byte)

NewKeyPair genera e restituisce una coppia: *chiave privata chiave pubblica utilizzando ECDSA

func PublicKeyHash

func PublicKeyHash(pubKey []byte) []byte

PublicKeyHash restituisce l'hash della chiave pubblica

func ValidateAddress

func ValidateAddress(address string) bool

Types

type Wallet

type Wallet struct {
	PrivateKey ecdsa.PrivateKey
	PublicKey  []byte
}

Wallet struttura atta a gestire la chiave privata

func MakeWallet

func MakeWallet() *Wallet

func (Wallet) Address

func (w Wallet) Address() []byte

Address restituisce un indirizzo per la Block chain TODO: migliorare l'aderenza a Bitcoin

type Wallets

type Wallets struct {
	Wallets map[string]*Wallet
}

func CreateWallets

func CreateWallets(nodeId string) (*Wallets, error)

func (*Wallets) AddWallet

func (ws *Wallets) AddWallet() string

func (*Wallets) GetAllAddresses

func (ws *Wallets) GetAllAddresses() []string

func (Wallets) GetWallet

func (ws Wallets) GetWallet(address string) Wallet

func (*Wallets) LoadFile

func (ws *Wallets) LoadFile(nodeId string) error

func (*Wallets) SaveFile

func (ws *Wallets) SaveFile(nodeId string)

Jump to

Keyboard shortcuts

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