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
//! [`ProfileContentSource`] — the host-supplied reader for a profile's OFF-CHAIN body.
//!
//! # Why this is a second seam and not another `ChainSource` method
//!
//! A store commits a merkle ROOT on chain and nothing else; the slot values that hash to it live in
//! the store's `.dig` content, which no chain query returns.
//! [`ChainSource`](dig_chainsource_interface::ChainSource) is a chain reader and structurally cannot
//! answer for them, so the content read is its own seam, implemented by the host over whatever it
//! already uses to fetch store content (a local dig-node, the §5.3 read ladder).
//!
//! # It is UNTRUSTED, and that is enforced here rather than assumed
//!
//! The source is a fetcher, never an authority: [`read_profile`](super::read_profile) re-hashes
//! whatever it returns and refuses anything that does not equal the store's current on-chain root
//! ([`EditError::StaleOrTamperedContent`](super::EditError::StaleOrTamperedContent)). A host that
//! reads from a hostile peer therefore cannot make this crate report fields the chain does not back.
//!
//! # Primitives only
//!
//! Slots cross this seam as `(u16, Vec<u8>)` — the schema's slot id and its canonical
//! `tag ‖ len ‖ bytes` value encoding. A host implementing it names no `dig-social-profile` type,
//! and decoding stays this crate's job, where the root check can be bound to it.
use Bytes32;
/// Fetches the profile body a store committed under a given root.
///
/// Implemented by the host (dig-app, over its node). Holds no key and authorizes nothing: it is a
/// read, and its answer is verified against chain before any of it is believed.