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
//! The [`Evidence`] trait — the ONE shape every active on-chain evidence type in this crate wears.
//!
//! An evidence type answers three questions about ITSELF: what it proves (its [`Claim`](Evidence::Claim)),
//! how to GATHER the specific on-chain information that proof needs (through an injected
//! [`ChainSource`]), and how to re-VERIFY it. This is the `dig-did::prove_lineage`/`AncestryProof`
//! pattern generalised: construction is gather-only and authenticated against the injected reader, the
//! fields are private (a value cannot be forged by a struct literal), and every path is pure over the
//! reads and fails closed.
use ChainSource;
use crateEvidenceResult;
/// An active piece of on-chain evidence: a type that knows what it proves, gathers the on-chain
/// information its proof needs, and re-verifies offline from its own gathered contents.
///
/// ## Why gather-only construction matters
///
/// The ONLY way to obtain a value of an `Evidence` type is [`gather`](Evidence::gather), which
/// authenticates every field against the injected [`ChainSource`] (or, for a self-contained offline
/// proof, against the supplied inputs). Implementors keep their fields PRIVATE, so a caller can never
/// fabricate "proven" evidence with a struct literal — holding a value is itself the assurance the
/// proof genuinely held at gather time. [`verify`](Evidence::verify) re-checks the evidence offline
/// from its own contents (a cheap, network-free re-assertion of the invariant).
/// Maps a [`ChainSource`] error into [`EvidenceError::Chain`](crate::EvidenceError::Chain), preserving
/// its `Display` string. The single funnel every gather path uses so an unreliable read always fails
/// closed as `Chain`, never as a false absence.
pub