elements icon indicating copy to clipboard operation
elements copied to clipboard

[WIP] added createrawtransaction rpc

Open tomt1664 opened this issue 4 years ago • 2 comments

Inputs same format as createrawtransaction (an array of outpoints), but with that RPC you also supply a map of addresses to amounts and then another map of addresses to asset IDs (meaning you cannot have two outputs with the same address). createrawtxoutputs you specify all outputs explicitly (via the second array).

Several use cases where users want to send different assets to the same address in the same transaction.

tomt1664 avatar Apr 14 '20 07:04 tomt1664

Hmm, I agree that this way of inputting things is a lot better than the current createrawtransaction way. The latter is really hacked to be backwards compatible with Core.

We're discussing how we can get rid of the intrinsic 8-decimal Bitcoin notation and one of the potential solutions is to create alternatives for a lot of the RPC methods, so this might fit into that picture.

stevenroose avatar Apr 14 '20 13:04 stevenroose

I think a better approach would be to just change ConstructTransaction in rpc/rawtransaction_util.cpp so that the duplicate check checks (destination, asset) pairs instead of just destination. This would be a much smaller change and then would be consistent across createrawtransaction sendmany, send, etc

apoelstra avatar Sep 10 '21 13:09 apoelstra