signature

package
v0.0.0-...-e5b78d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 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

func (*OffchainPrivateKey) Sign

func (k *OffchainPrivateKey) Sign(msg []byte) ([]byte, error)

Sign returns the signature on msgHash with k

type OffchainPublicKey

type OffchainPublicKey ed25519.PublicKey

OffchainPublicKey is the public key used to cryptographically identify an oracle in inter-oracle communications.

func (OffchainPublicKey) Equal

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

type OnChainPublicKey ecdsa.PublicKey

OnChainPublicKey is the public key used to cryptographically identify an oracle to the on-chain smart contract.

func (OnChainPublicKey) Address

func (OnChainPublicKey) Equal

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 (*OnchainPrivateKey) Sign

func (k *OnchainPrivateKey) Sign(msg []byte) (signature []byte, err error)

Sign signs message with k

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL