Documentation ¶
Overview ¶
Package crypto provides key and address creation functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTxVerificationFailed means signature verification failed ErrTxVerificationFailed = fmt.Errorf("transaction verification failed") // ErrBlockVerificationFailed means signature verification failed ErrBlockVerificationFailed = fmt.Errorf("block verification failed") )
var AddressVersion byte = 92
AddressVersion is the base58 encode version adopted
var PrivateKeyVersion byte = 94
PrivateKeyVersion is the base58 encode version adopted for private keys
var PublicKeyVersion byte = 93
PublicKeyVersion is the base58 encode version adopted for public keys
Functions ¶
func IsValidAddr ¶
IsValidAddr checks whether an address is valid
func IsValidPrivKey ¶
IsValidPrivKey checks whether a private key is valid
func IsValidPubKey ¶
IsValidPubKey checks whether a public key is valid
Types ¶
type Key ¶
type Key struct { Meta map[string]interface{} // contains filtered or unexported fields }
Key represents an address
func NewKeyFromIntSeed ¶
NewKeyFromIntSeed is like NewKey but accepts seed of type Int and casts to Int64 Error is not returned. Intended to be used in test
func NewKeyFromPrivKey ¶
NewKeyFromPrivKey creates a new address from a private key
type PrivKey ¶
type PrivKey struct {
// contains filtered or unexported fields
}
PrivKey represents a private key
func PrivKeyFromBase58 ¶
PrivKeyFromBase58 decodes a base58 encoded private key
type PubKey ¶
type PubKey struct {
// contains filtered or unexported fields
}
PubKey represents a public key
func PubKeyFromBase58 ¶
PubKeyFromBase58 decodes a base58 encoded public key