Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Curve = secp256k1.S256()
Curve is the elliptic Curve on which on-chain messages are to be signed
Functions ¶
func VerifyOnChain ¶
func VerifyOnChain(msg []byte, signature []byte, signers EthAddresses, ) (commontypes.OracleID, error)
VerifyOnChain returns an error unless signature is a valid signature by one of the signers, in which case it returns the ID of the signer
Types ¶
type EthAddresses ¶
type EthAddresses = map[types.OnChainSigningAddress]commontypes.OracleID
type OffchainPrivateKey ¶
type OffchainPrivateKey ed25519.PrivateKey
OffchainPrivateKey is the secret key oracles use to sign messages destined for off-chain verification by other oracles
func (*OffchainPrivateKey) PublicKey ¶
func (k *OffchainPrivateKey) PublicKey() OffchainPublicKey
PublicKey returns the public key which commits to k
type OffchainPublicKey ¶
OffchainPublicKey is the public key used to cryptographically identify an oracle in inter-oracle communications.
func (OffchainPublicKey) Equal ¶
func (k OffchainPublicKey) Equal(k2 OffchainPublicKey) bool
Equal returns true iff k and k2 represent the same public key
func (OffchainPublicKey) Verify ¶
func (k OffchainPublicKey) Verify(msg, signature []byte) bool
Verify returns true iff signature is a valid signature by k on msg
type OnChainPublicKey ¶
OnChainPublicKey is the public key used to cryptographically identify an oracle to the on-chain smart contract.
func (OnChainPublicKey) Address ¶
func (k OnChainPublicKey) Address() types.OnChainSigningAddress
func (OnChainPublicKey) Equal ¶
func (k OnChainPublicKey) Equal(k2 OnChainPublicKey) bool
Equal returns true iff k and k2 represent the same public key
type OnchainPrivateKey ¶
type OnchainPrivateKey ecdsa.PrivateKey
OnchainPrivateKey is the secret key oracles use to sign messages destined for verification by the on-chain smart contract.
func (OnchainPrivateKey) Address ¶
func (k OnchainPrivateKey) Address() types.OnChainSigningAddress