Hey there,
Just wanted to confirm the information provided here: https://docs.cardano.org/native-tokens/learn
Is up to date, specifically the min-ada-value is still 1ADA?
Thanks.
Hey there,
Just wanted to confirm the information provided here: https://docs.cardano.org/native-tokens/learn
Is up to date, specifically the min-ada-value is still 1ADA?
Thanks.
Yes, for ADA only transactions (no tokens). Until September when HFC drops.
Note: If using it to calculate it is 1,000,000 since calculations are counted in Lovelace not ADA.
Ok I understand now. So transactions which do have tokens have an increased min-ada-value because the actual transaction size in bytes increases. I found this resource to help me understand as well:
Will HFC increase or decrease the min-ada-value?
There are number of values in this calculation that will change. I believe on the end it will be a bit smaller. However, they are also changing the way transactions work, so there may be a big difference in number of UTxOs that are generated /kept/ burned… so until it drops we are not going to know how it will affect transactions from wallets with may assets.
Hi there, did you end up with one kind of snippet code to calculate the minimum ada value with assets automatically ?
I’m struggling to understand the chart
The chart is not up to date since the Alonzo hardfork.
They totally changed the minimal output calculation to the one found in https://github.com/input-output-hk/cardano-ledger/blob/master/eras/alonzo/impl/src/Cardano/Ledger/Alonzo.hs#L192-L193 and https://github.com/input-output-hk/cardano-ledger/blob/master/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxo.hs#L102-L120.
The minimal ADA are calculated as output size in 64-bit words times coinsPerUTxOWord
, which is currently set to 34482 Lovelace.
The minimal output size for a pure ADA output is 29 words (27 words hardcoded in the function above plus one word each for the empty additional tokens and empty datum?), leading to an absolute minimum transaction output of 29×34482 Lovelace=0.999978 ADA.
Unfortunately, it’s not that straightforward to calculate the additional size needed for additional assets. Assuming that Eternl calculates the minimal ADA correctly, I got the following in some experiments:
Assets | Minimal ADA | Words |
---|---|---|
Pure ADA | 0.999978 | 29 = 27 + 1 + 1 |
2 Byte Name | 1.344798 | 39 = 27 + 11 + 1 |
6 Byte Name | 1.344798 | 39 = 27 + 11 + 1 |
10 Byte Name | 1.379280 | 40 = 27 + 12 + 1 |
2 and 4 Byte Names | 1.517208 | 44 = 27 + 16 + 1 |
2 and 10 Byte Names | 1.551690 | 45 = 27 + 17 + 1 |
4 and 10 Byte Names | 1.551690 | 45 = 27 + 17 + 1 |
2, 4, and 10 Byte Names | 1.758582 | 51 = 27 + 23 + 1 |
But I don’t really know, how to derive these exact word sizes from the length of the asset names. Calculating the length of the CBOR structure that would result gives less words for me. And I am not able to find the code of Val.size
that is used in the calculation.
(This code base is absolutely horrible. I am stupefied how the fanboys can think that IOG are gods of software development. Cardano is good despite them, not because of them.)
The calculation will again totally change with the Vasil hardfork. New code then can be found here: https://github.com/input-output-hk/cardano-ledger/blob/master/eras/babbage/impl/src/Cardano/Ledger/Babbage/Rules/Utxo.hs#L242-L265 (Babbage is the original/internal name of Vasil.)
This seems to go (back) to a byte-exact calculation with a protocol parameter coinsPerUTxOByte
.