0

I have a spending validator that currently expects an output with an NFT to be recreated at its own address. Is it necessary to also include a check whether the output's value has a greater equal ADA balance of minAdaTxOut (minAdaTxOut Reference)

Or is this done by the 2 phase node validation process?

1 Answer 1

1

In theory no; In practice maybe.

If min ada is not present in each output then the Tx will fail regardless of validator.

But. Min ada as implemented in Plutus is hardcoded to 2 ada. This is not how min ada works. Min ada is calculated against the size (of data) of the utxo. More than three NFTs? that'll be more than 2 Ada required in the same utxo.

If your using constraints then you'll need to bear this in mind, since these details may really matter https://github.com/input-output-hk/plutus-apps/blob/c4cc9ee1add8f421e57789befb6a0c90621801f1/plutus-ledger-constraints/src/Ledger/Constraints/OnChain.hs#L123

How to calculate min ada is a bit convoluted. Why isnt a function in plutus-apps for it? No idea. Why wasn't it implemented properly... ?

You can extract the logic from here https://docs.cardano.org/native-tokens/minimum-ada-value-requirement/

Your Answer

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

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