You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The old `100 BTC per 2 MB` calculation is removed from the design.
43
+
The old file-size-to-BTC calculation is removed from the design.
44
44
45
45
### 2. No embedded RPC passwords
46
46
@@ -62,13 +62,29 @@ Where monetary values are stored or compared:
62
62
- Use decimal/fixed-point types for fiat display calculations.
63
63
- Keep exchange-rate source and timestamp separate from wallet state.
64
64
65
-
### 5. Database model
65
+
### 5. Wallet session accounting
66
66
67
-
The current `bitcoin_wallets_v24` through `bitcoin_wallets_v30` tables are legacy-compatible structures. The next migration should separate wallet artifact metadata, authenticated wallet balances, trade records, and session state.
67
+
`BitcoinWalletSession` now treats the `bitcoin_wallets_v24` through `bitcoin_wallets_v30` tables as **wallet metadata** rather than balance ledgers.
68
+
69
+
The session command `trade btc <amount>` is explicitly a **trade-event recording operation**. It does not broadcast, submit, or imply a blockchain transaction.
70
+
71
+
Trade amounts are parsed as BTC decimal values with at most eight decimal places and stored as exact satoshis. Optional fiat valuation is supplied through `BTC_PRICE_USD`; when no price is supplied, the event remains unvalued rather than inventing a market price.
72
+
73
+
Trade events are written to new `bitcoin_trade_events_v{N}` tables so that the old `bitcoin_trades_v{N}` schema cannot silently reinterpret legacy `btc_amount` units.
74
+
75
+
### 6. Database model
76
+
77
+
The current `bitcoin_wallets_v24` through `bitcoin_wallets_v30` tables are legacy-compatible metadata structures. The target model separates:
78
+
79
+
- wallet artifact metadata
80
+
- authenticated wallet balance observations
81
+
- trade events
82
+
- transaction lifecycle state
83
+
- session state
68
84
69
85
This prevents an artifact index from being mistaken for financial state.
70
86
71
-
### 6. Wallet blob storage
87
+
### 7. Wallet blob storage
72
88
73
89
Whole wallet database files should not normally be copied into MySQL. They can contain sensitive wallet material and substantially increase the impact of a database compromise.
The database should store metadata and references, not unnecessary private wallet contents.
85
101
86
-
### 7. Idempotent indexing
102
+
### 8. Idempotent indexing
87
103
88
104
The indexer should eventually use a unique key such as `(version, canonical_path, sha256)` and upsert/deduplication semantics.
89
105
90
106
Repeated indexing should not create unlimited duplicate rows.
91
107
92
-
### 8. RPC isolation
108
+
### 9. RPC isolation
93
109
94
110
Only the Bitcoin service should need access to the Bitcoin Core RPC interface. The web frontend should communicate with the service layer rather than receiving arbitrary command execution capability.
95
111
96
112
Allowed RPC commands should be explicitly allowlisted.
0 commit comments