Documentation ¶
Index ¶
- Constants
- func ConfigDigest(contractAddress common.Address, configCount uint64, oracles []common.Address, ...) types.ConfigDigest
- func XXXContractSetConfigArgsFromSharedConfig(c SharedConfig, ...) (signers []common.Address, transmitters []common.Address, threshold uint8, ...)
- type OracleIdentity
- type PublicConfig
- type SharedConfig
- type SharedSecretEncryptions
Constants ¶
const EncodedConfigVersion = 1
Variables ¶
This section is empty.
Functions ¶
func ConfigDigest ¶
Types ¶
type OracleIdentity ¶
type OracleIdentity struct { PeerID string OffchainPublicKey types.OffchainPublicKey OnChainSigningAddress types.OnChainSigningAddress TransmitAddress common.Address }
type PublicConfig ¶
type PublicConfig struct { DeltaProgress time.Duration DeltaResend time.Duration DeltaRound time.Duration DeltaGrace time.Duration DeltaC time.Duration AlphaPPB uint64 DeltaStage time.Duration RMax uint8 S []int OracleIdentities []OracleIdentity F int ConfigDigest types.ConfigDigest }
PublicConfig is the configuration disseminated through the smart contract It's public, because anybody can read it from the blockchain
func PublicConfigFromContractConfig ¶
func PublicConfigFromContractConfig(chainID *big.Int, skipChainSpecificChecks bool, change types.ContractConfig) (PublicConfig, error)
func (*PublicConfig) CheckParameterBounds ¶
func (c *PublicConfig) CheckParameterBounds() error
func (*PublicConfig) N ¶
func (c *PublicConfig) N() int
N is the number of oracles participating in the protocol
type SharedConfig ¶
type SharedConfig struct {}
SharedConfig is the configuration shared by all oracles running an instance of the protocol. It's disseminated through the smart contract, but parts of it are encrypted so that only oracles can access them.
func SharedConfigFromContractConfig ¶
func SharedConfigFromContractConfig( chainID *big.Int, skipChainSpecificChecks bool, change types.ContractConfig, privateKeys types.PrivateKeys, peerID string, transmitAddress common.Address, ) (SharedConfig, commontypes.OracleID, error)
func (*SharedConfig) LeaderSelectionKey ¶
func (c *SharedConfig) LeaderSelectionKey() [16]byte
func (*SharedConfig) TransmissionOrderKey ¶
func (c *SharedConfig) TransmissionOrderKey() [16]byte
type SharedSecretEncryptions ¶
type SharedSecretEncryptions struct { curve25519.PointSize]byte // // Since SharedSecretEncryptions are shared through a smart contract, each // oracle will see the same SharedSecretHash. After decryption, oracles can // check their sharedSecret against SharedSecretHash to prevent the dealer // from equivocating SharedSecretHash common.Hash // i-th oracle can recover the key as follows: // // 1. key := Keccak256(DH(DiffieHellmanPoint, process' secret key))[:16] // 2. sharedSecret := AES128DecryptBlock(key, Encryptions[i]) // // See Decrypt for details. Encryptions []encryptedSharedSecret }DiffieHellmanPoint [
SharedSecretEncryptions is the encryptions of SharedConfig.SharedSecret, using each oracle's SharedSecretEncryptionPublicKey.
We use a custom encryption scheme to be more space-efficient (compared to standard AEAD schemes, nacl crypto_box, etc...), which saves gas in transmission to the OffchainAggregator.
func XXXEncryptSharedSecret ¶
func XXXEncryptSharedSecret( keys []types.SharedSecretEncryptionPublicKey, sharedSecret *[SharedSecretSize]byte, rand io.Reader, ) SharedSecretEncryptions
XXXEncryptSharedSecret constructs a SharedSecretEncryptions from a set of SharedSecretEncryptionPublicKeys, the sharedSecret, and a cryptographic randomness source
func XXXEncryptSharedSecretInternal ¶
func XXXEncryptSharedSecretInternal( publicKeys []types.SharedSecretEncryptionPublicKey, sharedSecret *[SharedSecretSize]byte, sk *[32]byte, ) SharedSecretEncryptions
XXXEncryptSharedSecretInternal constructs a SharedSecretEncryptions from a set of SharedSecretEncryptionPublicKeys, the sharedSecret, and an ephemeral secret key sk
func (SharedSecretEncryptions) Decrypt ¶
func (e SharedSecretEncryptions) Decrypt(oid commontypes.OracleID, k types.PrivateKeys) (*[SharedSecretSize]byte, error)
Decrypt returns the sharedSecret
func (SharedSecretEncryptions) Equal ¶
func (e SharedSecretEncryptions) Equal(e2 SharedSecretEncryptions) bool