Multisig/watchonly wallet transaction creation flow proof of concept#5743
Conversation
|
rebased branch on latest |
3f04e86 to
92a10a0
Compare
68ffada to
ab344ab
Compare
|
So after a bit of time, we're finally at the point where this PR can be merged. All the added functionality is now hidden behind multisig.on.server.in.action.mp4The video showcases full flow on mainnet with using different Jade hardware wallets to sign PSBT 2 times. |
| public string[] OutpointsUsed { get; set; } | ||
|
|
||
| [NotMapped][Obsolete("Use Blob2 instead")] | ||
| public byte[] Blob { get; set; } |
There was a problem hiding this comment.
Remove this, there is no point in having this column... this column is present in some table just because I couldn't really migrate it easily.
There was a problem hiding this comment.
It can't be removed since IHasBlob interface depends on it. That's why it's [NotMapped] so it doesn't go in the database. We need to first remove it from underlying interface.
219318d to
d1f080d
Compare
|
@NicolasDorier addressed all the items you've brought up, take a look and let me know how it looks now. |
This reverts commit f85d117.
4893608 to
ba52e5c
Compare
3c4707e to
d7953ff
Compare
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.