UTxO Issue

Hi,

if I run:
cardano-cli query utxo --mainnet --address XXXXXXXXXXXX

the result is:

                      TxHash                                 TxIx        Amount

67f3247413d9bf52a184a0002e35ea60a4ac61acc8028a3bbc596dbaa51af839 4 3103380 lovelace + 500000000 1a71dc14baa0b4fcfb34464adc6656d0e562571e2ac1bc990c9ce5f6.574f4c46 + 1000000 1f4b1b277c9c001c1522727506a2cfb401a0d0ade069b0241f16f07d.4849 + 100000 2d7444cf9e317a12e3eb72bf424fd2a0c8fbafedf10e20bfdb4ad8ab.434845444441 + 1000000 8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc3.4c4f4253544552 + 5000000 8d0ae3c5b13b47907b16511a540d47436d12dcc96453c0f59089b451.42524f4f4d + 1000000 a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59 + 420000000000 b788fbee71a32d2efc5ee7d151f3917d99160f78fb1e41a1bbf80d8f.4c454146544f4b454e + 5000 c68307e7ca850513507f1498862a57c7f4fae7ba8e84b8bc074093a9.44494253 + 10000000 e14fe3ab348f9a6198359481472601f4557b9f86984f40a186a3b1e8.434845525259 + 1000000 ea2d23f1fa631b414252824c153f2d6ba833506477a929770a4dd9c2.4d414442554c + TxOutDatumNone

As you see I have different token on my pool.
I would like to transfer this token on my Daedalus wallet, but when i try to build a transaction:

txout=“addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee+2000000 +500000000 1a71dc14baa0b4fcfb34464adc6656d0e562571e2ac1bc990c9ce5f6.574f4c46 +1000000 1f4b1b277c9c001c1522727506a2cfb401a0d0ade069b0241f16f07d.4849 +100000 2d7444cf9e317a12e3eb72bf424fd2a0c8fbafedf10e20bfdb4ad8ab.434845444441 +1000000 8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc3.4c4f4253544552 +5000000 8d0ae3c5b13b47907b16511a540d47436d12dcc96453c0f59089b451.42524f4f4d +1000000 a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59 +420000000000 b788fbee71a32d2efc5ee7d151f3917d99160f78fb1e41a1bbf80d8f.4c454146544f4b454e +5000 c68307e7ca850513507f1498862a57c7f4fae7ba8e84b8bc074093a9.44494253 +10000000 e14fe3ab348f9a6198359481472601f4557b9f86984f40a186a3b1e8.434845525259 +1000000 ea2d23f1fa631b414252824c153f2d6ba833506477a929770a4dd9c2.4d414442554c”

cardano-cli transaction build --mainnet --tx-in 67f3247413d9bf52a184a0002e35ea60a4ac61acc8028a3bbc596dbaa51af839#4 --tx-out $txout --change-address addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee --protocol-params-file params.json --out-file tx.raw

the error occur:
Invalid argument `+500000000’

Usage: cardano-cli transaction build
[ --byron-era
| --shelley-era…

if I change the variable txout in:

txout=“addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee+2000000 +500000000 1a71dc14baa0b4fcfb34464adc6656d0e562571e2ac1bc990c9ce5f6.574f4c46 +1000000 1f4b1b277c9c001c1522727506a2cfb401a0d0ade069b0241f16f07d.4849 +100000 2d7444cf9e317a12e3eb72bf424fd2a0c8fbafedf10e20bfdb4ad8ab.434845444441 +1000000 8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc3.4c4f4253544552 +5000000 8d0ae3c5b13b47907b16511a540d47436d12dcc96453c0f59089b451.42524f4f4d +1000000 a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59 +420000000000 b788fbee71a32d2efc5ee7d151f3917d99160f78fb1e41a1bbf80d8f.4c454146544f4b454e +5000 c68307e7ca850513507f1498862a57c7f4fae7ba8e84b8bc074093a9.44494253 +10000000 e14fe3ab348f9a6198359481472601f4557b9f86984f40a186a3b1e8.434845525259 +1000000 ea2d23f1fa631b414252824c153f2d6ba833506477a929770a4dd9c2.4d414442554c”

OR

txout="addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee+2000000
–tx-out 1a71dc14baa0b4fcfb34464adc6656d0e562571e2ac1bc990c9ce5f6.574f4c46+0
–tx-out 1f4b1b277c9c001c1522727506a2cfb401a0d0ade069b0241f16f07d.4849+0
–tx-out 2d7444cf9e317a12e3eb72bf424fd2a0c8fbafedf10e20bfdb4ad8ab.434845444441+0 \
–tx-out 8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc3.4c4f4253544552+0
–tx-out 8d0ae3c5b13b47907b16511a540d47436d12dcc96453c0f59089b451.42524f4f4d+0
–tx-out a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59+0
–tx-out b788fbee71a32d2efc5ee7d151f3917d99160f78fb1e41a1bbf80d8f.4c454146544f4b454e+0
–tx-out c68307e7ca850513507f1498862a57c7f4fae7ba8e84b8bc074093a9.44494253+0
–tx-out e14fe3ab348f9a6198359481472601f4557b9f86984f40a186a3b1e8.434845525259+0
–tx-out ea2d23f1fa631b414252824c153f2d6ba833506477a929770a4dd9c2.4d414442554c+0 "

OR

txout=“addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee+2000000+500000000 1a71dc14baa0b4fcfb34464adc6656d0e562571e2ac1bc990c9ce5f6.574f4c46+1000000 1f4b1b277c9c001c1522727506a2cfb401a0d0ade069b0241f16f07d.4849+100000 2d7444cf9e317a12e3eb72bf424fd2a0c8fbafedf10e20bfdb4ad8ab.434845444441+1000000 8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc3.4c4f4253544552+5000000 8d0ae3c5b13b47907b16511a540d47436d12dcc96453c0f59089b451.42524f4f4d+1000000 a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59+420000000000 b788fbee71a32d2efc5ee7d151f3917d99160f78fb1e41a1bbf80d8f.4c454146544f4b454e+5000 c68307e7ca850513507f1498862a57c7f4fae7ba8e84b8bc074093a9.44494253+10000000 e14fe3ab348f9a6198359481472601f4557b9f86984f40a186a3b1e8.434845525259+1000000 ea2d23f1fa631b414252824c153f2d6ba833506477a929770a4dd9c2.4d414442554c”

the result is quite similar.

Can anyone help me to create the correct transaction?

Just put quotation marks around $txout: --tx-out "$txout"

(It contains quite a lot of spaces and they need to be masked. Otherwise the shell thinks that the --tx-out is already finished and the other tokens are new arguments to cardano-cli.)

1 Like

ok, now i put “$txout”, with the parameters:

txout=“addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee+2000000 +500000000 1a71dc14baa0b4fcfb34464adc6656d0e562571e2ac1bc990c9ce5f6.574f4c46 +1000000 1f4b1b277c9c001c1522727506a2cfb401a0d0ade069b0241f16f07d.4849 +100000 2d7444cf9e317a12e3eb72bf424fd2a0c8fbafedf10e20bfdb4ad8ab.434845444441 +1000000 8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc3.4c4f4253544552 +5000000 8d0ae3c5b13b47907b16511a540d47436d12dcc96453c0f59089b451.42524f4f4d +1000000 a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59 +420000000000 b788fbee71a32d2efc5ee7d151f3917d99160f78fb1e41a1bbf80d8f.4c454146544f4b454e +5000 c68307e7ca850513507f1498862a57c7f4fae7ba8e84b8bc074093a9.44494253 +10000000 e14fe3ab348f9a6198359481472601f4557b9f86984f40a186a3b1e8.434845525259 +1000000 ea2d23f1fa631b414252824c153f2d6ba833506477a929770a4dd9c2.4d414442554c”

the transaction:

cardano-cli transaction build --mainnet --tx-in 67f3247413d9bf52a184a0002e35ea60a4ac61acc8028a3bbc596dbaa51af839#4 --tx-out “$txout” --change-address addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee --protocol-params-file params.json --out-file tx.raw

And I receive the error:

Command failed: transaction build Error: Minimum UTxO threshold not met for tx output: addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee + 2000000 lovelace + 500000000 1a71dc14baa0b4fcfb34464adc6656d0e562571e2ac1bc990c9ce5f6.574f4c46 + 1000000 1f4b1b277c9c001c1522727506a2cfb401a0d0ade069b0241f16f07d.4849 + 100000 2d7444cf9e317a12e3eb72bf424fd2a0c8fbafedf10e20bfdb4ad8ab.434845444441 + 1000000 8654e8b350e298c80d2451beb5ed80fc9eee9f38ce6b039fb8706bc3.4c4f4253544552 + 5000000 8d0ae3c5b13b47907b16511a540d47436d12dcc96453c0f59089b451.42524f4f4d + 1000000 a0028f350aaabe0545fdcb56b039bfb08e4bb4d8c4d7c3c7d481c235.484f534b59 + 420000000000 b788fbee71a32d2efc5ee7d151f3917d99160f78fb1e41a1bbf80d8f.4c454146544f4b454e + 5000 c68307e7ca850513507f1498862a57c7f4fae7ba8e84b8bc074093a9.44494253 + 10000000 e14fe3ab348f9a6198359481472601f4557b9f86984f40a186a3b1e8.434845525259 + 1000000 ea2d23f1fa631b414252824c153f2d6ba833506477a929770a4dd9c2.4d414442554c
Minimum required UTxO: Lovelace 3103380

Since you have so many tokens in that output, it needs a bit more ADA accompanying it. Thankfully, it already tells you how much exactly.

Just replace the first +2000000 (that are the ADA/Lovelace in the output) by +3103380.

ok thank you, now i tried with:

cardano-cli transaction build --mainnet --tx-in 67f3247413d9bf52a184a0002e35ea60a4ac61acc8028a3bbc596dbaa51af839#4 --tx-out “$txout” --change-address addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee --protocol-params-file params.json --out-file tx.raw
Command failed: transaction build Error: The transaction does not balance in its use of ada. The net balance of the transaction is negative: Lovelace (-187017) lovelace. The usual solution is to provide more inputs, or inputs with more ada.

and add another tx-in with 1000000 lovelace, but i receive an error:

cardano-cli transaction build --mainnet --tx-in 67f3247413d9bf52a184a0002e35ea60a4ac61acc8028a3bbc596dbaa51af839#4 --tx-in 336d91f644e41bae26ccbb8b60cca4266c555d87f6d6ca6215ce9b4d58a90f1c#0 --tx-out “$txout” --change-address addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee --protocol-params-file params.json --out-file tx.raw

Command failed: transaction build Error: The transaction does balance in its use of ada, however the net balance does not meet the minimum UTxO threshold.

Balance: Lovelace 806955

Offending output (change output): addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee + 806955 lovelace

Minimum UTxO threshold: Lovelace 999978

The usual solution is to provide more inputs, or inputs with more ada to meet the minimum UTxO threshold

Do you have a UTxO with more ADA that you can use?

The story is: We now have the minimum 3103380 Lovelace for the outgoing transaction with the assets, but the output generated at the change address with the change staying at the address also has to have a minimum: 999978 Lovelace. And the second --tx-in you chose does not provide enough (after substracting the fee).

Other possibility could be to just send more along with the tokens to your Daedalus wallet and get no change at all: You could try to increase the ADA at the --tx-out to 3910335 (3103380 + 806955) with or without --change-address.

well, finally it works! thank you! (I spent over 10 days)
so the solution was:

  • include quotation mark to the variable (in my case, “$txout”)
  • add another tx-in transaction with more ADA (in my case 3 ADA)

this is my transaction, I hope can help someone else:

cardano-cli transaction build --mainnet --tx-in 67f3247413d9bf52a184a0002e35ea60a4ac61acc8028a3bbc596dbaa51af839#4 --tx-in 4fc8850648d0c01ee5762c57963718245e65be8b49f3ef85eacd44837c6cd0f7#0 --tx-out “$txout” --change-address addr1q8jcrumgsjv8l058x6vadf8ffna02e7zvnt8pftggs0xdq4phhcq397aplkwhxkr8mtk8j97sjf9l8kglrred4uew7pqyyvkee --protocol-params-file params.json --out-file tx.raw
Estimated transaction fee: Lovelace 193045

thank you again [HeptaSean]

1 Like