Documentation ¶
Index ¶
Constants ¶
View Source
const ( DEVICE_PRIVKEY_FILE = "sonr-device.privkey" MASTER_PRIVKEY_FILE = "sonr-master.privkey" )
Variables ¶
This section is empty.
Functions ¶
func ExportWallet ¶
ExportWallet returns armored private key and public key
func ProvisionUid ¶
Types ¶
type GenerateOption ¶
type GenerateOption func(*options) error
func WithPassphrase ¶
func WithPassphrase(s string) GenerateOption
type Group ¶
type Group interface { GetRandomElement() *big.Int Mul(*big.Int, *big.Int) *big.Int Exp(*big.Int, *big.Int) *big.Int Inv(*big.Int) *big.Int }
Group interface is used to enable the usage of different groups in some schemes. For example when we have a homomorphism f between two groups and we are proving that we know an f-preimage of an element - meaning that for a given v we know u such that f(u) = v. Note that this is an interface for modular arithmetic groups. For elliptic curve groups at the moment there is no need for an interface.
type KeySet ¶
type KeySet interface { // Address returns the address of the keyset. Address() bytes.HexBytes // CopyToKeyring copies the keyset to the given keyring CopyToKeyring(k keyring.Keyring, sname string) (keyring.Info, error) // CryptoPrivKey returns the Secp256k1PrivKey as a libp2p crypto private key. CryptoPrivKey() crypto.PrivKey // CryptoPubKey returns the device key as a libp2p crypto public key. CryptoPubKey() crypto.PubKey // DID returns the DID of the keyset. DID(deviceId string) string // LegacyAminoPubKey returns the keyset as a legacy AminoPubKey. LegacyAminoPubKey() *multisig.LegacyAminoPubKey // PublicKeyBase58 returns the public key as a base58 encoded string. PublicKeyBase58() (string, error) // PeerID returns the peer ID of the keyset. PeerID() (peer.ID, error) // Secp256k1PrivKey returns the Secp256k1PrivKey as a libp2p crypto private key. Secp256k1PrivKey() *secp256k1.PrivKey // Export writes the keyset configuration to the given folder. Export(folder config.Folder) error }
KeySet is the set of keys required to operate on the Sonr network.
func CreateKeySet ¶
CreateKeySet creates a new key set from a given mnemonic seed
func GenerateKeyring ¶
func GenerateKeyring(cnfg *config.SonrConfig, kr keyring.Keyring, options ...GenerateOption) (KeySet, string, error)
Click to show internal directories.
Click to hide internal directories.