# Small transaction failing with error - OutputTooSmallUTxO

**URL:** <https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280>\
**Category:** Community Technical Support\
**Tags:** transactions\
**Created:** [21 June 2021 12:10 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280 "2021-06-21T12:10:47Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jangid](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@jangid](https://forum.cardano.org/u/jangid)\
**Post date:** [21 June 2021 12:10 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280/1 "2021-06-21T12:10:47Z")

</div>

I am trying to understand the math here. Trying a small transaction. I created a payment address (payment.addr). And transferred 2 ADAs into it using two transactions of 1-1 each. Now the query results into this:

```auto
$cardano-cli query utxo --address $(cat payment.addr) --mainnet
                           TxHash TxIx Amount
--------------------------------------------------------------------------------------
8bd2d968c3adb9983cb1f6cb8c515b541adf7aedf99feab9398ceee4e8a6cf54 0 1000000 lovelace
afc92eadc28ccee4b138ecf4d5a515fce967cf81b34c6b67f226741c9e4a67a2 0 1000000 lovelace

```

Now, how can I transfer 200,000 Lovelace from this account to some other account? Because `"minUTxOValue": 1000000,`. If I pick one of the TxHash, it will leave less than 1000000 Lovelace. But we know that the balance in account is 2 ADAs.

I am following instructions from here: [https://github.com/input-output-hk/cardano-node/blob/master/doc/stake-pool-operations/simple\_transaction.md](https://github.com/input-output-hk/cardano-node/blob/master/doc/stake-pool-operations/simple_transaction.md).

The full output of the submit command is:

```auto
$ cardano-cli transaction submit --tx-file tx.signed --mainnet 

```

> Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [UtxowFailure (UtxoFailure (OutputTooSmallUTxO [(Addr Mainnet (KeyHashObj (KeyHash “141e397ad8b556dbfa855031311ee96599ae5fe322e3ef45b1b47c2d”)) (StakeRefBase (KeyHashObj (KeyHash “141e397ad8b556dbfa855031311ee96599ae5fe322e3ef45b1b47c2d”))),Value 200000 (fromList ))])),UtxowFailure (UtxoFailure (ValueNotConservedUTxO (Value 1000000 (fromList )) (Value 2000000 (fromList )))),UtxowFailure (UtxoFailure (OutsideValidityIntervalUTxO (ValidityInterval {invalidBefore = SNothing, invalidHereafter = SJust (SlotNo 32710357)}) (SlotNo 32710400)))])

**Update - even with 2 ADAs in TxHash it did not work:**

I tried one more thing. I transferred 2 ADAs from some other account to this acount. So the query output is:

```auto
$ cardano-cli query utxo --address $(cat payment.addr) --mainnet
                           TxHash TxIx Amount
--------------------------------------------------------------------------------------
8bd2d968c3adb9983cb1f6cb8c515b541adf7aedf99feab9398ceee4e8a6cf54 0 1000000 lovelace
afc92eadc28ccee4b138ecf4d5a515fce967cf81b34c6b67f226741c9e4a67a2 0 1000000 lovelace
f6eb9cfb0f9cf70392d65c0eefe0a9962c1304f97b0aa32e80733bb1e43ab749 0 2000000 lovelace

```

Even when I am using the last TxHash the submit output is same:

```auto
$ cardano-cli transaction submit --tx-file tx.signed --mainnet 

```

> Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [UtxowFailure (UtxoFailure (OutputTooSmallUTxO [(Addr Mainnet (KeyHashObj (KeyHash “141e397ad8b556dbfa855031311ee96599ae5fe322e3ef45b1b47c2d”)) (StakeRefBase (KeyHashObj (KeyHash “141e397ad8b556dbfa855031311ee96599ae5fe322e3ef45b1b47c2d”))),Value 200000 (fromList ))])),UtxowFailure (UtxoFailure (OutsideValidityIntervalUTxO (ValidityInterval {invalidBefore = SNothing, invalidHereafter = SJust (SlotNo 32711855)}) (SlotNo 32711855)))])

---

<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:** [21 June 2021 12:31 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280/2 "2021-06-21T12:31:25Z")

</div>

Hi!

you can add more --tx-in - it will add together your funds from each tx.  
in the last try have you transferred more the n 1 ADA?

> [@jangid](#):
>
> ValidityInterval

also try to add bigger slotNumber to `--invalid-hereafter`

---

<div class="post-metadata">

**Author:** ![jangid](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@jangid](https://forum.cardano.org/u/jangid)\
**Post date:** [21 June 2021 12:42 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280/3 "2021-06-21T12:42:31Z")

</div>

Tried bigger slot number; it did not work.

In the last try I tried to transfer 200,000 Lovelace. So the calculation is:

```auto
$ expr 2000000 - 200000 (amount to transfer) - 176413 (fee)
1623587

```

> Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [UtxowFailure (UtxoFailure (OutputTooSmallUTxO [(Addr Mainnet (KeyHashObj (KeyHash “141e397ad8b556dbfa855031311ee96599ae5fe322e3ef45b1b47c2d”)) (StakeRefBase (KeyHashObj (KeyHash “141e397ad8b556dbfa855031311ee96599ae5fe322e3ef45b1b47c2d”))),Value 200000 (fromList ))])),UtxowFailure (UtxoFailure (ValueNotConservedUTxO (Value 1000000 (fromList )) (Value 2000000 (fromList ))))])

---

<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:** [21 June 2021 12:44 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280/4 "2021-06-21T12:44:14Z")

</div>

could you copy here the whole transaction build?

---

<div class="post-metadata">

**Author:** ![jangid](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@jangid](https://forum.cardano.org/u/jangid)\
**Post date:** [21 June 2021 12:58 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280/5 "2021-06-21T12:58:33Z")

</div>

here is what I did:

> $ cardano-cli transaction build-raw --tx-in f6eb9cfb0f9cf70392d65c0eefe0a9962c1304f97b0aa32e80733bb1e43ab749#0 --tx-out $(cat payment2.addr)+0 --tx-out $(cat payment.addr)+0 --invalid-hereafter 0 --fee 0 --out-file tx.draft

> $ cardano-cli transaction calculate-min-fee --tx-body-file tx.draft --tx-in-count 1 --tx-out-count 2 --witness-count 1 --byron-witness-count 0 --mainnet --protocol-params-file protocol.json

> $ cardano-cli transaction build-raw --tx-in 8bd2d968c3adb9983cb1f6cb8c515b541adf7aedf99feab9398ceee4e8a6cf54#0 --tx-out $(cat payment2.addr)+200000 --tx-out $(cat payment.addr)+1623587 --invalid-hereafter 32710357 --fee 176413 --out-file tx.raw

> $ cardano-cli transaction sign --tx-body-file tx.raw --signing-key-file payment.skey --mainnet --out-file tx.signed

> $ cardano-cli transaction submit --tx-file tx.signed --mainnet

---

<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:** [21 June 2021 13:04 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280/6 "2021-06-21T13:04:50Z")

</div>

How about:  
`cardano-cli transaction build-raw --tx-in f6eb9cfb0f9cf70392d65c0eefe0a9962c1304f97b0aa32e80733bb1e43ab749#0 --tx-out $(cat payment2.addr)+1000000 --tx-out $(cat payment.addr)+823587 --invalid-hereafter 32710357 --fee 176413 --out-file tx.raw`

---

<div class="post-metadata">

**Author:** ![jangid](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@jangid](https://forum.cardano.org/u/jangid)\
**Post date:** [21 June 2021 13:09 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280/7 "2021-06-21T13:09:40Z")

</div>

This also did not work. I change the invalid-hereafter value also.

```auto
$ cardano-cli transaction submit --tx-file tx.signed --mainnet 

```

> Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [UtxowFailure (UtxoFailure (OutputTooSmallUTxO [(Addr Mainnet (KeyHashObj (KeyHash “141e397ad8b556dbfa855031311ee96599ae5fe322e3ef45b1b47c2d”)) (StakeRefBase (KeyHashObj (KeyHash “141e397ad8b556dbfa855031311ee96599ae5fe322e3ef45b1b47c2d”))),Value 100000 (fromList )),(Addr Mainnet (KeyHashObj (KeyHash “33db7356f8d51f57075fdc21985c2315b6d980f1d3249ef898b0e09b”)) (StakeRefBase (KeyHashObj (KeyHash “bc355a10102ab448b52a4ae4983fd6707313135df344a609acf41b5f”))),Value 823587 (fromList ))])),UtxowFailure (UtxoFailure (ValueNotConservedUTxO (Value 1000000 (fromList )) (Value 1100000 (fromList ))))])

Should I try with something where both the output values are greater than 1 ADA?

---

<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:** [21 June 2021 13:17 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280/8 "2021-06-21T13:17:00Z")

</div>

ok, lets give it a try for this:

`cardano-cli transaction build-raw --tx-in 8bd2d968c3adb9983cb1f6cb8c515b541adf7aedf99feab9398ceee4e8a6cf54#0 --tx-in afc92eadc28ccee4b138ecf4d5a515fce967cf81b34c6b67f226741c9e4a67a2#0 --tx-in f6eb9cfb0f9cf70392d65c0eefe0a9962c1304f97b0aa32e80733bb1e43ab749#0 --tx-out $(cat payment2.addr)+1000000 --tx-out $(cat payment.addr)+2823587 --invalid-hereafter 33710357 --fee 176413 --out-file tx.raw`

---

<div class="post-metadata">

**Author:** ![jangid](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@jangid](https://forum.cardano.org/u/jangid)\
**Post date:** [21 June 2021 13:39 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280/9 "2021-06-21T13:39:14Z")

</div>

```auto
$ cardano-cli transaction sign --tx-body-file tx.raw --signing-key-file payment.skey --mainnet --out-file tx.signed 

```

> pankaj@eagle982:~/cardano-keys$ cardano-cli transaction submit --tx-file tx.signed --mainnet  
> Transaction successfully submitted.

Thanks a lot; this worked. I recalculated fee as well. with the new counts.

---

<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:** [21 June 2021 13:45 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280/10 "2021-06-21T13:45:52Z")

</div>

Good!

btw, what is the current utxo for payment.addr?

---

<div class="post-metadata">

**Author:** ![jangid](https://avatars.discourse-cdn.com/v4/letter/j/90ced4/32.png) [@jangid](https://forum.cardano.org/u/jangid)\
**Post date:** [21 June 2021 14:02 UTC](https://forum.cardano.org/t/small-transaction-failing-with-error-outputtoosmallutxo/65280/11 "2021-06-21T14:02:33Z")

</div>

```auto
$ cardano-cli query utxo --address $(cat payment.addr) --mainnet
                           TxHash TxIx Amount
--------------------------------------------------------------------------------------
85a3ba73440267f24a70527f1674138566d3238a490c7e6b19d47d6d3625c2c8 1 2816899 lovelace

```

The build command was:

> cardano-cli transaction build-raw --tx-in 8bd2d968c3adb9983cb1f6cb8c515b541adf7aedf99feab9398ceee4e8a6cf54#0 --tx-in afc92eadc28ccee4b138ecf4d5a515fce967cf81b34c6b67f226741c9e4a67a2#0 --tx-in f6eb9cfb0f9cf70392d65c0eefe0a9962c1304f97b0aa32e80733bb1e43ab749#0 --tx-out $(cat payment2.addr)+1000000 --tx-out $(cat payment.addr)+2816899 --invalid-hereafter 32716596 --fee 183101 --out-file tx.raw

So today’s conclusion is: none of the tx-out amounts should be less than `minUTxOValue`.
