Question about ChangeAddress during a Transaction

Hello everyone.

I’ve noticed that you can set a Change Address to send back to it the difference of the transaction, in cases where this is below de minimum ADA, it burns. I understand this.

  • But what happens if I don’t set a Change Address, will all the remaining get burn?
  • Can I avoid setting a Change Address by just setting up the difference of the transaction as a new output?

To explain this last point, let’s suppose I own 10.6 ADA in 3 differents UTXO as follow. (We’ll ignore fees for the following examples)

HASH               INDEX                AMOUNT
000a                   1               2100000           
000b                   4               2750000           
000c                   3               5750000                    

To send 8.60 ADA to a friend I would need to combine 3 of the inputs. So taking the 3 inputs, I would need to set up the outputs as follow.

ADDRESS           AMOUNT
my_address       2000000
my_friends       8600000
  • In this way, I’m specifying on my own that I need 2 ADA back to my address by setting it up on the output of the transaction. Am I correct?

Also, I’m in the possibility of splitting those 2 ADA into 2 different outputs to separate them in my next UTxO update, like this:

ADDRESS           AMOUNT
my_address       1000000
my_address       1000000
my_friends       8600000
  • Is this valid? It might be dumb to have 2 separated 1 ADA UTxO, but it’s just to illustrate the possibility.

Yes - since you’re ignoring fees , that is how HD wallets work. Note that every additional UTXO will increase the size of transaction and thus, marginally increase the fee as well, but it is all valid.

Great!

I’m trying to implement it with multi-assets UTxO, so I also don’t want to have UTxOs with huge amount of different policies/assets in it.

So the tricky part would be to balance the amount of UTxOs of the account with the amount of multi-assets in each UTxO.

Would having an UTxO with a very big amount of multi-assets (Let’s suppose: +1000 different policies/assets) increase the fee of a transaction?

Or would only increase the minimum ADA of the UTxO?

Yes - as size of the transaction increases (ofcourse it might still be cheaper than creating X amount of transactions. Besides the increase might be nominal lovelaces per additional output)

will increase the both

2 Likes

FYI: The table at the end of this document provides a sense of how min-ADA varies with the composition of the token bundle: Min-Ada-Value Requirement — Cardano Ledger 1.0.0 documentation

2 Likes