This describes a proposed enhancement.
With the ability to import keys without full rescan or load an old wallet without a rescan (e.g. with pruning), the user of a wallet is exposed to the possiblity that there will be wallet txn that they don’t know about.
Even if the user intentionally put the wallet in this state, they may forget months later (esp. if managing multiple wallets).
Failure to know about this can result funds loss (thinking keys don’t have funds when they do), and even if there is a UTXO scan, issues may remain: The user may falsely think they didn’t pay someone and then pay again, the user may falsely think they weren’t paid and falsely demand payment. The user might screw up their taxes or business records and get themselves in trouble. In short: “the wallet gives you a complete history of your transactions, except when it doesn’t” is a somewhat dangerous interface.
I believe we can avoid these issues by establishing clear behavior.
To do this we define a pruned wallet: A pruned wallet knows every wallet transaction up to height X, and before that only knows about coins.
In the transaction list there would be a top most entry that says something like “Prior history not shown due to pruning” and perhaps a correcting ledger entry that showed the amount of coins available at the point of pruning. RPC would provide the pruning state via getwalletinfo and potentially a correcting ledger entry at the earliest point in listtransactions.
Any wallet could be pruned to any height at any time. Any pruned wallet could be unpruned with a rescan.
If you import keys in the UI or load a old wallet the GUI could prompt the user to allow rescan or prune– or if the age is beyond their blockchain prune depth, allow them to prune or abort.
(or even rescan by fetching blocks … wee!)
(Potentially a wallet could have an unknown pruned state where a notice is displayed that says it doesn’t know if its pruned or not, allowing the current behavior.)
This would also be attractive to large commercial parties who have ended up with wallets that are hundreds of megs in size. (most of that is transaction data that would be eliminated by pruning)
Some thought might be given to preserving labels for pruned transactions. They don’t take much space, and might just be worth preserving.