Skip to main content

Crate drive_proof_verifier

Crate drive_proof_verifier 

Source
Expand description

Proof verification library for Dash Drive

Re-exports§

pub use error::Error;

Modules§

error
Errors that can occur during proof verification
from_request
From Request Conversions between Drive queries and dapi-grpc requests.
types
Object types that can be retrieved from proofs.
unproved
Implementation of unproved verification

Structs§

AverageEntry
A single per-key average entry. Carries BOTH count and sum so the client can divide; the server intentionally doesn’t pre-divide (see the module docstring).
DocumentAverage
Verified average result types. Average-side analog of DocumentSum / DocumentSplitSums; carry the (count, sum) pair the verifier recovers from grovedb PR 670’s AggregateCountAndSumOnRange primitive. Client computes avg = sum / count. The (count, sum) pair across documents matching a query, verified from proof. Client computes avg = sum / count using whichever precision representation it wants.
DocumentCount
The count of documents matching a query, verified from proof.
DocumentSplitAverages
The full per-entry average result, verified from proof.
DocumentSplitCounts
The split counts of documents matching a query, verified from proof.
DocumentSplitSums
Verified sum result types. Sum-side analogs of DocumentCount / DocumentSplitCounts; see their respective module docs for the grovedb PR 670 dependency status. The full per-entry sum result, verified from proof.
DocumentSum
The aggregated sum of an integer property across documents matching a query, verified from proof.
MockContextProvider
Mock ContextProvider that can read quorum keys from files.
SplitAverageEntry
A single verified (in_key?, key, count, sum) entry from an average query with group_by. Mirrors sum’s SplitSumEntry shape with both metrics carried alongside.
SplitCountEntry
An entry in a split count result, containing the serialized key(s) and the count of documents matching them.
SplitSumEntry
Verified sum result types. Sum-side analogs of DocumentCount / DocumentSplitCounts; see their respective module docs for the grovedb PR 670 dependency status. A single verified (in_key?, key, sum) entry from a sum query with group_by. Mirrors count’s SplitCountEntry shape.
SumEntry
A single per-key sum entry, parallels count’s SplitCountEntry.

Enums§

ContextProviderError
Errors returned by the context provider

Traits§

ContextProvider
Interface between the Sdk and state of the application.
DataContractProvider
A trait that provides a function that can be used to look up a [DataContract] by its [Identifier].
FromProof
Parse and verify the received proof and retrieve the requested object, if any.
Length
Determine number of non-None elements

Functions§

verify_aggregate_count_and_sum_proof
Verified average result types. Average-side analog of DocumentSum / DocumentSplitSums; carry the (count, sum) pair the verifier recovers from grovedb PR 670’s AggregateCountAndSumOnRange primitive. Client computes avg = sum / count. Verify a leaf-PCPS AggregateCountAndSumOnRange proof and the surrounding tenderdash commit, returning the verified (count, sum) pair. Used by the prove path’s select=AVG, group_by=[] with a range clause on an index that declares BOTH rangeCountable: true AND rangeSummable: true (i.e. the terminator is a ProvableCountProvableSumTree).
verify_aggregate_count_proof
Verify a grovedb AggregateCountOnRange proof and the surrounding tenderdash commit, returning the verified document count.
verify_aggregate_sum_proof
Verify a grovedb AggregateSumOnRange proof and the surrounding tenderdash commit, returning the verified i64 sum from one range traversal. Used by the prove path’s select=SUM, group_by=[] with a range clause on a rangeSummable: true index.
verify_carrier_aggregate_count_and_sum_proof
Verified average result types. Average-side analog of DocumentSum / DocumentSplitSums; carry the (count, sum) pair the verifier recovers from grovedb PR 670’s AggregateCountAndSumOnRange primitive. Client computes avg = sum / count. Verify a carrier-PCPS AggregateCountAndSumOnRange proof and return the per-In-branch (count, sum) triples. AVG analog of count’s super::document_count::verify_carrier_aggregate_count_proof and sum’s super::document_sum::verify_carrier_aggregate_sum_proof.
verify_carrier_aggregate_count_proof
Verify a carrier AggregateCountOnRange proof against a rangeCountable: true index and return the per-In-branch counts.
verify_carrier_aggregate_sum_proof
Verify a carrier AggregateSumOnRange proof against a rangeSummable: true index and return the per-In-branch sums.
verify_distinct_count_and_sum_proof
Verified average result types. Average-side analog of DocumentSum / DocumentSplitSums; carry the (count, sum) pair the verifier recovers from grovedb PR 670’s AggregateCountAndSumOnRange primitive. Client computes avg = sum / count. Verify a per-distinct-key range-AVG proof against an index that declares BOTH rangeCountable: true AND rangeSummable: true (a rangeAverageable: true index) and return per-(in_key, key) (count, sum) entries. AVG analog of super::document_sum::verify_distinct_sum_proof.
verify_distinct_count_proof
Verify a regular grovedb range proof against a ProvableCountTree and the surrounding tenderdash commit, returning the verified per-(in_key, key) counts the proof commits to.
verify_distinct_sum_proof
Verify a per-distinct-key range-sum proof against a rangeSummable: true index and return the per-(in_key, key) sums.
verify_point_lookup_count_and_sum_proof
Verified average result types. Average-side analog of DocumentSum / DocumentSplitSums; carry the (count, sum) pair the verifier recovers from grovedb PR 670’s AggregateCountAndSumOnRange primitive. Client computes avg = sum / count. Verify a grovedb point-lookup proof against a count-sum-bearing index terminator and return per-branch (count, sum) entries. AVG analog of super::document_sum::verify_point_lookup_sum_proof.
verify_point_lookup_count_proof
Verify a grovedb point-lookup count proof against a countable: true index and return the per-branch entries.
verify_point_lookup_sum_proof
Verify a grovedb point-lookup sum proof and return the per-branch entries. Sum analog of count’s super::document_count::verify_point_lookup_count_proof.
verify_primary_key_count_sum_tree_proof
Verified average result types. Average-side analog of DocumentSum / DocumentSplitSums; carry the (count, sum) pair the verifier recovers from grovedb PR 670’s AggregateCountAndSumOnRange primitive. Client computes avg = sum / count. Verify a grovedb proof of the document type’s primary-key count-sum-bearing element (CountSumTree / ProvableCountSumTree / ProvableCountProvableSumTree) and return the unfiltered (count, sum) pair.
verify_primary_key_count_tree_proof
Verify a grovedb proof of the document type’s primary-key CountTree element and return the unfiltered total count.
verify_primary_key_sum_tree_proof
Verify a grovedb proof of the document type’s primary-key SumTree element and return the unfiltered total sum.