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§
- Average
Entry - 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).
- Document
Average - Verified average result types. Average-side analog of
DocumentSum/DocumentSplitSums; carry the(count, sum)pair the verifier recovers from grovedb PR 670’sAggregateCountAndSumOnRangeprimitive. Client computesavg = sum / count. The(count, sum)pair across documents matching a query, verified from proof. Client computesavg = sum / countusing whichever precision representation it wants. - Document
Count - The count of documents matching a query, verified from proof.
- Document
Split Averages - The full per-entry average result, verified from proof.
- Document
Split Counts - The split counts of documents matching a query, verified from proof.
- Document
Split Sums - 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. - Document
Sum - The aggregated sum of an integer property across documents matching a query, verified from proof.
- Mock
Context Provider - Mock ContextProvider that can read quorum keys from files.
- Split
Average Entry - A single verified
(in_key?, key, count, sum)entry from an average query withgroup_by. Mirrors sum’sSplitSumEntryshape with both metrics carried alongside. - Split
Count Entry - An entry in a split count result, containing the serialized key(s) and the count of documents matching them.
- Split
SumEntry - 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 withgroup_by. Mirrors count’sSplitCountEntryshape. - SumEntry
- A single per-key sum entry, parallels count’s
SplitCountEntry.
Enums§
- Context
Provider Error - Errors returned by the context provider
Traits§
- Context
Provider - Interface between the Sdk and state of the application.
- Data
Contract Provider - A trait that provides a function that can be used to look up a [DataContract] by its [Identifier].
- From
Proof - 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’sAggregateCountAndSumOnRangeprimitive. Client computesavg = sum / count. Verify a leaf-PCPSAggregateCountAndSumOnRangeproof and the surrounding tenderdash commit, returning the verified(count, sum)pair. Used by the prove path’sselect=AVG, group_by=[]with a range clause on an index that declares BOTHrangeCountable: trueANDrangeSummable: true(i.e. the terminator is aProvableCountProvableSumTree). - verify_
aggregate_ count_ proof - Verify a grovedb
AggregateCountOnRangeproof and the surrounding tenderdash commit, returning the verified document count. - verify_
aggregate_ sum_ proof - Verify a grovedb
AggregateSumOnRangeproof and the surrounding tenderdash commit, returning the verifiedi64sum from one range traversal. Used by the prove path’sselect=SUM, group_by=[]with a range clause on arangeSummable: trueindex. - 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’sAggregateCountAndSumOnRangeprimitive. Client computesavg = sum / count. Verify a carrier-PCPSAggregateCountAndSumOnRangeproof and return the per-In-branch(count, sum)triples. AVG analog of count’ssuper::document_count::verify_carrier_aggregate_count_proofand sum’ssuper::document_sum::verify_carrier_aggregate_sum_proof. - verify_
carrier_ aggregate_ count_ proof - Verify a carrier
AggregateCountOnRangeproof against arangeCountable: trueindex and return the per-In-branch counts. - verify_
carrier_ aggregate_ sum_ proof - Verify a carrier
AggregateSumOnRangeproof against arangeSummable: trueindex 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’sAggregateCountAndSumOnRangeprimitive. Client computesavg = sum / count. Verify a per-distinct-key range-AVG proof against an index that declares BOTHrangeCountable: trueANDrangeSummable: true(arangeAverageable: trueindex) and return per-(in_key, key)(count, sum)entries. AVG analog ofsuper::document_sum::verify_distinct_sum_proof. - verify_
distinct_ count_ proof - Verify a regular grovedb range proof against a
ProvableCountTreeand 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: trueindex 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’sAggregateCountAndSumOnRangeprimitive. Client computesavg = sum / count. Verify a grovedb point-lookup proof against a count-sum-bearing index terminator and return per-branch(count, sum)entries. AVG analog ofsuper::document_sum::verify_point_lookup_sum_proof. - verify_
point_ lookup_ count_ proof - Verify a grovedb point-lookup count proof against a
countable: trueindex 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’sAggregateCountAndSumOnRangeprimitive. Client computesavg = 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
CountTreeelement and return the unfiltered total count. - verify_
primary_ key_ sum_ tree_ proof - Verify a grovedb proof of the document type’s primary-key
SumTreeelement and return the unfiltered total sum.