Documentation ¶
Index ¶
- Variables
- func BlobsToShares(blobs ...*Blob) ([]share.Share, error)
- type Blob
- type Commitment
- type Proof
- type Service
- func (s *Service) Get(ctx context.Context, height uint64, nID namespace.ID, commitment Commitment) (*Blob, error)
- func (s *Service) GetAll(ctx context.Context, height uint64, nIDs ...namespace.ID) ([]*Blob, error)
- func (s *Service) GetProof(ctx context.Context, height uint64, nID namespace.ID, commitment Commitment) (*Proof, error)
- func (s *Service) Included(ctx context.Context, height uint64, nID namespace.ID, proof *Proof, ...) (bool, error)
- func (s *Service) Submit(ctx context.Context, blobs ...*Blob) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrBlobNotFound = errors.New("blob: not found") ErrInvalidProof = errors.New("blob: invalid proof") )
Functions ¶
Types ¶
type Blob ¶
type Blob struct { types.Blob Commitment Commitment }
Blob represents any application-specific binary data that anyone can submit to Celestia.
func SharesToBlobs ¶
SharesToBlobs takes raw shares and converts them to the blobs.
type Commitment ¶
type Commitment []byte
Commitment is a Merkle Root of the subtree built from shares of the Blob. It is computed by splitting the blob into shares and building the Merkle subtree to be included after Submit.
func (Commitment) Equal ¶
func (com Commitment) Equal(c Commitment) bool
Equal ensures that commitments are the same
func (Commitment) String ¶
func (com Commitment) String() string
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) Get ¶
func (s *Service) Get(ctx context.Context, height uint64, nID namespace.ID, commitment Commitment) (*Blob, error)
Get retrieves all the blobs for given namespaces at the given height by commitment.
func (*Service) GetAll ¶
GetAll returns all blobs under the given namespaces at the given height. GetAll can return blobs and an error in case if some requests failed.
func (*Service) GetProof ¶
func (s *Service) GetProof( ctx context.Context, height uint64, nID namespace.ID, commitment Commitment, ) (*Proof, error)
GetProof retrieves all blobs in the given namespaces at the given height by commitment and returns their Proof.
func (*Service) Included ¶
func (s *Service) Included( ctx context.Context, height uint64, nID namespace.ID, proof *Proof, com Commitment, ) (bool, error)
Included verifies that the blob was included in a specific height. To ensure that blob was included in a specific height, we need: 1. verify the provided commitment by recomputing it; 2. verify the provided Proof against subtree roots that were used in 1.;