1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! # dig-evidence — the DIG Network's library of ACTIVE on-chain evidence types
//!
//! One home for the evidence/proof TYPES the ecosystem produces and verifies. Every type here is an
//! ACTIVE piece of evidence: it (a) knows what it proves, (b) GATHERS the specific on-chain
//! information its proof needs through an INJECTED [`ChainSource`] reader (never taking an upward
//! dependency on a node or transport), and (c) re-verifies offline from its own gathered contents.
//!
//! ## The pattern (modeled on `dig-did::prove_lineage`)
//!
//! Each type implements the [`Evidence`] trait and follows the same unforgeable-by-construction
//! discipline as `dig-did`'s `AncestryProof`:
//!
//! - **Private fields.** A value cannot be forged by a struct literal — the only way to obtain one is
//! [`Evidence::gather`], which authenticates every field against the injected reader (or, for a
//! self-contained offline proof, against the supplied inputs). Holding a value witnesses the proof.
//! - **Gather-only construction.** Construction reads chain state through the injected `ChainSource`
//! and authenticates it; it holds NO key, signs nothing, and does its own no network I/O.
//! - **Fail-closed.** An unreadable chain, a missing/forged anchor, or a proof that does not fold is
//! an [`EvidenceError`], never a silently-accepted absence.
//!
//! ## Phase 1 evidence types (the MVP flywheel read→verify→cache→reshare integrity gate)
//!
//! | Type | Proves | Class |
//! |------|--------|-------|
//! | [`RangeInclusionEvidence`] | a content range's leaf is included under a generation root | self-authenticating (offline) |
//! | [`RootAnchorEvidence`] | a generation root is committed on-chain by the store's launcher-anchored lineage | locally-observable (chain read) |
//! | [`ReadIntegrityEvidence`] | both of the above, bound to the same root — the read→cache→reshare gate | composite |
//!
//! See `SPEC.md` for the full evidence taxonomy and the self-authenticating (broadcastable) vs
//! locally-observable (NEVER broadcastable, #1438 anti-censorship) classification table.
//!
//! ## Reused primitives
//!
//! The merkle inclusion machinery is REUSED verbatim from `dig-capsule` ([`MerkleProof`] /
//! [`ProofStep`], with the `digstore:leaf:v1` / `digstore:node:v1` domain-separation tags), the
//! DataStore on-chain parse from `dig-merkle`, and the injected reader from
//! `dig-chainsource-interface` — this crate reinvents no crypto and cannot skew from the canonical
//! read-crypto.
pub use ;
pub use Evidence;
pub use ;
pub use ;
pub use ;
// --- Re-exports: the shared building blocks a consumer needs to construct claims + read evidence,
// so a downstream crate depends on JUST dig-evidence for the evidence surface. ---
/// The injected reads-only chain seam every active evidence type gathers through, plus the coin/lineage
/// shapes it reads. Re-exported so consumers construct claims without a direct
/// `dig-chainsource-interface` dependency.
pub use ;
/// The merkle inclusion-proof shapes and domain-separation tags, REUSED verbatim from `dig-capsule`.
/// A [`RangeInclusionClaim`] is built from a [`ProofStep`] path; the tags are the byte-for-byte
/// producer contract.
pub use Bytes32 as CapsuleBytes32;
pub use ;
// NOTE: `dig_did::{AncestryProof, LineageModel}` were re-exported here as a convenience. They are
// not re-exported while `dig-did` remains on the chia-0.26 / wallet-sdk-0.30 family: this crate now
// rides chia-0.36 / wallet-sdk-0.34 (following `dig-merkle` 0.5 + `dig-chainsource-interface` 0.3),
// so the re-exported types carried a SECOND `Bytes32` that is not assignable to the `Bytes32` in
// this crate's own API — the exact "one import" convenience the re-export existed to provide.
// `dig-did::prove_lineage` remains the reference implementation this crate's pattern generalises.
// Restore the re-export once dig-did publishes on the chia-0.36 family.
/// The canonical URN content-verification contract (`FoldedProof` + the gate-then-decrypt
/// `verify_inclusion` / `verify_and_decrypt` over injected crypto), re-exported so a consumer reaches
/// the blind-client read-verification surface through `dig-evidence` alongside the on-chain evidence
/// types. This is the URN-level counterpart to [`RangeInclusionEvidence`].
pub use ;