# Create a transaction

**URL:** <https://forum.cardano.org/t/create-a-transaction/64432>\
**Category:** Misc Dev Talk\
**Tags:** cardano\
**Created:** [8 June 2021 19:22 UTC](https://forum.cardano.org/t/create-a-transaction/64432 "2021-06-08T19:22:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![green-miner](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@green-miner](https://forum.cardano.org/u/green-miner)\
**Post date:** [8 June 2021 19:22 UTC](https://forum.cardano.org/t/create-a-transaction/64432/1 "2021-06-08T19:22:25Z")

</div>

Hi - I am using Cardano-cli to perform a transaction like  
[https://docs.cardano.org/projects/cardano-node/en/latest/stake-pool-operations/simple\_transaction.html](https://docs.cardano.org/projects/cardano-node/en/latest/stake-pool-operations/simple_transaction.html)

Above guide works for me when I want to transfer partial amount from UTXO to destination account.

Now I want to do a transaction where full amount to a account. So the amount left ultimately will be zero. And that transaction doesn’t work. It fails `UtxowFailure (UtxoFailure (OutputTooSmallUTxO`

How do you create a transaction where you nothing is left in the original utxo and everything(-fees) is send to destination account?

---

<div class="post-metadata">

**Author:** ![bwbush](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/bwbush/32/29827_2.png) [@bwbush](https://forum.cardano.org/u/bwbush)\
**Post date:** [8 June 2021 23:19 UTC](https://forum.cardano.org/t/create-a-transaction/64432/2 "2021-06-08T23:19:06Z")

</div>

The error message may be a result of having a `--tx-out` with 0 lovelace. If no change/remainder is left, then there should be no `--tx-out` to that address.

---

<div class="post-metadata">

**Author:** ![laplasz](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/laplasz/32/15238_2.png) [@laplasz](https://forum.cardano.org/u/laplasz)\
**Post date:** [9 June 2021 21:35 UTC](https://forum.cardano.org/t/create-a-transaction/64432/3 "2021-06-09T21:35:51Z")

</div>

Hi!

Are you still facing with this issue?

---

<div class="post-metadata">

**Author:** ![green-miner](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@green-miner](https://forum.cardano.org/u/green-miner)\
**Post date:** [11 June 2021 03:59 UTC](https://forum.cardano.org/t/create-a-transaction/64432/4 "2021-06-11T03:59:33Z")

</div>

No it got resolved after following what bwbush said

---

<div class="post-metadata">

**Author:** ![Hoang\_Hoang](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@Hoang\_Hoang](https://forum.cardano.org/u/Hoang_Hoang)\
**Post date:** [14 August 2021 03:17 UTC](https://forum.cardano.org/t/create-a-transaction/64432/5 "2021-08-14T03:17:27Z")

</div>

hi bwbush,  
what if the sender want to send all the lovelace, but keep other asset, then should the txOut of sender be

–tx-out “address+0+900000000 asset1+200000 asset2+200000”  
or  
–tx-out “address+900000000 asset1+200000 asset2+200000”

---

<div class="post-metadata">

**Author:** ![bwbush](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/bwbush/32/29827_2.png) [@bwbush](https://forum.cardano.org/u/bwbush)\
**Post date:** [14 August 2021 03:30 UTC](https://forum.cardano.org/t/create-a-transaction/64432/6 "2021-08-14T03:30:15Z")

</div>

Each output must include at least the [min-ADA](https://cardano-ledger.readthedocs.io/en/latest/explanations/min-utxo.html), which is 1 ADA for tokenless outputs, but 1.6 ADA or more for outputs with tokens. You can use `cardano-cli transaction calculate-min-value` to calculate that minimum.

So, if you want to separate the tokens from as much of the ADA as possible, you’d need two outputs, something like the following:

```
--tx-out "tokenreceiveraddress+1700000+200000 asset1+200000 asset2
--tx-out "adareceiveraddress+898300000"

```

This assumes there are 900000000 ADA and 200000 each of asset1 and asset2. The first output keeps all of the tokens at `tokenreceiveraddress` and includes just the min-ADA, while the second output sends most of the ADA to `adareceiveraddress`.

---

<div class="post-metadata">

**Author:** ![Hoang\_Hoang](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@Hoang\_Hoang](https://forum.cardano.org/u/Hoang_Hoang)\
**Post date:** [14 August 2021 13:00 UTC](https://forum.cardano.org/t/create-a-transaction/64432/7 "2021-08-14T13:00:44Z")

</div>

hi @bwbush according to what you said earlier, it seems like it’s possible to transfer all off your lovelace.  
but on the previous comment, it seems it’s not possible? so for conclusion, right now, you can’t transfer all of your lovelace into another account, am I right ?  
 ![image](https://us1.discourse-cdn.com/flex023/uploads/cardano/original/3X/c/b/cbae8d81dadd0d5ac97ee9b14599d8f3f0c32ad4.png)

---

<div class="post-metadata">

**Author:** ![bwbush](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/bwbush/32/29827_2.png) [@bwbush](https://forum.cardano.org/u/bwbush)\
**Post date:** [14 August 2021 14:07 UTC](https://forum.cardano.org/t/create-a-transaction/64432/8 "2021-08-14T14:07:22Z")

</div>

I apologize for the confusion.To clarify, the 0 lovelace output should have either been removed from the transaction or have had the min-ADA added to it. Every output of every transaction must have the min ADA.

---

<div class="post-metadata">

**Author:** ![Hoang\_Hoang](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@Hoang\_Hoang](https://forum.cardano.org/u/Hoang_Hoang)\
**Post date:** [14 August 2021 14:51 UTC](https://forum.cardano.org/t/create-a-transaction/64432/9 "2021-08-14T14:51:00Z")

</div>

hi @bwbush,  
as I checked on Daedalus Mainnet App, I see that even I have 1.5ADA, I can transfer maximum ADA I have ( which is 1 ADA) after Fee, so does Daedalus have different kind of mechanism of transfering ADA compare to cardano-cli ?  
 ![image](https://us1.discourse-cdn.com/flex023/uploads/cardano/original/3X/6/1/614ed8b13478f66462dee7e097ae0325366eb7b8.png)

---

<div class="post-metadata">

**Author:** ![bwbush](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/bwbush/32/29827_2.png) [@bwbush](https://forum.cardano.org/u/bwbush)\
**Post date:** [14 August 2021 15:07 UTC](https://forum.cardano.org/t/create-a-transaction/64432/10 "2021-08-14T15:07:13Z")

</div>

Daedalus hides the details of sending the remaining “change” from a transaction back to the originating wallet. It also doesn’t let you choose exactly which UTxOs are spent. In `cardano-cli` you have to choose the input UTxOs and specify both the output to the destination address and the output of the remaining ADA (if any) back to your wallet.

Daedalus makes decisions about which UTxOs to combine in a transaction. Sometimes that results in higher fees than strictly necessary. Mostly, it appears that Daedalus tries to minimize the number of UTxOs that a wallet holds.

BTW, if you have 1.5 ADA in a wallet, then sending 1.0 ADA to an address would mean that the remaining 0.5 ADA (minus fee) would have to be sent back to the originating wallet. However, that output of less than 0.5 ADA violates the min-ADA rule, which requires that each output, including the remaining “change” has at least 1.0 ADA. Daedalus deals with this by increasing the fee to 0.5 ADA, so that the transaction balances, even though the minimum fee for this transaction is about 0.15 ADA.

---

<div class="post-metadata">

**Author:** ![bwbush](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/bwbush/32/29827_2.png) [@bwbush](https://forum.cardano.org/u/bwbush)\
**Post date:** [14 August 2021 15:11 UTC](https://forum.cardano.org/t/create-a-transaction/64432/11 "2021-08-14T15:11:18Z")

</div>

P.S. Version 1.28.0 of `cardano-cli` has both a `transaction build` and a `transaction build-raw` command. The `transaction build` command handles the remaining “change” automatically, but `transaction build-raw` behaves like version 1.27.0, which doesn’t automate that.

---

<div class="post-metadata">

**Author:** ![Hoang\_Hoang](https://avatars.discourse-cdn.com/v4/letter/h/ed8c4c/32.png) [@Hoang\_Hoang](https://forum.cardano.org/u/Hoang_Hoang)\
**Post date:** [14 August 2021 16:14 UTC](https://forum.cardano.org/t/create-a-transaction/64432/12 "2021-08-14T16:14:49Z")

</div>

hi @bwbush , sorry, I don’t clearly understand the explanation you did. could you maybe draw a utxo diagram of a possible scenario that Daedalus did?  
Thank you for your support
