verify

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBatchMetadataHashNotFound = errors.New("BatchMetadataHash not found for BatchId")
View Source
var (
	ErrInvalidDomainType = fmt.Errorf("invalid domain type")
)

Functions

func HashBatchHashedMetadata added in v1.1.1

func HashBatchHashedMetadata(batchHeaderHash [32]byte, signatoryRecordHash [32]byte, blockNumber uint32) (geth_common.Hash, error)

HashBatchHashedMetadata hashes the given metadata into the commitment that will be stored in the contract replicates: https://github.com/Layr-Labs/eigenda-utils/blob/c4cbc9ec078aeca3e4a04bd278e2fb136bf3e6de/src/libraries/EigenDAHasher.sol#L19-L25

func HashBatchMetadata added in v1.1.1

func HashBatchMetadata(bh *binding.IEigenDAServiceManagerBatchHeader, sigHash [32]byte, blockNum uint32) (geth_common.Hash, error)

HashBatchMetadata regenerates a batch data hash replicates: https://github.com/Layr-Labs/eigenda-utils/blob/c4cbc9ec078aeca3e4a04bd278e2fb136bf3e6de/src/libraries/EigenDAHasher.sol#L46-L54

func HashBlobHeader added in v1.1.1

func HashBlobHeader(blobHeader BlobHeader) (geth_common.Hash, error)

HashBlobHeader function to hash BlobHeader

func HashEncodeBlobHeader added in v1.1.1

func HashEncodeBlobHeader(header BlobHeader) (geth_common.Hash, error)

Function to hash and encode header

func ProcessInclusionProof added in v1.1.1

func ProcessInclusionProof(proof []byte, leaf common.Hash, index uint64) (common.Hash, error)

ProcessInclusionProof processes the Merkle proof

Types

type BlobHeader added in v1.2.0

type BlobHeader struct {
	Commitment       G1Point
	DataLength       uint32
	QuorumBlobParams []QuorumBlobParam
}

BlobHeader struct to represent BlobHeader in Solidity

type CertVerifier added in v1.1.1

type CertVerifier struct {
	// contains filtered or unexported fields
}

CertVerifier verifies the DA certificate against on-chain EigenDA contracts to ensure disperser returned fields haven't been tampered with

func NewCertVerifier added in v1.1.1

func NewCertVerifier(cfg *Config, l log.Logger) (*CertVerifier, error)

func (*CertVerifier) VerifyBatch added in v1.1.1

func (cv *CertVerifier) VerifyBatch(header *binding.IEigenDAServiceManagerBatchHeader,
	id uint32, recordHash [32]byte, confirmationNumber uint32) error

func (*CertVerifier) VerifyMerkleProof added in v1.1.1

func (cv *CertVerifier) VerifyMerkleProof(inclusionProof []byte, root []byte, blobIndex uint32, blobHeader BlobHeader) error

VerifyMerkleProof ... Verifies the blob batch inclusion proof against the blob root hash

type Certificate added in v1.2.0

type Certificate disperser.BlobInfo

func (*Certificate) BatchHeaderRoot added in v1.2.0

func (c *Certificate) BatchHeaderRoot() []byte

func (*Certificate) BlobIndex added in v1.2.0

func (c *Certificate) BlobIndex() uint32

func (*Certificate) Proof added in v1.2.0

func (*Certificate) ReadBlobHeader added in v1.2.0

func (c *Certificate) ReadBlobHeader() BlobHeader

type Config added in v1.1.1

type Config struct {
	Verify               bool
	RPCURL               string
	SvcManagerAddr       string
	KzgConfig            *kzg.KzgConfig
	EthConfirmationDepth uint64
}

type G1Point added in v1.2.0

type G1Point struct {
	X *big.Int
	Y *big.Int
}

G1Point struct to represent G1Point in Solidity

type QuorumBlobParam added in v1.2.0

type QuorumBlobParam struct {
	QuorumNumber                    uint8
	AdversaryThresholdPercentage    uint8
	ConfirmationThresholdPercentage uint8
	ChunkLength                     uint32
}

QuorumBlobParam struct to represent QuorumBlobParam in Solidity

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

func NewVerifier

func NewVerifier(cfg *Config, l log.Logger) (*Verifier, error)

func (*Verifier) Commit

func (v *Verifier) Commit(blob []byte) (*bn254.G1Affine, error)

func (*Verifier) VerifyCert added in v1.1.1

func (v *Verifier) VerifyCert(cert *Certificate) error

func (*Verifier) VerifyCommitment added in v1.1.1

func (v *Verifier) VerifyCommitment(expectedCommit *common.G1Commitment, blob []byte) error

Verify regenerates a commitment from the blob and asserts equivalence to the commitment in the certificate TODO: Optimize implementation by opening a point on the commitment instead

func (*Verifier) VerifySecurityParams added in v1.1.1

func (v *Verifier) VerifySecurityParams(blobHeader BlobHeader, batchHeader binding.IEigenDAServiceManagerBatchHeader) error

VerifySecurityParams ensures that returned security parameters are valid

Jump to

Keyboard shortcuts

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