docs/docs-as-code.md defines the workflow; docs/adr holds 31 ADRs (retroactive, reconstructed from code and changelog) with a template and index. docs/check-docs.sh validates ADR structure, index, cited code paths, relative links and CLAUDE.md/AGENTS.md sync.
25 lines
1.2 KiB
Markdown
25 lines
1.2 KiB
Markdown
# 0017. Coin selection, fee and confirmation policy
|
|
|
|
- **Status:** Accepted
|
|
- **Area:** Wallet
|
|
- **Recorded:** 2026-11-03 (retroactive: reconstructed from code, comments and changelog)
|
|
|
|
## Context
|
|
|
|
Fund safety depends on never spending immature or unverified coins and on producing standard, relayable transactions.
|
|
|
|
## Decision
|
|
|
|
`TransactionFactory` supports automatic or manual UTXO selection, a fixed fee rate in sat/vByte, send-all with the fee subtracted, change on the internal chain, and RBF enabled on every transaction. It rejects transactions above 100,000 vbytes. `UtxoSpendability.IsSpendable` is the single gate shared by coin selection and balance reporting: a coinbase output needs maturity + 1 confirmations (121 on mainnet), a regular output needs `MinConfirmations` (policy, not consensus), frozen UTXOs are excluded, and the Merkle proof must be verified (0008).
|
|
|
|
## Consequences
|
|
|
|
- Balances and coin selection cannot disagree.
|
|
- Users may see "insufficient funds" despite a larger visible balance when part of it is immature or unverified.
|
|
- RBF is set but fee bumping is not exposed in the UI (see `SECURITY.md`).
|
|
|
|
## References
|
|
|
|
- `src/Core/Wallet/TransactionFactory.cs`
|
|
- `src/Core/Wallet/UtxoSpendability.cs`
|