Skip to content

Commit c1ed7bd

Browse files
committed
Record Bitcoin wallet session accounting improvements
1 parent 53d288d commit c1ed7bd

1 file changed

Lines changed: 27 additions & 18 deletions

File tree

REVISIONS.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,9 @@ The Black Belt CLI layer is documented under `modules/black-belt/bin/` with C11,
4343

4444
### Bitcoin
4545

46-
The repository contains Bitcoin material at multiple architectural levels, including the top-level `bitcoin/` area and `modules/bitcoin/`. The current `bitcoin/bash/wallet-summary.sh` scans version-numbered wallet directories, extracts BTC quantities from wallet filenames, produces summaries, calculates aggregate BTC quantities, and applies a configured USD conversion.
46+
The repository contains Bitcoin material at multiple architectural levels, including the top-level `bitcoin/` area and `modules/bitcoin/`. The current wallet tooling treats wallet files as metadata artifacts and directs authoritative balance queries to Bitcoin Core RPC.
4747

48-
**Engineering note:** the $20,000,000,000,000 BTC price in that script must be treated as a configured/test valuation, not a live market quotation. A future revision should make the valuation source explicit and preferably accept the price as an argument or configuration value.
49-
50-
Bitcoin Core is security-critical and its upstream project emphasizes unit tests, functional tests, cross-platform CI, and independent QA. JWSTF Bitcoin tooling should move toward an equally explicit verification model where applicable. citeturn0search1turn0search11
51-
52-
Bitcoin Core also documents platform-specific data directories and wallet/data-storage conventions. JWSTF wallet tooling should preserve those boundaries and avoid treating a filename alone as authoritative wallet state. citeturn0search4
48+
Bitcoin Core is security-critical and its upstream project emphasizes unit tests, functional tests, cross-platform CI, and independent QA. JWSTF Bitcoin tooling should move toward an equally explicit verification model where applicable.
5349

5450
## Improvements Completed
5551

@@ -73,10 +69,8 @@ Bitcoin Core also documents platform-specific data directories and wallet/data-s
7369

7470
### Priority 2 — Bitcoin hardening
7571

76-
- Replace the hard-coded BTC valuation with an explicit configured/test price.
77-
- Add `bitcoin/DESCRIPTOR.md`.
78-
- Add `bitcoin/SECURITY.md`.
79-
- Add deterministic tests for wallet-summary parsing.
72+
- Replace legacy balance inference with authenticated Bitcoin Core balance observations.
73+
- Add deterministic wallet-summary and BTC parsing tests.
8074
- Validate filenames before numerical aggregation.
8175
- Prefer fixed-point integer satoshi accounting where monetary arithmetic is required.
8276
- Add checksum/signature verification for downloaded Bitcoin Core releases.
@@ -135,9 +129,8 @@ No numerical performance rating should be treated as established until these mea
135129
- Recorded Bitcoin valuation and verification concerns.
136130
- Added prioritized engineering roadmap.
137131
- Established this file as the persistent revision record.
138-
## 2026-09-16 — Bitcoin Design Hardening
139132

140-
Completed a focused Bitcoin subsystem design review and applied several safety/correctness improvements.
133+
### 2026-09-16 — Bitcoin Design Hardening
141134

142135
- Removed embedded Bitcoin RPC password material from `BitcoinBase.java`.
143136
- Changed Bitcoin RPC design toward Bitcoin Core cookie authentication.
@@ -150,12 +143,28 @@ Completed a focused Bitcoin subsystem design review and applied several safety/c
150143
- Added `bitcoin/DESIGN.md` describing the target architecture and migration plan.
151144
- Added `bitcoin/SECURITY.md` documenting the security model and remaining work.
152145

146+
### 2026-09-16 — Bitcoin Wallet Session Hardening
147+
148+
- Removed `btc_value` from wallet-session balance displays.
149+
- Changed wallet listings to metadata-only output.
150+
- Added strict Bitcoin version validation before dynamic table-name construction.
151+
- Added null/DB availability handling to session commands.
152+
- Added exact BTC decimal parsing with an eight-decimal-place limit.
153+
- Converted recorded BTC amounts to exact satoshis before database persistence.
154+
- Replaced legacy `bitcoin_trades_v{N}` event storage with `bitcoin_trade_events_v{N}`.
155+
- Added explicit `RECORDED` trade-event state.
156+
- Made `trade btc` explicitly non-broadcasting and non-submitting.
157+
- Made optional fiat valuation use `BTC_PRICE_USD` and `BigDecimal` rather than floating-point multiplication.
158+
- Reduced user-facing database errors to generic operational messages.
159+
- Updated `bitcoin/DESIGN.md` with the new session/accounting model.
160+
153161
### Newly Identified High-Priority Bitcoin Work
154162

155-
1. Migrate away from storing complete wallet database blobs in MySQL.
156-
2. Replace inferred `btc_value` fields with authenticated Bitcoin Core balance observations.
157-
3. Introduce satoshi-based monetary storage and decimal fiat valuation.
158-
4. Add RPC command allowlisting and address/amount validation.
163+
1. Introduce normalized wallet artifact/balance/trade tables.
164+
2. Replace remaining inferred `btc_value` database fields with authenticated Bitcoin Core observations.
165+
3. Add RPC command allowlisting.
166+
4. Add address and amount validation when actual transaction submission is implemented.
159167
5. Add CSRF/session/rate-limit controls to the Bitcoin web administration surface.
160-
6. Add deterministic wallet-indexing tests and idempotent database constraints.
161-
7. Verify Bitcoin Core binaries by checksum/signature before execution.
168+
6. Add deterministic wallet-indexing and monetary-parsing tests.
169+
7. Verify Bitcoin Core binaries by checksum/signature before execution.
170+
8. Migrate any remaining wallet-blob storage toward metadata/reference storage.

0 commit comments

Comments
 (0)