vrf

package module
v0.0.0-...-be50d8c Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitPreSeedData

func InitPreSeedData(preSeed, blockHash, sender string, blockNum, subID uint64, cbGasLimit, numWords uint32) (vrfProof.PreSeedData, error)

func MakeVRFProofMarshalResponse

func MakeVRFProofMarshalResponse(privateKeyHex string, preSeed vrfProof.PreSeedData) (string, error)

Types

type VRFProof

type VRFProof struct {
	Pk            [2]*big.Int    `json:"PublicKey"`
	Gamma         [2]*big.Int    `json:"Gamma"`
	C             *big.Int       `json:"C"`
	S             *big.Int       `json:"S"`
	Seed          *big.Int       `json:"Seed"`
	UWitness      common.Address `json:"UWitness"`
	CGammaWitness [2]*big.Int    `json:"CGammaWitness"`
	SHashWitness  [2]*big.Int    `json:"SHashWitness"`
	ZInv          *big.Int       `json:"ZInv"`
}

type VRFRequestCommitment

type VRFRequestCommitment struct {
	BlockNum         uint64         `json:"BlockNum"`
	SubId            uint64         `json:"SubId"`
	CallbackGasLimit uint32         `json:"CallbackGasLimit"`
	NumWords         uint32         `json:"NumWords"`
	Sender           common.Address `json:"Sender"`
}

type VRFResponse

type VRFResponse struct {
	Proof      VRFProof             `json:"VRFProof"`
	Commitment VRFRequestCommitment `json:"VRFRequestCommitment"`
}

func GenerateVRFProofResponse

func GenerateVRFProofResponse(privateKeyHex string, preSeed vrfProof.PreSeedData) (*VRFResponse, error)

func (*VRFResponse) GenerateProofResponseFromProof

func (v *VRFResponse) GenerateProofResponseFromProof(p vrfProof.Proof, s vrfProof.PreSeedData) error

Directories

Path Synopsis
* The MIT License (MIT)
* The MIT License (MIT)

Jump to

Keyboard shortcuts

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