0

For minting some tokens I use this transaction:

cardano-cli transaction build
  --testnet-magic 2
  --tx-in-collateral 44ed21bc50eecc24e892a5bad4a98f2187b66d1f5074db22763cbc69fb5910b6#1
  --tx-in 44ed21bc50eecc24e892a5bad4a98f2187b66d1f5074db22763cbc69fb5910b6#1
  --tx-out "addr_test1vqffq45nzrdsprua0nakp8f44xp6mzvrscmpq8alg9w888s63fusl 2000000
                + 1 59f6d5ab2a1849c6080c05aa6fee05df34c4fcb1ba0f22eb4344405b.6a6176656c696e"
  --mint "1 59f6d5ab2a1849c6080c05aa6fee05df34c4fcb1ba0f22eb4344405b.6a6176656c696e"
  --change-address addr_test1vqffq45nzrdsprua0nakp8f44xp6mzvrscmpq8alg9w888s63fusl   
  --protocol-params-file protocol-parameters.json
  --minting-script-file policy.script
  --babbage-era
  --out-file unsigned.json

It submits perfectly and a token gets minted:

Estimated transaction fee: Lovelace 179229
Transaction successfully submitted.

But when I remove the --tx-in-collateral line (thinking you don't really need it for simple tokens), and submitting this similar transaction ...

cardano-cli transaction build
  --testnet-magic 2
  --tx-in 53617a238110219e7d8dded048c6a497dc4ac253fa6e4bb80842bcb82b61bb93#1
  --tx-out "addr_test1vqffq45nzrdsprua0nakp8f44xp6mzvrscmpq8alg9w888s63fusl 2000000 
                + 1 59f6d5ab2a1849c6080c05aa6fee05df34c4fcb1ba0f22eb4344405b.6a6176656c696e"
  --mint "1 59f6d5ab2a1849c6080c05aa6fee05df34c4fcb1ba0f22eb4344405b.6a6176656c696e"
  --change-address addr_test1vqffq45nzrdsprua0nakp8f44xp6mzvrscmpq8alg9w888s63fusl
  --protocol-params-file protocol-parameters.json    
  --minting-script-file policy.script
  --babbage-era
  --out-file unsigned.json

I get this FeeTooSmallUTxO error (on submitting) :

Estimated transaction fee: Lovelace 170913
Command failed: transaction submit  Error: Error while submitting tx: 
   ShelleyTxValidationError ShelleyBasedEraBabbage (ApplyTxError 
     [UtxowFailure (UtxoFailure (FromAlonzoUtxoFail (FeeTooSmallUTxO (Coin 175181) (Coin 170913))))])

I wouldn't expect a FeeTooSmallUTxO error! Can this be a bug in cardano-cli ? Or do I need need to add any other parameters? Or do simple tokens also need collateral?

(for ref: transactions executed on preview network with cardano-cli 1.35.5 - linux-x86_64 - ghc-8.10, the policy.script contains { "keyHash": "6c835e5..bcf986d0c", "type": "sig" } )

4
  • You don't need collateral unless evaluating a plutus script. I cannot reproduce this, perhaps something has changed since. Would you mind trying node and cli 1.35.6?
    – james
    Commented Mar 6, 2023 at 10:47
  • It just occurred to me that you might be providing more than one signing key to witnesses this transaction (e.g. when using sign cmd). If that's the case you must override the number of witnesses during build using --witness-override. This is because the balancing algorithm won't know how many signatures are required and assuming just one would underestimate the fee as a result. Use of the collateral input would increase the calculated fee, which would explain why this error wasn't seen previously.
    – james
    Commented Mar 6, 2023 at 10:52
  • Cardano Node 1.35.5 is still tagged as the latest release on github.com/input-output-hk/cardano-node. Where do I get hold of 1.35.6? (without having to build it myself)
    – wmoco_6725
    Commented Mar 7, 2023 at 15:09
  • @james The --witness-override solved the issue!
    – wmoco_6725
    Commented Mar 7, 2023 at 15:30

1 Answer 1

0

Solution to this problem: add --witness-override to the transaction build.

Here are the transaction build/sign/submit statements:

cardano-cli transaction build
  --testnet-magic 2    
  --tx-in 53617a238110219e7d8dded048c6a497dc4ac253fa6e4bb80842bcb82b61bb93#1
  --tx-out "addr_test1vqffq45nzrdsprua0nakp8f44xp6mzvrscmpq8alg9w888s63fusl 2000000 
        + 1 59f6d5ab2a1849c6080c05aa6fee05df34c4fcb1ba0f22eb4344405b.6a6176656c696e"
  --mint "1 59f6d5ab2a1849c6080c05aa6fee05df34c4fcb1ba0f22eb4344405b.6a6176656c696e"
  --change-address addr_test1vqffq45nzrdsprua0nakp8f44xp6mzvrscmpq8alg9w888s63fusl
  --protocol-params-file protocol-parameters.json
  --minting-script-file policy.script
  --witness-override 2    
  --babbage-era    
  --out-file unsigned.json

cardano-cli transaction sign
  --testnet-magic 2
  --tx-body-file unsigned.json    
  --signing-key-file javelin.skey
  --signing-key-file policy.skey     
  --out-file signed.json


cardano-cli transaction submit
  --testnet-magic 2
  --tx-file signed.json

Estimated transaction fee: Lovelace 175357
Transaction successfully submitted.

When trying the above without the --override-witness, I got this error:

Estimated transaction fee: Lovelace 170913
Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraBabbage 
  (ApplyTxError [UtxowFailure (UtxoFailure 
  (FromAlonzoUtxoFail (FeeTooSmallUTxO (Coin 175181) (Coin 170913))))])

(tested using 1.35.5)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.