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
//! The public type surface of `dig-merkle` (SPEC §2).
//!
//! Two kinds of types live here: the DataLayer/coin types re-exported verbatim from chia-wallet-sdk
//! (the byte-source-of-truth, INV-4 — this crate never re-defines a puzzle-carrying type), and the
//! small `dig-merkle`-owned types that describe an *unsigned* operation result
//! ([`MerkleCoinSpend`]) and *who* is authorized to spend a DataLayer coin ([`Owner`]).
use Spend;
use PublicKey;
use crateDigDataStoreMetadata;
// Re-exported from chia-wallet-sdk so consumers of dig-merkle never need a direct SDK dependency to
// name the DataLayer coin it produces. These are the canonical Chia CHIP-0035 types (gated behind
// the SDK's `chip-0035` feature) — dig-merkle adds no shadow copy (INV-4).
pub use ;
pub use ;
pub use ;
pub use Conditions;
/// The result of building a DataLayer-coin operation: the unsigned coin spends plus the recreated
/// child Datastore.
///
/// This is the crate's output contract (INV-3). A `MerkleCoinSpend` carries NO signature — the
/// consumer feeds `coin_spends` to [`crate::required_signatures`], signs the reported messages,
/// assembles a `SpendBundle`, and broadcasts. `child` is the Datastore as it will exist AFTER the
/// spend confirms (`None` for a terminal operation such as a melt, which leaves no successor).
/// Who is authorized to spend a DataLayer coin — i.e. the p2 ("inner") puzzle that guards it.
///
/// Every DataLayer operation is authorized by spending the coin's inner puzzle. `Owner` lets a
/// caller pick that inner puzzle without dig-merkle hard-coding one:
///
/// - [`Owner::Standard`] is the common case — the standard single-key p2 puzzle. dig-merkle builds
/// the `StandardLayer` for you; the resulting spend requires one `AGG_SIG_ME` over the given key.
/// - [`Owner::Custom`] is the escape hatch — the caller supplies an already-built inner [`Spend`]
/// (any p2 puzzle: a custom vault, a multisig, a DID-authorized delegated puzzle). dig-merkle
/// passes it through unchanged, so the caller owns its signature requirements AND the conditions
/// the spend emits. It is therefore usable only for operations whose conditions the caller can
/// construct in advance — NOT the mint path, whose launch conditions are built inside the call
/// (see [`crate::mint_datastore_launch_with_kind`]).