kzg

package
v0.0.0-...-92d349b Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	BlobCommitmentVersionKZG uint8 = 0x01
	FieldElementsPerBlob     int   = 4096
)
View Source
const (
	BlobTxType                = 5
	PrecompileInputLength     = 192
	BlobVersionedHashesOffset = 258 // position of blob_versioned_hashes offset in a serialized blob tx, see TxPeekBlobVersionedHashes
)

Variables

This section is empty.

Functions

func CrpytoCtx

func CrpytoCtx() gokzg4844.Context

CryptoCtx returns a context object stores all of the necessary configurations to allow one to create and verify blob proofs. This function is expensive to run if the crypto context isn't initialized, so it is recommended to pre-initialize by calling InitializeCryptoCtx

func InitializeCrypytoCtx

func InitializeCrypytoCtx()

InitializeCrypytoCtx initializes the global context object returned via CryptoCtx

func PointEvaluationPrecompile

func PointEvaluationPrecompile(input []byte) ([]byte, error)

PointEvaluationPrecompile implements point_evaluation_precompile from EIP-4844

Types

type BlobsSidecar

type BlobsSidecar struct {
	BeaconBlockRoot Root
	BeaconBlockSlot Slot
	Blobs           []gokzg4844.Blob
	Proofs          []gokzg4844.KZGProof
}

type Root

type Root [32]byte

type Slot

type Slot uint64

type VersionedHash

type VersionedHash [32]byte

func KZGToVersionedHash

func KZGToVersionedHash(kzg gokzg4844.KZGCommitment) VersionedHash

KZGToVersionedHash implements kzg_to_versioned_hash from EIP-4844

Jump to

Keyboard shortcuts

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