revaultd icon indicating copy to clipboard operation
revaultd copied to clipboard

Handle user sending to CPFP/deposit addresses at spend creation

Open danielabrozzoni opened this issue 3 years ago • 1 comments

If the user decides to send funds to the same address as the change, we should merge the two outputs

Example:

Vault is 10 BTC User wants to send 2 BTC to *change_address* We currently create the tx like:

Inputs:
10 BTC
Outputs:
2 BTC to *change address*
0.xxxx BTC to *cpfp address*
7.xxxx BTC to *change address*

We should do instead:

Inputs:
10 BTC
Outputs:
0.xxxx BTC to *cpfp address*
9.xxxx BTC to *change address*

What should we do if the user decides to send funds to a CPFP address?

We can either restrict it or merge the output with the CPFP output

danielabrozzoni avatar Jun 01 '21 16:06 danielabrozzoni

What should we do if the user decides to send funds to a CPFP address?

I think we should for now duplicate it, since the CPFP output value computation is a trick it could be a sneaky source of bugs to try to be smart for now.

darosior avatar Jun 15 '21 12:06 darosior