Documentation ¶
Index ¶
- Constants
- func DecodeHex(uri string) ([]byte, bool)
- func EncodeHex(b []byte) string
- func SS58Address(accountID []byte, network uint8) (string, error)
- func SS58AddressWithAccountIDChecksum(accountID []byte, network uint8) (string, error)
- type DeriveJunction
- type KeyPair
- type Scheme
- type Signer
- type Verifier
Constants ¶
View Source
const (
// DevPhrase is default phrase used for dev test accounts
DevPhrase = "bottom drive obey lake curtain smoke basket hold race lonely fit walk"
)
Variables ¶
This section is empty.
Functions ¶
func SS58Address ¶
SS58Address derives ss58 address from the accountID and network uses SS58Checksum checksum type SS58Checksum uses the concat(network, accountID) as blake2b hash pre-image More here: https://github.com/paritytech/substrate/wiki/External-Address-Format-(SS58)#checksum-types
func SS58AddressWithAccountIDChecksum ¶
SS58AddressWithAccountIDChecksum derives ss58 address from the accountID, network uses AccountID checksum type AccountIDChecksum uses the accountID as the blake2b hash pre-image More here: https://github.com/paritytech/substrate/wiki/External-Address-Format-(SS58)#checksum-types
Types ¶
type DeriveJunction ¶
type KeyPair ¶
type KeyPair interface { Signer Verifier // Seed returns the seed of the pair Seed() []byte // Public returns the pub key in bytes. Public() []byte // AccountID returns the accountID for this key AccountID() []byte // SS58Address returns the Base58 string. // uses SS58Checksum checksum type // SS58Checksum uses the concat(network, accountID) as blake2b hash pre-image // More here: https://github.com/paritytech/substrate/wiki/External-Address-Format-(SS58)#checksum-types SS58Address(network uint8) (string, error) // SS58AddressWithAccountIDChecksum returns the Base58 string. // uses AccountID checksum type // AccountIDChecksum uses the accountID as the blake2b hash pre-image // More here: https://github.com/paritytech/substrate/wiki/External-Address-Format-(SS58)#checksum-types SS58AddressWithAccountIDChecksum(network uint8) (string, error) }
KeyPair can sign, verify using a seed and public key
type Scheme ¶
type Scheme interface { fmt.Stringer Generate() (KeyPair, error) FromSeed(seed []byte) (KeyPair, error) FromPhrase(phrase, password string) (KeyPair, error) Derive(pair KeyPair, djs []DeriveJunction) (KeyPair, error) }
Scheme represents a cryptography scheme.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.