Command failed: transaction submit Error: Error while submitting tx

Hi, I have successfully minted the token in my testnet but when i am trying to transact the minted tokens to my deadalus test net wallet I am getting error.

When I am trying to see balance using this command
cardano-cli query utxo --address $(cat payment.addr) --testnet-magic 1097911063 --cardano-mode

This is what i am getting.

TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
8e6ece3c2fde93fb741bee62ececb886c1108d3a1c287ab29cc6a887c33b757e     0        9811135 lovelace + 1000 c5edbeaed052fa6e3e3f1ced8e39fdb9900b910622ead746ee938cff.eduladderTestCoin + TxOutDatumNone

Now I want to sent it to a deadalus testnet wallet.

The steps which I am following is as follows.

cardano-cli transaction build-raw

--fee 177381

--tx-in 8e6ece3c2fde93fb741bee62ececb886c1108d3a1c287ab29cc6a887c33b757e#0 --tx-out addr_test1qp62uukdt5q588ggeu0j7hwe2jdjrqecmvt6mc4hy4luvlvvdm7hkdy4dtdmsvxg3gc0ddg52etkffmf0sx4rl5zwv7sg5vcyv+2+"2 $(cat policy/tokens/policy.id).eduladderTestCoin"

--tx-out $(cat payment.addr)+9633752+"998 $(cat policy/tokens/policy.id).eduladderTestCoin"

--out-file token_tx.raw

Create the protocol.

cardano-cli query protocol-parameters \

--testnet-magic 1097911063 \

--out-file protocol.json

Get the fee.

cardano-cli transaction calculate-min-fee \

--tx-body-file token_tx.raw \

--tx-in-count 1 \

--tx-out-count 1 \

--witness-count 1 \

--byron-witness-count 0 \

--testnet-magic 1097911063 \

--protocol-params-file protocol.json

Again with the updated fee.

cardano-cli transaction build-raw

--fee 177557

--tx-in 8e6ece3c2fde93fb741bee62ececb886c1108d3a1c287ab29cc6a887c33b757e#0 --tx-out addr_test1qp62uukdt5q588ggeu0j7hwe2jdjrqecmvt6mc4hy4luvlvvdm7hkdy4dtdmsvxg3gc0ddg52etkffmf0sx4rl5zwv7sg5vcyv+2+"2 $(cat policy/tokens/policy.id).eduladderTestCoin"

--tx-out $(cat payment.addr)+9633576+"998 $(cat policy/tokens/policy.id).eduladderTestCoin"

--out-file token_tx.raw

Now sign the transaction.

cardano-cli transaction sign \

--signing-key-file payment.skey \

--signing-key-file policy/policy.skey \

--testnet-magic 1097911063 \

--tx-body-file alien_babies_tx.raw \

--out-file token_tx.raw.signed

Now sent the same

cardano-cli transaction submit \

--tx-file token_tx.raw.signed \

--testnet-magic 1097911063

But I am getting the following error.

Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (OutputTooSmallUTxO [(Addr Testnet (KeyHashObj (KeyHash "74ae72cd5d01439d08cf1f2f5dd9549b218338db17ade2b7257fc67d")) (StakeRefBase (KeyHashObj (KeyHash "8c6efd7b34956adbb830c88a30f6b514565764a7697c0d51fe82733d"))),Value 0 (fromList [(PolicyID {policyID = ScriptHash "c5edbeaed052fa6e3e3f1ced8e39fdb9900b910622ead746ee938cff"},fromList [("eduladderTestCoin",2)])]),SNothing),(Addr Testnet (KeyHashObj (KeyHash "6baa0d059efc68aefaf4d30c639d62a894b2568b874e06d4f5a39c15")) StakeRefNull,Value 0 (fromList [(PolicyID {policyID = ScriptHash "c5edbeaed052fa6e3e3f1ced8e39fdb9900b910622ead746ee938cff"},fromList [("eduladderTestCoin",998)])]),SNothing)]))),UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (ValueNotConservedUTxO (Value 9811135 (fromList [(PolicyID {policyID = ScriptHash "c5edbeaed052fa6e3e3f1ced8e39fdb9900b910622ead746ee938cff"},fromList [("eduladderTestCoin",1000)])])) (Value 188865 (fromList [(PolicyID {policyID = ScriptHash "c5edbeaed052fa6e3e3f1ced8e39fdb9900b910622ead746ee938cff"},fromList [("eduladderTestCoin",1000)])])))))])

Where am i going wrong?

This is what you are doing wrong:

You probably want to send 2 ADA with the tokens, but you are only sending 2 lovelace.
Use this if you want to send 2 ADA:
--tx-out addr_test1qp62uukdt5q588ggeu0j7hwe2jdjrqecmvt6mc4hy4luvlvvdm7hkdy4dtdmsvxg3gc0ddg52etkffmf0sx4rl5zwv7sg5vcyv+2000000+"2 $(cat policy/tokens/policy.id).eduladderTestCoin"

It is shown transaction successfull. How long will it takes it to reflect in my deadalus wallet?

I assume it’s already visible in your Daedalus now.

Yeah, It was successfull but whe I am doing this I am getting FeeTooSmallUTxO (Coin 175797) Error.

Steps I have done.

cardano-cli transaction build-raw
--fee 177381
--tx-in 49de023b940b08e12ef00e833831ae7052090abdfb0303d8b1d76b8fbd68f597#1 --tx-out addr_test1qpht20jwyvqlhv4nx2thqnwr2ac8ackts3v0uj4d2hcy355vdm7hkdy4dtdmsvxg3gc0ddg52etkffmf0sx4rl5zwv7spnxgsg+2000000+"998 $(cat policy/tokens/policy.id).eduladderTestCoin"
--tx-out $(cat payment.addr)+5456021+"0 $(cat policy/tokens/policy.id).eduladderTestCoin"
--out-file token_tx.raw

Create the protocol.

cardano-cli query protocol-parameters \
--testnet-magic 1097911063 \
--out-file protocol.json

Get the fee.

cardano-cli transaction calculate-min-fee \
--tx-body-file token_tx.raw \
--tx-in-count 1 \
--tx-out-count 1 \
--witness-count 1 \
--byron-witness-count 0 \
--testnet-magic 1097911063 \
--protocol-params-file protocol.json

Again with the updated fee.

cardano-cli transaction build-raw
--fee 175445
--tx-in 49de023b940b08e12ef00e833831ae7052090abdfb0303d8b1d76b8fbd68f597#1 --tx-out addr_test1qpht20jwyvqlhv4nx2thqnwr2ac8ackts3v0uj4d2hcy355vdm7hkdy4dtdmsvxg3gc0ddg52etkffmf0sx4rl5zwv7spnxgsg+2000000+"998 $(cat policy/tokens/policy.id).eduladderTestCoin"
--tx-out $(cat payment.addr)+5457957+"998 $(cat policy/tokens/policy.id).eduladderTestCoin"
--out-file token_tx.raw

Now sign the transaction.

cardano-cli transaction sign \
--signing-key-file payment.skey \
--signing-key-file policy/policy.skey \
--testnet-magic 1097911063 \
--tx-body-file token_tx.raw \
--out-file token_tx.raw.signed

Now sent the same

cardano-cli transaction submit \
--tx-file token_tx.raw.signed \
--testnet-magic 1097911063

Here i am getting this error.

Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (ValueNotConservedUTxO (Value 7633402 (fromList [(PolicyID {policyID = ScriptHash "c5edbeaed052fa6e3e3f1ced8e39fdb9900b910622ead746ee938cff"},fromList [("eduladderTestCoin",998)])])) (Value 7633402 (fromList [(PolicyID {policyID = ScriptHash "c5edbeaed052fa6e3e3f1ced8e39fdb9900b910622ead746ee938cff"},fromList [("eduladderTestCoin",1996)])]))))),UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (FeeTooSmallUTxO (Coin 175797) (Coin 175445))))])

Any idea?

You are signing with two keys. --witness-count has to be 2.

And also: You have two --tx-outs. --tx-out-count also has to be 2.

The balance count was wrong. Its worked with the solution from @georgem1976 Thanks

1 Like