Documentation
¶
Overview ¶
Package ipa provides an IPA (Inner Product Argument) commitment backend.
Index ¶
- Constants
- type Scheme
- func (s *Scheme) BatchProve(values []commitment.Cell, indices []uint64) (cid.Cid, []commitment.Cell, []byte, error)
- func (s *Scheme) BatchProveAtRoot(root cid.Cid, values []commitment.Cell, indices []uint64) ([]commitment.Cell, []byte, error)
- func (s *Scheme) BatchVerify(comm cid.Cid, indices []uint64, values []commitment.Cell, proof []byte) (bool, error)
- func (s *Scheme) Commit(values []commitment.Cell) (cid.Cid, error)
- func (s *Scheme) MaxValues() int
- func (s *Scheme) PrepareOpening(values []commitment.Cell) (commitment.IndexOpening, error)
- func (s *Scheme) Prove(values []commitment.Cell, index uint64) (cid.Cid, commitment.Cell, []byte, error)
- func (s *Scheme) ProveAtRoot(root cid.Cid, values []commitment.Cell, index uint64) (commitment.Cell, []byte, error)
- func (s *Scheme) Replace(values []commitment.Cell, index uint64, oldValue, newValue commitment.Cell) (cid.Cid, error)
- func (s *Scheme) VerifyIndex(comm cid.Cid, index uint64, value commitment.Cell, proof []byte) (bool, error)
- func (s *Scheme) VerifyProof(comm cid.Cid, value commitment.Cell, proof []byte) (bool, error)
Constants ¶
const ( // MaxValues is the maximum number of values per commitment. MaxValues = 256 // ProofSize is the size of a primitive IPA index proof in bytes. // For 256 elements: numRounds=8, size=4 + 8*32(L) + 8*32(R) + 32(A_scalar) + 4(index) = 552 ProofSize = 552 // MaxCacheEntries is the maximum number of cached commitments. // When exceeded, the oldest entries are evicted. MaxCacheEntries = 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Scheme ¶
type Scheme struct {
// contains filtered or unexported fields
}
Scheme implements an IPA-based index commitment backend.
func (*Scheme) BatchProve ¶
func (s *Scheme) BatchProve(values []commitment.Cell, indices []uint64) (cid.Cid, []commitment.Cell, []byte, error)
BatchProve proves multiple stable indices with one batch proof payload.
func (*Scheme) BatchProveAtRoot ¶
func (s *Scheme) BatchProveAtRoot(root cid.Cid, values []commitment.Cell, indices []uint64) ([]commitment.Cell, []byte, error)
BatchProveAtRoot opens values against a caller-supplied root without recomputing the IPA commitment.
func (*Scheme) BatchVerify ¶
func (s *Scheme) BatchVerify(comm cid.Cid, indices []uint64, values []commitment.Cell, proof []byte) (bool, error)
BatchVerify verifies a batch proof for an ordered index list.
func (*Scheme) PrepareOpening ¶
func (s *Scheme) PrepareOpening(values []commitment.Cell) (commitment.IndexOpening, error)
PrepareOpening computes a commitment once and returns an opaque witness whose Open method reuses that commitment in the IPA transcript.
func (*Scheme) Prove ¶
func (s *Scheme) Prove(values []commitment.Cell, index uint64) (cid.Cid, commitment.Cell, []byte, error)
Prove proves the value at a stable index.
func (*Scheme) ProveAtRoot ¶
func (s *Scheme) ProveAtRoot(root cid.Cid, values []commitment.Cell, index uint64) (commitment.Cell, []byte, error)
ProveAtRoot opens values against a caller-supplied root without recomputing the IPA commitment. The generated proof is verified before it is returned so inconsistent client materialization fails closed.
func (*Scheme) Replace ¶
func (s *Scheme) Replace(values []commitment.Cell, index uint64, oldValue, newValue commitment.Cell) (cid.Cid, error)
Replace performs an index-stable replacement.
func (*Scheme) VerifyIndex ¶
func (s *Scheme) VerifyIndex(comm cid.Cid, index uint64, value commitment.Cell, proof []byte) (bool, error)
VerifyIndex verifies a proof for a stable index without requiring cache state.
func (*Scheme) VerifyProof ¶
VerifyProof verifies a proof carrying its own index metadata.