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
//! # dig-options — the DIG Network canonical Chia option-contract expert crate
//!
//! `dig-options` is a **pure, key-free, network-free** CoinSpend-builder for Chia covered
//! options (the CHIP-0042 option primitive). It constructs the exact
//! [`CoinSpend`](chia_protocol::CoinSpend)s for the option lifecycle — [`create`] (lock an XCH
//! underlying, mint the option singleton), [`exercise`] (pay the strike, unlock the underlying
//! to the holder), [`transfer`] (move the option ticket to a new owner), [`clawback`] (the
//! creator reclaims the underlying after expiry), and inspect ([`parse`]/[`parse_child`]) — and
//! reports the exact signatures a caller must produce ([`required_signatures`]).
//!
//! It also [`rehydrate`]s a previously-minted option: [`parse`] recovers only an option's
//! identity fields, so [`rehydrate`] reconstructs the full operable [`CreatedOption`] from
//! caller-observed terms + the launcher metadata ([`parse_metadata`]) and VERIFIES it against the
//! option's on-chain commitments, letting a caller exercise/transfer/claw back an option it did
//! not mint in the same session.
//!
//! ## The custody model (HARD invariants)
//!
//! dig-options **never holds a secret key, never signs, and never touches the network.** Every
//! builder takes only public inputs (an [`Owner`] carrying a public key or a caller-supplied
//! inner spender, plain [`Bytes32`](chia_protocol::Bytes32) puzzle hashes, coins the caller
//! already fetched) and appends unsigned coin spends to a caller-owned [`SpendContext`]. The
//! consumer signs the messages reported by [`required_signatures`], assembles the
//! `SpendBundle`, and broadcasts. Signing — and the secret key — stay entirely on the caller's
//! side of the identity boundary (#908).
//!
//! ## Scope (v0.1.0)
//!
//! The underlying is **XCH**, and the strike is **XCH-only**: [`create`] REJECTS a non-XCH strike
//! up front so create and [`exercise`] have symmetric support envelopes (no holder can acquire an
//! option it could never exercise). [`exercise`] builds BOTH settlement legs for an XCH strike —
//! the underlying is claimed to the holder and the strike is paid to the creator, in one bundle —
//! and keeps its non-XCH guard as defense-in-depth. [`clawback`] and inspection work for any strike
//! type curried into an existing option. CAT/revocable-CAT/NFT underlyings and strike are a future
//! extension. See `SPEC.md` for the normative contract.
pub use clawback;
pub use create;
pub use ;
pub use ;
pub use ;
pub use ;
pub use required_signatures;
pub use transfer;
pub use ;
// Re-exports so a consumer need not depend on the SDK directly for the common surface.
pub use ;
pub use RequiredSignature;
/// The crate's semantic version, surfaced so a consumer can record which builder version
/// produced a spend.