Problem
The current architecture is fragmented by borrowed implementation concepts rather than by a single domain model.
crates/utxo owns the authoritative live UTXO set.
crates/index owns electrs-shaped funding/spending rows.
crates/wallet owns descriptors, PSBT helpers, and partial watched-state concepts.
crates/utreexo owns proof/accumulator logic but is not meaningfully wired into block apply.
crates/filters owns compact block filters for discovery/rescan.
crates/pruning owns block/undo deletion policy.
NodeState wires these together through optional handles and side effects.
This makes "coin state at a chain tip" implicit and scattered. Wallet funding, address/script lookup, UTXO proof attachment, indexing, and pruning should all consume one coherent UTXO/block delta model instead of each subsystem interpreting blocks independently.
Desired Direction
Make crates/utxo the center of the state model.
Conceptually:
crates/utxo
CoinState
├─ live_utxo // authoritative OutPoint -> Coin state
├─ watched_index? // optional descriptor/script -> live coin projection
├─ funding_api? // optional automated PSBT funding source
└─ proof_provider? // optional utreexo/full-node proof backend
wallet should not own coin state directly. Instead, it should observe wallet-relevant coins through the utxo state model and expose them as a simple deposit/withdrawal experience.
crates/wallet
├─ descriptor parsing/validation
├─ PSBT construction/finalization helpers
└─ external signer trait only
Problem
The current architecture is fragmented by borrowed implementation concepts rather than by a single domain model.
crates/utxoowns the authoritative live UTXO set.crates/indexowns electrs-shaped funding/spending rows.crates/walletowns descriptors, PSBT helpers, and partial watched-state concepts.crates/utreexoowns proof/accumulator logic but is not meaningfully wired into block apply.crates/filtersowns compact block filters for discovery/rescan.crates/pruningowns block/undo deletion policy.NodeStatewires these together through optional handles and side effects.This makes "coin state at a chain tip" implicit and scattered. Wallet funding, address/script lookup, UTXO proof attachment, indexing, and pruning should all consume one coherent UTXO/block delta model instead of each subsystem interpreting blocks independently.
Desired Direction
Make
crates/utxothe center of the state model.Conceptually:
wallet should not own coin state directly. Instead, it should observe wallet-relevant coins through the utxo state model and expose them as a simple deposit/withdrawal experience.