spec

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

README

SSV Distributed Key Generation Spec

Introduction

This repository contains spec of distributed key generation (DKG) used in SSV. Based on verifiable secret sharing, DKG allows a set of n operators to generate a BLS key share for each operator, such that a BLS private key can only be used when threshold $t$ out of $n$ operators agree. $t$ is defined by the number of faults admissible: $t = n - f$, where $n = 3 * f + 1$.


Functionalities

Operations are initiated by an initiator, and executed by operators. An initiator can initiate:

Init

When a init message is sent to the operators, all operators participate and run a DKG ceremony to create key shares. A DKG ceremony asks each operator to verifiably share locally generated secrets with other operators, and combine secret shares from all operators to derive its own BLS key share. An init message specifies an owner ethAddress. The owner is the entity that owns the Ethereum validator which the generated secret shares control. After the ceremony, each operator generates a Result with a SignedProof (see below) for verification. Proofs are referred to when an initiator asks for re-sign or reshare.

Re-sign

In the case where the nonces of a DKG ceremony is not correct, to prevent replay attack, the initiator sends re-sign messages for operators to create new signatures with correct nonces without generating a new validator key. For operators to perform re-sign, owner's secret key must be used to sign a re-sign message, convincing the operators that the request is regarding a completed ceremony and it is indeed the owner of this ceremony that requested to re-sign.

Reshare

When the set of operators changed (including change of size and change of operators), a reshare is initiated to generate new key shares among the new operators. This process requires participation from t old operators and all new operators. For operators to perform reshare, owner's secret key must be used to sign a reshare message, convincing the operators that the request is regarding a completed ceremony and it is indeed the owner of this ceremony that requested to reshare.


Security Assumptions

All messages are authenticated using the initiator's and operators' public keys. Initiators and operators are assumed to keep their secret keys secure. An initiator has no motivation to deviate from the protocol or trick operators to create unexpected results, because wrong DKG outputs only damage the initator itself, e.g. operators will not be able to perform duties for the initiator if DKG key shares are incorrect.


Validations

In a DKG ceremony, each message sent between the initiator and the operators are validated by the operators such that:

  • The message is signed by the sender, preventing spoofing attacks.
  • Where replay attacks are possible, a valid nonce is included to ensure the message is fresh (otherwise Re-sign).
  • The message is in the same scope, i.e., the message is regarding the same ceremony, the same set of operators and it is in the correct stage as the receiver expects.

Result and Proof struct

After execution of init, re-sign and reshare, a result is returned by the operators as an important validation for the completion of the ceremony.

type Result struct {
	// Operator ID
	OperatorID uint64
	// RequestID for the DKG instance (not used for signing)
	RequestID [24]byte `ssz-size:"24"`
	// Partial Operator Signature of Deposit data
	DepositPartialSignature []byte `ssz-size:"96"`
	// SSV owner + nonce signature
	OwnerNoncePartialSignature []byte `ssz-size:"96"`
	// Signed proof for the ceremony
	SignedProof SignedProof
}

In a result, the SignedProof is a Proof with a signature. A Proof contains:

type Proof struct {
	// the resulting public key corresponding to the shared private key
	ValidatorPubKey []byte `ssz-size:"48"`
	// standard SSV encrypted share
	EncryptedShare []byte `ssz-max:"512"`
	// the share's BLS pubkey
	SharePubKey []byte `ssz-size:"48"`
	// owner address
	Owner [20]byte `ssz-size:"20"`
}

As a 4-operator example, after the ceremony, each operator $i$ obtains a secret share $s_i$. The aggregated secret key $S$ can be recovered from any 3 out of the 4 secret shares $s_1, s_2, s_3, s_4$. In this example, ValidatorPubKey is the public key of the aggregated secret $S$. EncryptedShare is the encrypted secret share of the operator, e.g. encrypted $s_1$ for operator 1. SharePubKey is the corresponding public key of the operator's secret share $s_i$.

Proofs are published by the initiator after the DKG ceremony. All Proof from a ceremony together validates the completion of this ceremony. they can make sure:

  • Partial signatures of operators are publically verifiable using the SharePubKey in the proof with BLS signature verification (given the message, SharePubKey, and the signature, returns whether the signature is valid or not). If an operator created invalid partial signatures, the network is able to identify and potentially take further action.
  • An operator knows its peers have completed the protocol locally and has a secret share ready to use. It prevents the case where some operators failed to derive their secret shares while others are unaware.
  • The initiator refers to a completed valid DKG ceremony when initiating Re-sign and Reshare. Operators are able to identify and verify the corresponding ceremony when receiving requests from the initiator.

Testing

The tests are located in the testing/ folder. To run tests, use:

go generate ./...

then:

go test testing

Documentation

Overview

Code generated by fastssz. DO NOT EDIT. Hash: bb994e8d7059ba3c6a6e2104b6709c1ebbe00cd687a79e1ded04a2a38c891a70 Version: 0.1.3

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BLSPKEncode

func BLSPKEncode(pkBytes []byte) (*bls.PublicKey, error)

func BLSSignatureEncode

func BLSSignatureEncode(pkBytes []byte) (*bls.Sign, error)

func EqualOperators

func EqualOperators(a, b []*Operator) bool

EqualOperators returns true if both arrays of operators are equal

func FindOperatorPosition

func FindOperatorPosition(operators []*Operator, id uint64) int

func GetBulkMessageHash

func GetBulkMessageHash(bulkMsg []SSZMarshaller) ([32]byte, error)

func GetPartialSigsFromResult

func GetPartialSigsFromResult(result *Result) (sharePubKey *bls.PublicKey, depositShareSig, ownerNonceShareSig *bls.Sign, err error)

func GetReqIDFromMsg

func GetReqIDFromMsg(message SSZMarshaller) ([24]byte, error)

func NewID

func NewID() [24]byte

NewID generates a random ID from 2 random concat UUIDs

func OperatorIDByPubKey

func OperatorIDByPubKey(operators []*Operator, pkBytes []byte) (uint64, error)

func PartialNonceRoot

func PartialNonceRoot(address common.Address, nonce uint64) []byte

PartialNonceRoot returns root for singing owner nonce

func ReconstructMasterSignatures

func ReconstructMasterSignatures(ids []uint64, sigsPartialDeposit, sigsPartialSSVContractOwnerNonce []*bls.Sign) (reconstructedDepositMasterSig, reconstructedOwnerNonceMasterSig *bls.Sign, err error)

func RecoverValidatorPKFromResults

func RecoverValidatorPKFromResults(results []*Result) ([]byte, error)

RecoverValidatorPKFromResults returns validator PK recovered from results

func RunReshare

func RunReshare(signedReshare *SignedReshare) ([][]*Result, error)

func RunResign

func RunResign(signedResign *SignedResign) ([][]*Result, error)

func ThresholdForCluster

func ThresholdForCluster(operators []*Operator) (uint64, error)

ThresholdForCluster returns the threshold for provided group, or error

func UniqueAndOrderedOperators

func UniqueAndOrderedOperators(operators []*Operator) bool

UniqueAndOrderedOperators returns true if array of operators are unique and ordered (no duplicate IDs)

func ValidAmountSet

func ValidAmountSet(amount phase0.Gwei) bool

func ValidThresholdSet

func ValidThresholdSet(t uint64, operators []*Operator) bool

ValidThresholdSet returns true if the number of operators and threshold is valid

func ValidateCeremonyProof

func ValidateCeremonyProof(
	validatorPK []byte,
	operator *Operator,
	signedProof SignedProof,
) error

func ValidateInitMessage

func ValidateInitMessage(init *Init) error

ValidateInitMessage returns nil if init message is valid

func ValidateReshareMessage

func ValidateReshareMessage(
	reshare *Reshare,
	operator *Operator,
	proof *SignedProof,
) error

ValidateReshareMessage returns nil if re-share message is valid

func ValidateResignMessage

func ValidateResignMessage(
	resign *Resign,
	operator *Operator,
	proof *SignedProof,
) error

ValidateResignMessage returns nil if re-sign message is valid

func ValidateResult

func ValidateResult(
	operators []*Operator,
	ownerAddress [20]byte,
	requestID [24]byte,
	withdrawalCredentials []byte,
	validatorPK []byte,
	fork [4]byte,
	nonce uint64,
	amount phase0.Gwei,
	result *Result,
) error

ValidateResult returns nil if result is valid against init object

func ValidateResults

func ValidateResults(
	operators []*Operator,
	withdrawalCredentials []byte,
	validatorPK []byte,
	fork [4]byte,
	ownerAddress [20]byte,
	nonce uint64,
	amount phase0.Gwei,
	requestID [24]byte,
	results []*Result,
) (*bls.PublicKey, *phase0.DepositData, *bls.Sign, error)

ValidateResults returns nil if results array is valid

func VerifyCeremonyProof

func VerifyCeremonyProof(pkBytes []byte, proof SignedProof) error

VerifyCeremonyProof returns error if ceremony signed proof is invalid

func VerifyPartialDepositDataSignatures

func VerifyPartialDepositDataSignatures(
	withdrawalCredentials []byte,
	fork [4]byte,
	validatorPubKey []byte,
	sigs []*bls.Sign,
	pks []*bls.PublicKey,
	amount phase0.Gwei,
) error

func VerifyPartialNonceSignatures

func VerifyPartialNonceSignatures(
	ownerAddress [20]byte,
	nonce uint64,
	sigs []*bls.Sign,
	pks []*bls.PublicKey,
) error

func VerifyPartialSignatures

func VerifyPartialSignatures(
	withdrawalCredentials []byte,
	fork [4]byte,
	ownerAddress [20]byte,
	nonce uint64,
	amount phase0.Gwei,
	result *Result,
) error

Types

type Init

type Init struct {
	// Operators involved in the DKG
	Operators []*Operator `ssz-max:"13"`
	// T is the threshold for signing
	T uint64
	// WithdrawalCredentials for deposit data
	WithdrawalCredentials []byte `ssz-max:"32"`
	// Fork ethereum fork for signing
	Fork [4]byte `ssz-size:"4"`
	// Owner address
	Owner [20]byte `ssz-size:"20"`
	// Owner nonce
	Nonce uint64
	// Amount in Gwei (https://eips.ethereum.org/EIPS/eip-7251)
	Amount uint64
}

func (*Init) GetTree

func (i *Init) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Init object

func (*Init) HashTreeRoot

func (i *Init) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Init object

func (*Init) HashTreeRootWith

func (i *Init) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Init object with a hasher

func (*Init) MarshalSSZ

func (i *Init) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Init object

func (*Init) MarshalSSZTo

func (i *Init) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Init object to a target array

func (*Init) SizeSSZ

func (i *Init) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Init object

func (*Init) UnmarshalSSZ

func (i *Init) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Init object

type Operator

type Operator struct {
	ID     uint64
	PubKey []byte `ssz-max:"2048"`
}

func GetOperator

func GetOperator(operators []*Operator, id uint64) *Operator

GetOperator returns operator by ID or nil if not found

func OrderOperators

func OrderOperators(in []*Operator) []*Operator

func (*Operator) GetTree

func (o *Operator) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Operator object

func (*Operator) HashTreeRoot

func (o *Operator) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Operator object

func (*Operator) HashTreeRootWith

func (o *Operator) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Operator object with a hasher

func (*Operator) Init

func (op *Operator) Init(
	init *Init,
	requestID [24]byte,
	sk *rsa.PrivateKey,
) (*Result, error)

Init is called on operator side when a new init message is received from initiator

func (*Operator) MarshalSSZ

func (o *Operator) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Operator object

func (*Operator) MarshalSSZTo

func (o *Operator) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Operator object to a target array

func (*Operator) Reshare

func (op *Operator) Reshare(
	signedReshare *SignedReshare,
	sk *rsa.PrivateKey,
	client eip1271.ETHClient,
) ([]*Result, error)

Reshare is called when an operator receives a reshare message

func (*Operator) Resign

func (op *Operator) Resign(
	signedResign *SignedResign,
	share *bls.SecretKey,
	sk *rsa.PrivateKey,
	client eip1271.ETHClient,
) ([]*Result, error)

Resign is called when an operator receives a re-sign message

func (*Operator) SizeSSZ

func (o *Operator) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Operator object

func (*Operator) UnmarshalSSZ

func (o *Operator) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Operator object

type Proof

type Proof struct {
	// ValidatorPubKey the resulting public key corresponding to the shared private key
	ValidatorPubKey []byte `ssz-size:"48"`
	// EncryptedShare standard SSV encrypted share
	EncryptedShare []byte `ssz-max:"512"`
	// SharePubKey is the share's BLS pubkey
	SharePubKey []byte `ssz-size:"48"`
	// Owner address
	Owner [20]byte `ssz-size:"20"`
}

Proof for a DKG ceremony

func (*Proof) GetTree

func (p *Proof) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Proof object

func (*Proof) HashTreeRoot

func (p *Proof) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Proof object

func (*Proof) HashTreeRootWith

func (p *Proof) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Proof object with a hasher

func (*Proof) MarshalSSZ

func (p *Proof) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Proof object

func (*Proof) MarshalSSZTo

func (p *Proof) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Proof object to a target array

func (*Proof) SizeSSZ

func (p *Proof) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Proof object

func (*Proof) UnmarshalSSZ

func (p *Proof) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Proof object

type Reshare

type Reshare struct {
	// ValidatorPubKey public key corresponding to the shared private key
	ValidatorPubKey []byte `ssz-size:"48"`
	// Operators involved in the DKG
	OldOperators []*Operator `ssz-max:"13"`
	// Operators involved in the resharing
	NewOperators []*Operator `ssz-max:"13"`
	// OldT is the old threshold for signing
	OldT uint64
	// NewT is the old threshold for signing
	NewT uint64
	// Fork ethereum fork for signing
	Fork [4]byte `ssz-size:"4"`
	// WithdrawalCredentials for deposit data
	WithdrawalCredentials []byte `ssz-max:"32"`
	// Owner address
	Owner [20]byte `ssz-size:"20"`
	// Owner nonce
	Nonce uint64
	// Amount in Gwei (https://eips.ethereum.org/EIPS/eip-7251)
	Amount uint64
}

func (*Reshare) GetTree

func (r *Reshare) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Reshare object

func (*Reshare) HashTreeRoot

func (r *Reshare) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Reshare object

func (*Reshare) HashTreeRootWith

func (r *Reshare) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Reshare object with a hasher

func (*Reshare) MarshalSSZ

func (r *Reshare) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Reshare object

func (*Reshare) MarshalSSZTo

func (r *Reshare) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Reshare object to a target array

func (*Reshare) SizeSSZ

func (r *Reshare) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Reshare object

func (*Reshare) UnmarshalSSZ

func (r *Reshare) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Reshare object

type ReshareMessage

type ReshareMessage struct {
	Reshare *Reshare
	Proofs  []*SignedProof `ssz-max:"13"`
}

func (*ReshareMessage) GetTree

func (r *ReshareMessage) GetTree() (*ssz.Node, error)

GetTree ssz hashes the ReshareMessage object

func (*ReshareMessage) HashTreeRoot

func (r *ReshareMessage) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the ReshareMessage object

func (*ReshareMessage) HashTreeRootWith

func (r *ReshareMessage) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the ReshareMessage object with a hasher

func (*ReshareMessage) MarshalSSZ

func (r *ReshareMessage) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the ReshareMessage object

func (*ReshareMessage) MarshalSSZTo

func (r *ReshareMessage) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the ReshareMessage object to a target array

func (*ReshareMessage) SizeSSZ

func (r *ReshareMessage) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the ReshareMessage object

func (*ReshareMessage) UnmarshalSSZ

func (r *ReshareMessage) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the ReshareMessage object

type Resign

type Resign struct {
	// ValidatorPubKey public key corresponding to the shared private key
	ValidatorPubKey []byte `ssz-size:"48"`
	// Fork ethereum fork for signing
	Fork [4]byte `ssz-size:"4"`
	// WithdrawalCredentials for deposit data
	WithdrawalCredentials []byte `ssz-max:"32"`
	// Owner address
	Owner [20]byte `ssz-size:"20"`
	// Owner nonce
	Nonce uint64
	// Amount in Gwei (https://eips.ethereum.org/EIPS/eip-7251)
	Amount uint64
}

func (*Resign) GetTree

func (r *Resign) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Resign object

func (*Resign) HashTreeRoot

func (r *Resign) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Resign object

func (*Resign) HashTreeRootWith

func (r *Resign) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Resign object with a hasher

func (*Resign) MarshalSSZ

func (r *Resign) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Resign object

func (*Resign) MarshalSSZTo

func (r *Resign) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Resign object to a target array

func (*Resign) SizeSSZ

func (r *Resign) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Resign object

func (*Resign) UnmarshalSSZ

func (r *Resign) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Resign object

type ResignMessage

type ResignMessage struct {
	Operators []*Operator `ssz-max:"13"`
	Resign    *Resign
	Proofs    []*SignedProof `ssz-max:"13"`
}

func (*ResignMessage) GetTree

func (r *ResignMessage) GetTree() (*ssz.Node, error)

GetTree ssz hashes the ResignMessage object

func (*ResignMessage) HashTreeRoot

func (r *ResignMessage) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the ResignMessage object

func (*ResignMessage) HashTreeRootWith

func (r *ResignMessage) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the ResignMessage object with a hasher

func (*ResignMessage) MarshalSSZ

func (r *ResignMessage) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the ResignMessage object

func (*ResignMessage) MarshalSSZTo

func (r *ResignMessage) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the ResignMessage object to a target array

func (*ResignMessage) SizeSSZ

func (r *ResignMessage) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the ResignMessage object

func (*ResignMessage) UnmarshalSSZ

func (r *ResignMessage) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the ResignMessage object

type Result

type Result struct {
	// Operator ID
	OperatorID uint64
	// RequestID for the DKG instance (not used for signing)
	RequestID [24]byte `ssz-size:"24"`
	// Partial Operator Signature of Deposit data
	DepositPartialSignature []byte `ssz-size:"96"`
	// SSV owner + nonce signature
	OwnerNoncePartialSignature []byte `ssz-size:"96"`
	// Signed proof for the ceremony
	SignedProof SignedProof
}

Result is the last message in every DKG which marks a specific node's end of process

func BuildResult

func BuildResult(
	operatorID uint64,
	requestID [24]byte,
	share *bls.SecretKey,
	sk *rsa.PrivateKey,
	validatorPK []byte,
	owner [20]byte,
	withdrawalCredentials []byte,
	fork [4]byte,
	nonce uint64,
	amount phase0.Gwei,
) (*Result, error)

func RunDKG

func RunDKG(init *Init) ([]*Result, error)

RunDKG is called when an initiator wants to start a new DKG ceremony

func (*Result) GetTree

func (r *Result) GetTree() (*ssz.Node, error)

GetTree ssz hashes the Result object

func (*Result) HashTreeRoot

func (r *Result) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Result object

func (*Result) HashTreeRootWith

func (r *Result) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the Result object with a hasher

func (*Result) MarshalSSZ

func (r *Result) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Result object

func (*Result) MarshalSSZTo

func (r *Result) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Result object to a target array

func (*Result) SizeSSZ

func (r *Result) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Result object

func (*Result) UnmarshalSSZ

func (r *Result) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Result object

type SSZMarshaller

type SSZMarshaller interface {
	MarshalSSZ() ([]byte, error)
	UnmarshalSSZ(buf []byte) error
}

type SignedProof

type SignedProof struct {
	Proof *Proof
	// Signature is an RSA signature over proof
	Signature []byte `ssz-size:"256"`
}

func (*SignedProof) GetTree

func (s *SignedProof) GetTree() (*ssz.Node, error)

GetTree ssz hashes the SignedProof object

func (*SignedProof) HashTreeRoot

func (s *SignedProof) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the SignedProof object

func (*SignedProof) HashTreeRootWith

func (s *SignedProof) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the SignedProof object with a hasher

func (*SignedProof) MarshalSSZ

func (s *SignedProof) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the SignedProof object

func (*SignedProof) MarshalSSZTo

func (s *SignedProof) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the SignedProof object to a target array

func (*SignedProof) SizeSSZ

func (s *SignedProof) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the SignedProof object

func (*SignedProof) UnmarshalSSZ

func (s *SignedProof) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the SignedProof object

type SignedReshare

type SignedReshare struct {
	Messages []*ReshareMessage `ssz-max:"100"`
	// Signature is an ECDSA signature over the hash of the resign messages array
	Signature []byte `ssz-max:"1536"` // 64 * 24
}

func (*SignedReshare) GetTree

func (s *SignedReshare) GetTree() (*ssz.Node, error)

GetTree ssz hashes the SignedReshare object

func (*SignedReshare) HashTreeRoot

func (s *SignedReshare) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the SignedReshare object

func (*SignedReshare) HashTreeRootWith

func (s *SignedReshare) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the SignedReshare object with a hasher

func (*SignedReshare) MarshalSSZ

func (s *SignedReshare) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the SignedReshare object

func (*SignedReshare) MarshalSSZTo

func (s *SignedReshare) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the SignedReshare object to a target array

func (*SignedReshare) SizeSSZ

func (s *SignedReshare) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the SignedReshare object

func (*SignedReshare) UnmarshalSSZ

func (s *SignedReshare) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the SignedReshare object

type SignedResign

type SignedResign struct {
	Messages []*ResignMessage `ssz-max:"100"`
	// Signature is an ECDSA signature over the hash of the resign messages array
	Signature []byte `ssz-max:"1536"` // 64 * 24
}

func (*SignedResign) GetTree

func (s *SignedResign) GetTree() (*ssz.Node, error)

GetTree ssz hashes the SignedResign object

func (*SignedResign) HashTreeRoot

func (s *SignedResign) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the SignedResign object

func (*SignedResign) HashTreeRootWith

func (s *SignedResign) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the SignedResign object with a hasher

func (*SignedResign) MarshalSSZ

func (s *SignedResign) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the SignedResign object

func (*SignedResign) MarshalSSZTo

func (s *SignedResign) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the SignedResign object to a target array

func (*SignedResign) SizeSSZ

func (s *SignedResign) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the SignedResign object

func (*SignedResign) UnmarshalSSZ

func (s *SignedResign) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the SignedResign object

Directories

Path Synopsis
testing

Jump to

Keyboard shortcuts

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