Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError

Steps I have followed.

cardano-cli query utxo --address $(cat payment.addr) --testnet-magic 1097911063 --cardano-mode
                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
08b66cb1d10329b651f8d947f5bdd107effa4fc1d3a5fde94d007f261ea6edce     0        99806251 lovelace + 1000 3510b5d632d14fec53e51c6d2f9fa355ce20113ae376e296ef4c1d3a.6564756c616464657254657374436f696e32 + TxOutDatumNone
cardano-cli transaction build-raw \
--fee 175665 \
--tx-in 08b66cb1d10329b651f8d947f5bdd107effa4fc1d3a5fde94d007f261ea6edce#1 \
--tx-out addr_test1qqk3yya0gc6tc45xlya79jfsa8pxtcyjpmuejkm7spza8uvvdm7hkdy4dtdmsvxg3gc0ddg52etkffmf0sx4rl5zwv7seynpux+2000000+"1000 $(cat policy/tokens/policy.id).6564756c616464657254657374436f696e32" \
--tx-out $(cat payment.addr)+97630586+"0 $(cat policy/tokens/policy.id).6564756c616464657254657374436f696e32" \
--out-file alien_babies_tx.raw

Sign the transaction.

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

Submit the transaction.

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

And i am getting this error.

Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (ValueNotConservedUTxO (Value 0 (fromList [])) (Value 99806251 (fromList [(PolicyID {policyID = ScriptHash "3510b5d632d14fec53e51c6d2f9fa355ce20113ae376e296ef4c1d3a"},fromList [("eduladderTestCoin2",1000)])]))))),UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (BadInputsUTxO (fromList [TxInCompact (TxId {_unTxId = SafeHash "08b66cb1d10329b651f8d947f5bdd107effa4fc1d3a5fde94d007f261ea6edce"}) 1]))))])

ANy idea?

The index of the UTxO in the transaction is 0.

But you are giving 1 here.

This might work, but it’s not really necessary to include if you do not want to send any token in that output.

--tx-out $(cat payment.addr)+97630586

would be simpler.

@HeptaSean Its working now

1 Like