Documentation
¶
Overview ¶
Package contribution implements all phases (initialization, contribution, verification) of a multi-party computation setup ceremony.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Contributable ¶
type Contributable interface {
Contribute()
ReadFrom(reader io.Reader) (int64, error)
WriteTo(writer io.Writer) (int64, error)
}
Contributable is an interface for a contribution object that is going to be contributed to.
func NewContributable ¶
func NewContributable() Contributable
NewContributable returns a new empty contribution instance implementing Contributable.
type Contribution ¶
type Contribution interface {
NewVerifiable() Verifiable
AddContribution(next Verifiable) error
ExtractKeys() (groth16.ProvingKey, groth16.VerifyingKey, error)
WriteTo(writer io.Writer) (int64, error)
GetCount() int
}
Contribution is an interface for doing operations on a contribution from the ceremony coordinator perspective.
func New ¶
func New(phase1 *mpcsetup.Phase1, r1cs *cs.R1CS, storage storage.Storage, beacon []byte) (Contribution, error)
New creates a new Contribution from a Phase 1 object, R1CS and beacon.
phase1 is the Phase 1 object produced either by Gnark of by the `ptau` command from a Snarkjs file. r1cs is the R1CS constraint system object generated by Gnark for a circuit the ceremony is performed for. storage is a storage service that will be used to store contribution artifacts. It can be nil, then artifacts will not be stored. beacon is a 32-byte array of random bytes. It is used for sealing Phase 1 and later for keys generation.