Documentation ¶
Overview ¶
Package wallet implements go-perun's wallet interface for the ethereum backend. It makes use of go-ethereum's keystore module for storing, reading, and generating keys, as well as signing.
Index ¶
- Constants
- func AsEthAddr(a wallet.Address) common.Address
- func DecodeAddress(r io.Reader) (wallet.Address, error)
- func DecodeSig(r io.Reader) (wallet.Sig, error)
- func PrefixedHash(data []byte) []byte
- func VerifySignature(msg []byte, sig wallet.Sig, a wallet.Address) (bool, error)
- type Address
- type Backend
Constants ¶
const SigLen = 65
SigLen length of a signature in byte. ref https://godoc.org/github.com/ethereum/go-ethereum/crypto/secp256k1#Sign ref https://github.com/ethereum/go-ethereum/blob/54b271a86dd748f3b0bcebeaf678dc34e0d6177a/crypto/signature_cgo.go#L66
Variables ¶
This section is empty.
Functions ¶
func AsEthAddr ¶ added in v0.2.1
AsEthAddr is a helper function to convert an address interface back into an ethereum address.
func DecodeAddress ¶
DecodeAddress decodes an address from an io.Reader.
func PrefixedHash ¶ added in v0.4.1
PrefixedHash adds an ethereum specific prefix to the hash of given data, rehashes the results and returns it.
Types ¶
type Address ¶
Address represents an ethereum address as a perun address.
func AsWalletAddr ¶ added in v0.4.0
AsWalletAddr is a helper function to convert an ethereum address to an address interface.
func (*Address) Cmp ¶ added in v0.4.0
Cmp checks ordering of two addresses.
0 if a==b,
-1 if a < b, +1 if a > b. https://godoc.org/bytes#Compare
func (*Address) Decode ¶
Decode decodes an address from a io.Reader. Part of the go-perun/pkg/io.Serializer interface.
func (*Address) Encode ¶
Encode encodes this address into a io.Writer. Part of the go-perun/pkg/io.Serializer interface.
Directories ¶
Path | Synopsis |
---|---|
Package hd contains perun wallet and accounts implementation for accessing accounts stored in an ethereum hierarchial deterministic (HD) wallet.
|
Package hd contains perun wallet and accounts implementation for accessing accounts stored in an ethereum hierarchial deterministic (HD) wallet. |
Package keystore contains perun wallet and accounts implementation for accessing accounts stored in ethereum keystore.
|
Package keystore contains perun wallet and accounts implementation for accessing accounts stored in ethereum keystore. |
Package test contains utilities for generating random ethereum accounts and addresses.
|
Package test contains utilities for generating random ethereum accounts and addresses. |