Documentation ¶
Overview ¶
Package wallet contains the off-chain identity and signature handling of go-perun's internet computer backend. It uses ed25519 keys as identities and the EdDSA signature algorithm. Anonymously import the package from your application to inject the backend into go-perun.
Index ¶
- type Account
- type Address
- type Backend
- type FsWallet
- func (w *FsWallet) DecrementUsage(a wallet.Address)
- func (w *FsWallet) IncrementUsage(a wallet.Address)
- func (w *FsWallet) LockAll()
- func (w *FsWallet) NewAccount() Account
- func (w *FsWallet) NewRandomAccount(_ *rand.Rand) wallet.Account
- func (w *FsWallet) Unlock(a wallet.Address) (wallet.Account, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account ed.PrivateKey
Account is an ed25519 signing key. It signs messages for a perun off-chain identity in internet computer channels.
type Address ¶
Address is an ed25519 public key and represents a perun off-chain identity in internet computer channels.
func (*Address) MarshalBinary ¶
func (*Address) UnmarshalBinary ¶
type FsWallet ¶
type FsWallet struct {
// contains filtered or unexported fields
}
FsWallet is a garbage-collected file system key store, removing all keys when they are no longer used. Generated keys will not be persisted to permanent storage unless IncrementUsage() is called on them. Once a key is no longer used (as indicated by DecrementUsage()), it is deleted from storage.
func CreateOrLoadFsWallet ¶
CreateOrLoadFsWallet loads the wallet from the requested path, otherwise, it creates a new one and saves it to the requested path.
func NewRAMWallet ¶
NewRAMWallet creates an unpersisted FsWallet.
func (*FsWallet) DecrementUsage ¶
DecrementUsage completements IncrementUsage().
func (*FsWallet) IncrementUsage ¶
IncrementUsage tracks how many times an account is in use. Use DecrementUsage() when an account is no longer used. Once the counter reaches 0, the account is deleted.
func (*FsWallet) LockAll ¶
func (w *FsWallet) LockAll()
LockAll disables all currently unlocked accounts.
func (*FsWallet) NewAccount ¶
NewAccount creates a fresh unlocked account. This account is not persisted until IncrementUsage() is called on it.
func (*FsWallet) NewRandomAccount ¶
NewRandomAccount creates a new random account using the wallet package.