0

As per title, want to ask about cardano-cli transaction build for NFT, that I read on this guide or maybe this one

On near the last step, where it says about Minimum required UTxO - I wonder, if we can automatically handle it, so we don't need to change the variable of that minimum UTxO (yes, minimum UTxO, NOT Minimum Fee).

Is that possible? If yes, what command / option needed on that particular case?

Reason is, if we want to build, like a single command (or automation), to mint an NFT, we couldn't, since we don't know for sure if the Minimum required UTxO is enough (which, 1.4 ADA) or not.

Example, what if, suddenly, it's more than 1.4 ADA? We do need to change it manually, then hit it again. Which I think, it's a hassle.

Thanks!

1 Answer 1

2

The minimum Ada value is defined in the protocol parameter here: minUTxOValue

So, you can query the network via cardano-cli to dynamically get the minUTxOValue.

cardano-cli query protocol-parameters --mainnet

From the docs:

https://docs.cardano.org/native-tokens/minimum-ada-value-requirement

Case 1: Token bundle B in the UTXO u contains only ada (no other tokens) minAda (u) = minUTxOValue

Case 2: Token bundle B in the UTXO u contains ada as well as other tokens minAda (u) = max (minUTxOValue, (quot (minUTxOValue, adaOnlyUTxOSize)) * (utxoEntrySizeWithoutVal + (size B)))

Related links here:

Calculation of transaction fees

https://adapools.org/protocol-parameters

6
  • Hi! thanks for the hint! I'm super confuse, as they had 2 (or maybe more) official docs. *back to the topics. I wonder, if there's a more simpler terms for this kind. Since, when I try to look on the parameter. For example, when I do cardano-cli query protocol-parameters --testnet-magic 1097911063 --out-file protocol-parameters.json, and look for a variable named adaOnlyUTxOSize - I couldn't found it. So, I think, I kinda lost in their terms etc.
    – wandyyd
    Commented May 13, 2022 at 7:11
  • *To add, a little, in my case, where I just want to mint test NFT, based on docs is it Case 2 calculation?
    – wandyyd
    Commented May 13, 2022 at 7:11
  • The addOnlyUtxOSize is just a variable in the case above, so you wont find it in the network protocol parameters. Here are 2 examples of where minAda is calculated. I haven't tried these, so only providing them as reference.
    – lley154
    Commented May 13, 2022 at 11:59
  • 1
    github.com/gitmachtl/scripts/blob/… - line 483
    – lley154
    Commented May 13, 2022 at 11:59

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.