kzg4844

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package kzg4844 implements the KZG crypto for EIP-4844.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeProof

func ComputeProof(blob Blob, point Point) (Proof, Claim, error)

ComputeProof computes the KZG proof at the given point for the polynomial represented by the blob.

func UseCKZG

func UseCKZG(use bool) error

UseCKZG can be called to switch the default Go implementation of KZG to the C library if fo some reason the user wishes to do so (e.g. consensus bug in one or the other).

func VerifyBlobProof

func VerifyBlobProof(blob Blob, commitment Commitment, proof Proof) error

VerifyBlobProof verifies that the blob data corresponds to the provided commitment.

func VerifyProof

func VerifyProof(commitment Commitment, point Point, claim Claim, proof Proof) error

VerifyProof verifies the KZG proof that the polynomial represented by the blob evaluated at the given point is the claimed value.

Types

type Blob

type Blob [131072]byte

Blob represents a 4844 data blob.

type Claim

type Claim [32]byte

Claim is a claimed evaluation value in a specific point.

type Commitment

type Commitment [48]byte

Commitment is a serialized commitment to a polynomial.

func BlobToCommitment

func BlobToCommitment(blob Blob) (Commitment, error)

BlobToCommitment creates a small commitment out of a data blob.

type Point

type Point [32]byte

Point is a BLS field element.

type Proof

type Proof [48]byte

Proof is a serialized commitment to the quotient polynomial.

func ComputeBlobProof

func ComputeBlobProof(blob Blob, commitment Commitment) (Proof, error)

ComputeBlobProof returns the KZG proof that is used to verify the blob against the commitment.

This method does not verify that the commitment is correct with respect to blob.

Jump to

Keyboard shortcuts

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