When using cardano-cli version 1.27.0 I want to calculate the min fee for the transaction. The procedure is to create a dummy transaction and using that to calculate the fee.

When creating the dummy transaction using:

cardano-cli transaction build-raw --tx-in 1...x#2 --tx-out addr1...a+0 --tx-out addr1...b+0 --invalid-hereafter 30458092 --fee 0 --out-file tx-1622014393N.dummy

The transaction file then contains the correct era indicator:


However, when I then calculate min fee on this transaction, an error occurs:

cardano-cli transaction calculate-min-fee --tx-body-file /tmp/tx.dummy --protocol-params-file /tmp/protocol.json --tx-in-count 1 --tx-out-count 1 --witness-count 2 --byron-witness-count 0 --mainnet


Command failed: transaction calculate-min-fee Error: /tmp/tx.dummy: TextEnvelope decode error: DecoderErrorDeserialiseFailure "Shelley TxBody" (DeserialiseFailure 1 "expected list of length 3")


Looks like the transaction is created with a different version of cardano-cli.

Can you please confirm the file /tmp/tx.dummy is the same as tx-1622014393N.dummy?

  • 1
    Yes. It turns out I indeed created with 1.26.2. Thanks
    – Rene SECUR
    May 26 at 8:21

From you example, it looks like your --tx-out-count is 2 and not 1, unsure about the witness-count, should be 1 I guess. Could fixing this help?

This site is temporarily in read only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .