<p>This was just answered <a href="https://cardano.stackexchange.com/questions/9043/cardano-java-lib">here</a>.
The min UTxO output value calculation has changed for the Babbage era. Make sure you're using the latest version of whatever library/ sdk you're using to construct transactions.</p>

CC BY-SA 4.0
2022-09-15T03:46:27.703Z
Yes, you're correct, the Babbage era has changed the calculations. You can no longer submit a tx that pays an NFT to a script, such as an oracle script, without including an amount of Ada with it. This might have already been the rule on the testnet and mainnet, but the Emulator used to let it go. I've upgraded to the V2 libraries, so now the Emulator enforces this rule.
marcel_g
CC BY-SA 4.0
2022-09-14T13:08:28.703Z
2022-09-14T13:08:28.703Z
Will
<p>I unfortunately asked 2 questions in one, and since @william answered one of them he should get the credit for the answer.</p>
<p>To answer the second question for future reference, there is indeed a Plutus function that does get the min amount of Ada so you can add that to your Tx Constraints: <code>maxMinAdaTxOut</code></p>
<pre><code>    let c = Constraints.mustPayToOtherScript (oracleValidatorHash oupOracle) 
                    (V1LedgerScripts.Datum $ PlutusTx.toBuiltinData oupNewFee) 
                       $ ((assetClassValue (oracleAsset oupOracle) 1) &lt;&gt;
                          (Ada.toValue maxMinAdaTxOut))
</code></pre>
<p>I've tested this within the Emulator and it does indeed work.</p>

CC BY-SA 4.0
2022-09-15T08:52:07.423Z
Good point! I forgot to mention that. Great that you've found out yourself.
Will
CC BY-SA 4.0
2022-09-15T09:17:46.747Z
18.5 is a lot of ada to be passing around just to satisfy minUtxo. You'll probably find that most outputs only need a little more than 1 ada when they hold a few tokens and some datum. It would be best to calculate the realistic maximum for your application, see `evaluateMinLovelaceOutput`.
james
CC BY-SA 4.0
2022-09-15T03:50:52.623Z
2022-09-15T03:50:52.623Z
marcel_g
<p>I'm trying to convert a V1 contract to V2, and I have offchain code that mints a token with a OneShotCurrency, and then pays the token plus 1 ada to my script.</p>
<p>It worked with Plutus libraries from Feb. 2022, but I'm trying to upgrade it to match the upcoming Vasil HF, so I'm using plutus-apps v1.0.0-alpha1</p>
<p>In the emulator it is currently giving me this error:</p>
<pre><code>TxnValidationFail Phase1 d6dddf483108cdd66915dac9c81d5c41263de34272366f11517debd1597ba3fc:
    CardanoLedgerValidationError &quot;ApplyTxError [UtxowFailure (UtxoFailure
                                 (BabbageOutputTooSmallUTxO [((Addr Testnet ...
</code></pre>
<p>It appears that the min Ada amount is higher than 1 Ada, because if I change it to 10 Ada, it works.</p>
<p>Does anyone know if there's Plutus code for checking for the minAda required for a tx, without using the cardano-cli?</p>

<plutus><development><vasil-hard-fork>
What's a BabbageOutputTooSmallUTxO error? How to access minAda in Plutus code?
# What's a BabbageOutputTooSmallUTxO error? How to access minAda in Plutus code?

(Asked by: username_0 on 2022-09-14)

I'm trying to convert a V1 contract to V2, and I have offchain code that mints a token with a OneShotCurrency, and then pays the token plus 1 ada to my script.
It worked with Plutus libraries from Feb. 2022, but I'm trying to upgrade it to match the upcoming Vasil HF, so I'm using plutus-apps v1.0.0-alpha1
In the emulator it is currently giving me this error:
TxnValidationFail Phase1 d6dddf483108cdd66915dac9c81d5c41263de34272366f11517debd1597ba3fc:
    CardanoLedgerValidationError "ApplyTxError [UtxowFailure (UtxoFailure
                                 (BabbageOutputTooSmallUTxO [((Addr Testnet ...

It appears that the min Ada amount is higher than 1 Ada, because if I change it to 10 Ada, it works.
Does anyone know if there's Plutus code for checking for the minAda required for a tx, without using the cardano-cli?

**Tags:** plutus, development, vasil-hard-fork

---

## 2 answers

### Answer by username_1 on 2022-09-14. Score: 2 | Accepted answer

This was just answered [here](https://cardano.stackexchange.com/questions/9043/cardano-java-lib).
The min UTxO output value calculation has changed for the Babbage era. Make sure you're using the latest version of whatever library/ sdk you're using to construct transactions.

> **Comments:**
> **username_0**: Yes, you're correct, the Babbage era has changed the calculations. You can no longer submit a tx that pays an NFT to a script, such as an oracle script, without including an amount of Ada with it. This might have already been the rule on the testnet and mainnet, but the Emulator used to let it go. I've upgraded to the V2 libraries, so now the Emulator enforces this rule.  

---

### Answer by username_0 on 2022-09-15. Score: 1

I unfortunately asked 2 questions in one, and since @william answered one of them he should get the credit for the answer.
To answer the second question for future reference, there is indeed a Plutus function that does get the min amount of Ada so you can add that to your Tx Constraints: maxMinAdaTxOut
    let c = Constraints.mustPayToOtherScript (oracleValidatorHash oupOracle) 
                    (V1LedgerScripts.Datum $ PlutusTx.toBuiltinData oupNewFee) 
                       $ ((assetClassValue (oracleAsset oupOracle) 1) <>
                          (Ada.toValue maxMinAdaTxOut))

I've tested this within the Emulator and it does indeed work.

> **Comments:**
> **username_1**: Good point! I forgot to mention that. Great that you've found out yourself.  
> **username_2**: 18.5 is a lot of ada to be passing around just to satisfy minUtxo. You'll probably find that most outputs only need a little more than 1 ada when they hold a few tokens and some datum. It would be best to calculate the realistic maximum for your application, see `evaluateMinLovelaceOutput`.  

---

