Is it possible to constrain a single asset by vout

+1 vote
Hello,

I want to know if it is possible to constrain one asset per vout.

I will explain with a use case :

- I have a transaction tx1, having 10 asset@A in unspent vout X

- I have a transaction tx2, having 12 asset@B in unspent vout Y

- I create a new transaction tx3 that do these things :

-- Taking as vin0 the tx1 voutX

-- Taking as vin1 the tx2 voutY

-- Burning 5 asset@A and 6 asset@B.

-- Issuing 5+6=11 asset@C

-- Sending the remaining assets to the proper addresses.

Finally, I have for tx3:

- vout 0: Sending 5 asset@A and 6 asset@B to burnAddress

- vout1: ....

- vout2: Sending the issued 11 asset@C to original address

- vout3: nulldata

- vout4: nulldata

- vout5: nulldata

- vout6: Sending back the remaining 5 asset@A and 6 asset@B to original address.

Is there any way to have instead :

- vout6: Sending back the remaining 5 asset@A to original address.

- vout7: Sending back the remaining 6 asset@B to original address.

Thanks.
asked Apr 26, 2018 by Daanoth
edited Apr 26, 2018

1 Answer

0 votes

If these assets are being combined together in a single output in a way you don't like, you should be able to use createrawsendfrom to force them to go into different outputs. Explicitly specify vout6 as sending back the remaining 5 asset@A to the original address, then it should automatically add the change output vout7 as you wanted.

You can also use createrawtransaction + appendrawtransaction in which case no change outputs are created automatically.

Note that in either case you might not get the exact ordering of outputs that you want, but hopefully that should not matter.

answered Apr 26, 2018 by MultiChain
...