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 ¶
const AddressBinaryLen = common.AddressLength
AddressBinaryLen is the length of the binary representation of Address, in bytes.
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 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) Equal ¶ added in v0.9.0
Equal checks the equality of two addresses. The implementation must be equivalent to checking `Address.Cmp(Address) == 0`.
func (*Address) MarshalBinary ¶ added in v0.9.0
MarshalBinary marshals the address into its binary representation. Error will always be nil, it is for implementing BinaryMarshaler.
func (*Address) UnmarshalBinary ¶ added in v0.9.0
UnmarshalBinary unmarshals the address from its binary representation.
type Backend ¶
type Backend struct{}
Backend implements the utility interface defined in the wallet package.
func (*Backend) NewAddress ¶ added in v0.9.0
NewAddress returns a variable of type Address, which can be used for unmarshalling an address from its binary representation.
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 simple contains a simplistic implementation of the perun wallet, account, and transactor interfaces.
|
Package simple contains a simplistic implementation of the perun wallet, account, and transactor interfaces. |
Package test contains utilities for generating random ethereum accounts and addresses.
|
Package test contains utilities for generating random ethereum accounts and addresses. |