Repository navigation
feat(wallet): add functions to lock and unlock utxos - #1669
notmandatory wants to merge 1 commit into
Conversation
4446da6 to
6b889cd
Compare
6b889cd to
8f3387e
Compare
8f3387e to
423b4a8
Compare
I think that would be reasonable, although allowing for a larger reorg threshold (usually 6 conf) might be safer?. And, while having this explicit API available is great, as previouslydiscussed, it would be great if BDK could offer a way to specify to auto-unlock the UTXOs after some (block or time) delay. Otherwise users would still need to track these UTXOs independently/outside of the |
|
@tnull for unlocking how would you feel about having explicit functions, something like this:
|
|
Hey @notmandatory, this PR needs to be closed and moved to the new bdk_wallet repo. Here's how:
|
|
Closing this for now without moving to bdk_wallet since other approaches are being discussed for fixing this issue. |
Description
fixes bitcoindevkit/bdk_wallet#166
Add functions to Wallet to lock and unlock utxos. The locked TxOuts are automatically added to TxBuilder's "unspendable" list. This is just a draft to see if this approach makes sense, if so then I'll add persisting the locked utxos.
TODO
locked_unspentandunlocked_unspenttoWallet::ChangesetWallet.locked_unspentlist afterWallet::apply_updateand remove locked spent UTXOslocked_unspentdataNotes to the reviewers
The design is based on how the core wallet locks UTXOs except I think it's simpler to always persist locked utxos. See: https://bitcoincore.org/en/doc/28.0.0/rpc/wallet/lockunspent/
Should locked UTXOs that are found to be spent be removed from the locked list after only one confirmation?
If API looks good then it won't be a breaking change so I propose this PR goes into the 1.1 milestone.
Changelog notice
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features: