elements icon indicating copy to clipboard operation
elements copied to clipboard

Getting duplicated address error when sending different assets to the same address in the same transaction

Open SonnyAD opened this issue 3 years ago • 2 comments

Hello,

I believe we should be able to send different assets to the same address at once in the same transaction, but I get this error: Invalid parameter, duplicated address when I try to do it.

It happens when I do a createrawtransaction, so I think around this line: https://github.com/ElementsProject/elements/blob/87028135adf4bc2beb160cab00a404a33f6c36ac/src/rpc/rawtransaction_util.cpp#L344

We should also look for what asset is being evaluated. Instead of looking of duplication of address, we should look for duplication of the tuple asset + address.

What do you think?

The test is not done there: https://github.com/ElementsProject/elements/blob/87028135adf4bc2beb160cab00a404a33f6c36ac/src/wallet/rpcwallet.cpp#L433 and there too: https://github.com/ElementsProject/elements/blob/87028135adf4bc2beb160cab00a404a33f6c36ac/src/wallet/rpcwallet.cpp#L3124

Cheers.

SonnyAD avatar Sep 22 '22 05:09 SonnyAD

I wouldn't mind adding this support if there's a use case for it, but

  • Address reuse is address reuse, even if you change assets, and we don't want to encourage this
  • The entire *rawtransaction workflow is soft-deprecated in favor of PSET. Can you use PSET for this instead?

apoelstra avatar Sep 22 '22 12:09 apoelstra

The entire *rawtransaction workflow is soft-deprecated in favor of PSET. Can you use PSET for this instead?

I see. Sure, I will give it a try.

Cheers

SonnyAD avatar Sep 22 '22 15:09 SonnyAD