da

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 0 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

type Blob = []byte

Blob is the data submitted/received from DA interface.

type Commitment

type Commitment = []byte

Commitment should contain serialized cryptographic commitment to Blob value.

type DA

type DA interface {
	// MaxBlobSize returns the max blob size
	MaxBlobSize() (uint64, error)

	// Get returns Blob for each given ID, or an error.
	//
	// Error should be returned if ID is not formatted properly, there is no Blob for given ID or any other client-level
	// error occurred (dropped connection, timeout, etc).
	Get(ids []ID) ([]Blob, error)

	// GetIDs returns IDs of all Blobs located in DA at given height.
	GetIDs(height uint64) ([]ID, error)

	// Commit creates a Commitment for each given Blob.
	Commit(blobs []Blob) ([]Commitment, error)

	// Submit submits the Blobs to Data Availability layer.
	//
	// This method is synchronous. Upon successful submission to Data Availability layer, it returns ID identifying blob
	// in DA and Proof of inclusion.
	// If options is nil, default options are used.
	Submit(blobs []Blob, options *SubmitOptions) ([]ID, []Proof, error)

	// Validate validates Commitments against the corresponding Proofs. This should be possible without retrieving the Blobs.
	Validate(ids []ID, proofs []Proof) ([]bool, error)
}

DA defines very generic interface for interaction with Data Availability layers.

type ID

type ID = []byte

ID should contain serialized data required by the implementation to find blob in Data Availability layer.

type Proof

type Proof = []byte

Proof should contain serialized proof of inclusion (publication) of Blob in Data Availability layer.

type SubmitOptions

type SubmitOptions struct {
	Fee int64
	Gas uint64
}

SubmitOptions contains the information about fee and gas price in order to configure the Submit request.

func DefaultSubmitOptions

func DefaultSubmitOptions() *SubmitOptions

DefaultSubmitOptions creates a default fee and gas price values.

Directories

Path Synopsis
types

Jump to

Keyboard shortcuts

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