Small transaction failing with error - OutputTooSmallUTxO

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:

$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.

The full output of the submit command is:

$ 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:

$ 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:

$ 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)))])

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?

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

Tried bigger slot number; it did not work.

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

$ 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 ))))])

could you copy here the whole transaction build?

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

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

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

$ 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?

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

1 Like
$ 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.

1 Like

Good!

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

$ 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.

2 Likes