Multisig/watchonly wallet transaction creation flow proof of concept #5743
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a new concept, "pending transactions" (working title 馃拃). The idea is that if you have a watch only/multsig wallet, if you need to create a transaction, you currently have to
With this PR, you can create a transaction as usual, but instead of signing you "create a pending transaction". A pending transaction is essentially a PSBT that fleshes out what coins to spend and where to spend them, and collects signatures as signers provide them. Once there are enough signatures, you can broadcast.
If the coins being spent by a pending transaction are spent elsewhere before the signatures are fully collected, the pending transaction is "invalidated".
If the transaction was signed out of band, using other means, BTCPay Server will detect it and mark it complete anyway.
With this system, a payout processor can create pending transactions out of payouts awaiting payments, and mark them as in progress. We can make the system send emails when a pending transaction is created to alert signing parties to come online and sign. If more payouts are added to the awaiting payment list, and the previous pending transaction did not collect any signatures, we can cancel that pending transaction, and create a fresh pending transaction with all the new payouts too, reducing the number of transactions needed.
Essentially, this system enables functionality that was deemed to be only possible for hot wallets.
There is also an optional expiry so that pending transactions can expire (as the fees are determined at the time of the transaction creation, you do not want the pending transaction to be there for too long and avoid the need of another fee bump transaction).
Currently, pending transactions show at the top of the transactions list.