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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//! # dig-did — the DIG Network canonical Chia DID expert crate
//!
//! `dig-did` is a **pure, key-free, network-free** SpendBundle-builder for Chia Decentralized
//! Identifiers (DIDs). It constructs the exact [`CoinSpend`]s for every DID
//! lifecycle operation and reports — via [`required_signatures`] — the exact signatures a caller
//! must produce. It never holds a secret key, never signs, and never touches the network. The
//! consumer signs the reported messages, assembles the `SpendBundle`, and broadcasts.
//!
//! ## Invariants
//!
//! These four invariants hold across the entire crate and are the contract every unit is built to
//! (SPEC §1):
//!
//! - **INV-1 — No network.** dig-did performs NO network or chain I/O. Every function is a pure
//! transform of its inputs; the caller fetches coins and broadcasts bundles.
//! - **INV-2 — No keys.** dig-did never accepts, holds, derives, or logs a secret key. It computes
//! what must be signed ([`required_signatures`]); the caller's signer produces the signatures.
//! - **INV-3 — Unsigned output.** Every operation returns an unsigned [`DidSpend`] — coin spends
//! plus the recreated child DID. Signatures are always the caller's responsibility.
//! - **INV-4 — SDK byte-source-of-truth.** Every puzzle, layer, and coin-spend byte is produced by
//! `chia-wallet-sdk` (pinned to the 0.34 / chia-protocol 0.36 family). dig-did adds DID-workflow
//! ergonomics on top; it never re-implements a puzzle or hand-rolls a spend bundle.
//!
//! ## Consumer pattern
//!
//! ```text
//! build an unsigned DidSpend -> required_signatures(&spend.coin_spends, &constants)
//! -> caller signs each reported message -> assemble SpendBundle -> broadcast
//! ```
//!
//! ## Status
//!
//! The foundation (type surface, error taxonomy, inner-spend helpers, signing boundary) ships
//! alongside **create** ([`create_did`], [`create_simple_did`], [`create_eve_did_only`]),
//! **hydrate** ([`hydrate_did_from_parent_spend`], [`parse_did_coin_spend`],
//! [`did_info_from_puzzle`]), the **did:chia:** string codec ([`did_string_from_launcher_id`],
//! [`launcher_id_from_did_string`]), and the **lineage-proof spine** — the [`resolve::ChainSource`]
//! chain-reading seam (the ONE canonical `dig-chainsource-interface` trait, re-exported),
//! [`prove_lineage`] + [`AncestryProof`], and [`walk_did_lineage_to_tip`] — and the **DID→XCH address
//! resolver** ([`resolve_xch_address`], [`resolve_xch_address_from_did_string`]), which authenticates
//! a DID's current tip to its genuine launcher before returning the owner's payment [`Address`]; and
//! **update** ([`spend_did_with_conditions`] — the DID-preserving owner spend that emits caller
//! conditions, binding another operation to an authenticated act of the DID in one bundle).
//!
//! The remaining DID operations (recovery, transfer, launch, melt, attest, resolve-document) land in
//! their own units against this foundation; their modules are declared below as doc-only stubs so
//! the layout is final.
// Internal helpers — not part of the public surface.
// Test-only bundle-inspection helpers, shared across the operation modules' test suites.
// Public modules.
// DID creation, hydration, and the did:chia string codec — shipped.
// The remaining DID operation modules — declared now so the crate layout is final; each is filled
// in its own unit (doc-only until then, so they add no untested surface).
// DID-preserving owner spends (U3) — shipped.
// Lineage authentication (U3): the chain-reading seam + singleton walk, and the lineage proof.
// The curated public surface — consumers depend on these paths, not the module layout.
pub use SingletonAmount;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use required_signatures;
pub use ;
pub use spend_did_with_conditions;
// The canonical bech32m address codec — re-exported so a consumer can render / decode a resolved XCH
// payment address (from [`resolve_xch_address`]) without a direct `chia-sdk-utils` dependency.
pub use Address;
// Re-export the signing types a consumer needs to CALL [`required_signatures`] and consume its
// result, so a downstream crate need not add a direct chia-wallet-sdk dependency for them.
pub use ;