Sending Transaction when there are 2 UTXOs in wallet

Dear SPO, Dear Community,
I have followed this guide as closely as possible and finally arrived at chapter 8:

However, when submitting the transaction as described towards the end of chapter 8.11 I receive this error:

Error while submitting tx: ApplyTxError [LedgerFailure (UtxowFailure (UtxoFailure (FeeTooSmallUTxO (Coin 187501) (Coin 184245))))]

Right now I have really no idea, why my calculated fee is not fitting. Therefore I would like to ask if I have to run any commands in some other way than prescribed in the guide when there are two UTXOs in my wallet? Do I have to sum the UTXOs both up in some way?

The only thing which I did before starting chapter 8 and which differs from the documentation, was sending an additional payment to payment.addr. This means, when running command cardano-cli shelley query utxo --address $(cat payment.addr) --mainnet I see two UTXOs.

                   TxHash                                 TxIx        Lovelace
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa....     1       10000000000
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb....     0        1987651134

When starting to calculate the the fee I did (according manual):

cardano-cli shelley transaction build-raw \
--tx-in bbbbbbbb...#0 \
--tx-out $(cat payment.addr)+0 \
--ttl 0 \
--fee 0 \
--out-file tx.draft \
--certificate-file pool-registration.cert \
--certificate-file delegation.cert

My question here: Is it correct to only include one --tx-in although there are two UTXOs in payment.addr? (I also tried it with aaaaaaaaaa....#1 as parameter for --tx-in).

In the next step I did:

cardano-cli shelley transaction calculate-min-fee \
--tx-body-file tx.draft \
--tx-in-count 1 \
--tx-out-count 1 \
--mainnet \
--witness-count 1 \
--byron-witness-count 0 \
--protocol-params-file protocol.json

My main questions here: Is it still okay to use --tx-in-count 1 although there are two UTXOs in my wallet? Do I have to increase some other values? What about witness-count?

Each time I did this command I received a suggested fee of 184245 Lovelace. However, when submitting the signed transaction I could see (when looking at the error message) that this fee was obviously too low. Therefore, before I continue to search the error, I would like to ask if my methods of calculating the fee were correct? Are there any other things which could cause to this error?

Thank you so much for your help!

I believe that’s the one to increase. That transaction generally requires 3 witnesses which is enough to account for your difference in transaction fee:

--signing-key-file payment.skey \
--signing-key-file stake.skey \
--signing-key-file cold.skey \

Thank you so much - problem solved :slight_smile:

1 Like