bdk icon indicating copy to clipboard operation
bdk copied to clipboard

Remove old `LocalUtxo`s

Open danielabrozzoni opened this issue 3 years ago • 3 comments

After #515 we never delete TxOuts from the database; this can obviously be a problem for wallets that do many transactions and applications that run on devices with limited memory. We should add a way of manually deleting the spent txouts.

danielabrozzoni avatar Mar 18 '22 21:03 danielabrozzoni

maybe choose archive or delete auto archive (set time interval - size count) - then manually delete

more of a concern for wallet implementation choice of db management ?

maybe a API of encrypted remote store in own "cloud" or other type bucket

xraid avatar Mar 27 '22 20:03 xraid

@danielabrozzoni , can I pick this up?

vladimirfomene avatar Jul 27 '22 12:07 vladimirfomene

I just assigned this to you 😁

So, I don't know exactly how this will look like, but to give a bit of context: in #414 and #515 there should be enough discussion to cover why we went for never deleting the utxos in the first place. Now, we should find some way to do so, and IMHO it should be pretty configurable (as everything in BDK). We could have an automatic mode ("delete all the utxos which have been spent at least 10 blocks ago", "keep at most 500 utxos"), but also a manual API would be cool ("delete all the utxos" or "delete this specific utxo").

We haven't discussed much about it, so feel free to jot down your thoughts on discord or, even better, create a PR with a POC and let people discuss there. Thanks 🙏🏻

danielabrozzoni avatar Jul 27 '22 13:07 danielabrozzoni