<p>The minimum Ada value is defined in the protocol parameter here: minUTxOValue</p>
<p>So, you can query the network via cardano-cli to dynamically get the minUTxOValue.</p>
<p>cardano-cli query protocol-parameters --mainnet</p>
<p>From the docs:</p>
<p><a href="https://docs.cardano.org/native-tokens/minimum-ada-value-requirement" rel="nofollow noreferrer">https://docs.cardano.org/native-tokens/minimum-ada-value-requirement</a></p>
<p>Case 1: Token bundle B in the UTXO u contains only ada (no other tokens) minAda (u) = minUTxOValue</p>
<p>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)))</p>
<p>Related links here:</p>
<p><a href="https://cardano.stackexchange.com/questions/4472/calculation-of-transaction-fees">Calculation of transaction fees</a></p>
<p><a href="https://adapools.org/protocol-parameters" rel="nofollow noreferrer">https://adapools.org/protocol-parameters</a></p>

CC BY-SA 4.0
2022-05-13T07:11:25.223Z
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
CC BY-SA 4.0
2022-05-13T07:11:59.810Z
*To add, a little, in my case, where I just want to mint test NFT, based on docs is it `Case 2` calculation?
wandyyd
CC BY-SA 4.0
2022-05-13T11:59:01.710Z
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
CC BY-SA 4.0
2022-05-13T11:59:17.820Z
https://github.com/gitmachtl/scripts/blob/69a584fc2b0b285c6e03fedfb4109daad8085502/cardano/testnet/00_common.sh  - line 483
lley154
CC BY-SA 4.0
2022-05-13T12:00:15.953Z
https://github.com/dendorferpatrick/nami-wallet-examples/blob/master/src/nami-js/coinSelection.js
lley154
CC BY-SA 4.0
2022-05-17T04:02:54.343Z
Hi! Thanks for the reference! [The first one](https://github.com/gitmachtl/scripts/blob/69a584fc2b0b285c6e03fedfb4109daad8085502/cardano/testnet/00_common.sh) seems is the closest one that I'm looking for. It's kinda complicated for new devs like me to get an insight, but I think it's the answer that related to my question (although it's complicated). Thanks again! :)
wandyyd
CC BY-SA 4.0
2022-05-12T13:04:53.123Z
2022-05-12T13:04:53.123Z
lley154
<p>As per title, want to ask about <code>cardano-cli transaction build</code> for NFT, that I read on <a href="https://developers.cardano.org/docs/native-tokens/minting-nfts#crafting-the-transaction" rel="nofollow noreferrer">this guide</a> or <a href="https://devslug.com/how-to-mint-an-nft-on-cardano-testnet-using-the-command-line#build-the-transaction" rel="nofollow noreferrer">maybe this one</a></p>
<p>On near the last step, where it says about <code>Minimum required UTxO</code> - I wonder, if we can automatically handle it, so we don't need to change the <code>variable</code> of that minimum UTxO (yes, minimum UTxO, <strong>NOT</strong> Minimum Fee).</p>
<p>Is that possible? If yes, what command / option needed on that particular case?</p>
<p>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 <code>Minimum required UTxO</code> is enough (which, 1.4 ADA) or not.</p>
<p>Example, what if, suddenly, it's more than <code>1.4 ADA</code>? We do need to change it manually, then hit it again. Which I think, it's a hassle.</p>
<p>Thanks!</p>

<cardano-cli><transaction><nft>
Cardano CLI - Cardano Transaction Build for NFT from Guide Docs
# Cardano CLI - Cardano Transaction Build for NFT from Guide Docs

(Asked by: username_0 on 2022-05-12)

As per title, want to ask about `cardano-cli transaction build` for NFT, that I read on [this guide](https://developers.cardano.org/docs/native-tokens/minting-nfts#crafting-the-transaction) or [maybe this one](https://devslug.com/how-to-mint-an-nft-on-cardano-testnet-using-the-command-line#build-the-transaction)

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!

**Tags:** cardano-cli, transaction, nft

---

## 1 answers

### Answer by username_1 on 2022-05-12. Score: 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://cardano.stackexchange.com/questions/4472/calculation-of-transaction-fees)

<https://adapools.org/protocol-parameters>

> **Comments:**
> **username_0**: 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.  
> **username_0**: *To add, a little, in my case, where I just want to mint test NFT, based on docs is it `Case 2` calculation?  
> **username_1**: 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.  
> **username_1**: https://github.com/gitmachtl/scripts/blob/69a584fc2b0b285c6e03fedfb4109daad8085502/cardano/testnet/00_common.sh  - line 483  
> **username_1**: https://github.com/dendorferpatrick/nami-wallet-examples/blob/master/src/nami-js/coinSelection.js  
> **username_0**: Hi! Thanks for the reference! [The first one](https://github.com/gitmachtl/scripts/blob/69a584fc2b0b285c6e03fedfb4109daad8085502/cardano/testnet/00_common.sh) seems is the closest one that I'm looking for. It's kinda complicated for new devs like me to get an insight, but I think it's the answer that related to my question (although it's complicated). Thanks again! :)  

---

