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
//! What part of an answer is a claim about the CHAIN, and therefore has to be agreed on.
//!
//! A positive answer is not self-verifying. The coin-id binding — `SHA256(parent_coin_info ‖
//! puzzle_hash ‖ amount)` — authenticates the coin's *identity*, and nothing else on the record:
//! `created_height`, `spent_height` and `spent` are copied verbatim from whatever an anonymous
//! peer sent, and those are the fields a consumer reads to decide whether money is settled
//! (dig_ecosystem#2462).
//!
//! So corroboration compares the claim, not the struct. Two sources describing the same chain
//! state must compare EQUAL even though they filled in different amounts of local colour: the peer
//! protocol cannot supply `timestamp` or `coinbase` at all and leaves them zeroed, while the
//! coinset API returns both. Comparing whole records would make every peer/coinset pair
//! "disagree" and turn the corroboration into a permanent error.
use crate;
/// The chain-state claim inside an answer, rendered as a value two sources can be compared on.
///
/// Implement this for anything that travels through a corroborated read. The implementation MUST
/// include every field a consumer could read as evidence about the chain, and MUST exclude fields
/// that merely vary by which tier answered — a claim that includes tier-local colour cannot be
/// corroborated across tiers, and one that omits a height cannot catch the fabrication this trait
/// exists to catch.