proof_of_sql::base::database

Trait CommitmentAccessor

source
pub trait CommitmentAccessor<C: Commitment>: MetadataAccessor {
    // Required method
    fn get_commitment(&self, column: ColumnRef) -> C;
}
Expand description

Access commitments of database columns.

Verifier uses this information to process a query.

In pseudo-code, here is a sketch of how CommitmentAccessor fits in with the verification workflow:

verify(proof, query, commitment_database) {
    if(!validate_query(query, commitment_database)) {
        // if the query references columns that don't exist
        // we should error here before going any further
        return invalid-query()
    }
    commitment_database.reader_lock()
    // we can't be updating commitments while verifying
    accessor <- make-commitment-accessor(commitment_database)
    verify_result <- verify-valid-query(proof, query, accessor)
    commitment_database.reader_unlock()
    return verify_result
}

Note: we assume that the query has already been validated so that we will only be accessing information about columns that exist in the database.

Required Methods§

source

fn get_commitment(&self, column: ColumnRef) -> C

Return the full table column commitment

Implementors§