Skip to content

Instantly share code, notes, and snippets.

@tzdybal
Created September 15, 2023 06:19
Show Gist options
  • Save tzdybal/10c07354a7f4f7c9bf8a5b9966b4d247 to your computer and use it in GitHub Desktop.
Save tzdybal/10c07354a7f4f7c9bf8a5b9966b4d247 to your computer and use it in GitHub Desktop.
minimalistic general modular DA interface
package da
type DA interface {
Get(id ID) (Blob, error)
Commit(blob Blob) (Commitement, error)
Submit(blob Blob) (ID, Proof, error)
Validate(commit Commitement, proof Proof) (bool, error)
}
type BatchDA interface {
Get(ids []ID) ([]Blob, error)
Commit(blobs []Blob) ([]Commitement, error)
Submit(blobs []Blob) ([]ID, []Proof, error)
Validate(commits []Commitement, proofs []Proof) ([]bool, error)
}
type Blob []byte
type ID []byte
type Proof []byte
type Commitement []byte
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment