Skip to content

Commit 14c669d

Browse files
docs(digstore-chain): SPEC §10.1 dig-wallet-backend + COIN_CAP digstore-local (#1005)
Update SPEC.md coherence on §10.1 coin-management contract: - Replace stale dig-l1-wallet references with dig-wallet-backend's engine::selection primitive - Fix FACTUALLY WRONG claim that browser/JS uses COIN_CAP=50: digstore uses LOCAL COIN_CAP=50 (distinct from dig-wallet-backend's DEFAULT_COIN_CAP=500) for mempool cost tuning, NOT a shared cross-repo contract. JS layer doesn't pin a cap. This resolves the SPEC coherence blocker for feat/migrate-dig-wallet-backend. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtR1bZXpDNp2VFNJDtwsph
1 parent 52c3a8d commit 14c669d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

SPEC.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ The per-capsule price is **dynamic and USD-pegged**, NOT a fixed token amount:
254254
Scope note: a CLI/economic contract (not a `.dig` byte-format contract) governing how the money
255255
commands choose which XCH coins fund a spend, so a coin-fragmented wallet is never silently unable
256256
to publish. This is dig-store's expression of the ecosystem-wide **coin-management contract**
257-
(`SYSTEM.md` → coin-management; the shared primitive is `dig-l1-wallet`). A `dig-store`
257+
(`SYSTEM.md` → coin-management; the shared primitive is `dig-wallet-backend`'s engine seam `engine::selection`). A `dig-store`
258258
reimplementation MUST replicate it and MUST NOT hand-roll its own selection heuristic.
259259

260260
Every XCH-funding spend built by `init` (mint fee), `commit` and `deploy` (root-advance XCH fee):
@@ -264,8 +264,10 @@ Every XCH-funding spend built by `init` (mint fee), `commit` and `deploy` (root-
264264
taken greedily until the target (`fee` for a root advance, `fee + 1` for a mint) is met. This
265265
minimizes the number of inputs, keeping the bundle's CLVM cost well under Chia's per-block ceiling
266266
(§11.3).
267-
- **Caps the attempt at 50 coins** (the shared `DEFAULT_COIN_CAP`; the boundary the browser/JS spend
268-
layer uses too). Only the largest 50 coins are eligible for a single spend.
267+
- **Caps the attempt at 50 coins** — digstore uses a LOCAL `COIN_CAP = 50`, distinct from
268+
dig-wallet-backend's `DEFAULT_COIN_CAP = 500`, because digstore's spend bundles must stay under
269+
Chia's mempool cost ceiling. Only the largest 50 coins are eligible for a single dig-store
270+
XCH-funding spend.
269271
- **Distinguishes three outcomes** — never a flat failure that hides the counts:
270272
1. **selectable** — the largest ≤ 50 coins cover the target; the bundle is built from exactly those.
271273
2. **needs consolidation** — the wallet's TOTAL XCH covers the target, but the largest 50 coins do
@@ -282,7 +284,7 @@ Every XCH-funding spend built by `init` (mint fee), `commit` and `deploy` (root-
282284
`NEEDS_CONSOLIDATION` error (exit 18) rather than spending unprompted. `--json` emits a
283285
`{"event":"consolidated", asset, merged_coins, merged_mojos, output_coin_id, tx_id}` record per
284286
round.
285-
- **Never hand-rolls the selection or the merge** — both are the `dig-l1-wallet` primitives
287+
- **Never hand-rolls the selection or the merge** — both are the `dig-wallet-backend` primitives
286288
(`select_for_spend` / `select_for_consolidation`); only the bundle construction (the datalayer_driver
287289
/ `chia-wallet-sdk` builder) stays dig-store's.
288290

0 commit comments

Comments
 (0)