Expand description
This module defines the read proof prover and verifier. Given a query vector q, a vector of data d, and a commitment to this data C, the prover will return an answer a and a proof that the answers correspond to the data committed in C at the specified indexes in the query.
The folding version is TBD
We call data the data vector that is stored and queried
We call answer the vector such that answer[i] = data[i] * query[i]
The considered protocol involves a user, the chain and the storage provider and behaves as following:
- The user sends a request to the chain, containing a commitment to a data handled by the storage provider with a query that specifies which indexes to read.
- The chains includes the query if it’s valid and computes the commitment to the query.
- The state replicator fetch the request with the data & query commitments on the chain, computes the corresponding answer & proof, and sends it to the chain.
- The chain includes the proof if it verifies, and if it’s consistent with the provided answer.
Structs§
- Answer
- Answer to a query regarding some data
- Query
- Indexes of the data to be read ; this will be stored onchain Note: indexes are represented with u16, matching indexes from 0 to 2¹⁶ - 1. If the SRS is made bigger, the integer type has to handle this
- Read
Proof
Functions§
- prove
- verify
- verify_
answer - Checks that the provided answer is consistent with the proof Here, we just recompute the commitment TODO: could we just recompute the evaluation ?