diff --git a/tips/TIP-0039/tip-0039.md b/tips/TIP-0039/tip-0039.md index 473d6b514..1fb8792bd 100644 --- a/tips/TIP-0039/tip-0039.md +++ b/tips/TIP-0039/tip-0039.md @@ -185,8 +185,17 @@ point arithmetics (which do not expose the nodes to these rounding divergencies) require exact consensus over values. In particular, all the Mana and rewards calculations have to be done with fixed point arithmetics. -In the [lookup table](#lookup-table) section of this TIP, a lookup table is introduced that will be used in the rest of -this TIP, as a tool to perform calculations that would otherwise be done with floating point operations. +### Lookup Table + +The derivation of the `Mana Parameters::Decay Factors` protocol parameter, also referred to as the _lookup table_ is +described in the present section. This parameter must be calculated exactly once for a network's protocol parameters +to avoid differences in floating point operations on different machines. This Table is provided in the snapshot files; +thus, its definition is explained here just for the sake of clarification. The values on the table **must not** be calculated locally in the node or any application to avoid inconsistencies in the calculations. + +The lookup table is an integer approximation of 2Decay Factors ExponentDecay per +Epochn, for different values of `n` ranging from 1 to `Decay Factors Length`. +To obtain the decayed value of a certain amont of Mana `M` after `n` epochs has been passed, one should multiply +`M` by the entry of `Mana Parameters::Decay Factors` relative to `n` and then execute a right shift of `Decay Factors Exponent` bits. ### Decay Function @@ -435,15 +444,6 @@ A transaction is only valid if either of the following conditions holds: It is highly recommended to use overflow checks for arithmetic operations when calculating Mana balances to avoid over- and underflows. -## Lookup Table - -The derivation of the `Mana Parameters::Decay Factors` protocol parameter, also referred to as the _lookup table_ is -described in the following section. This parameter must be calculated exactly once for a network's protocol parameters -to avoid differences in floating point operations on different machines. - -This lookup table is an integer approximation of 2Decay Factors ExponentDecay per -Epochn, for different values of `n` ranging from 1 to `Decay Factors Length`. - # Test Vectors The protocol parameters used in the following test vectors are the same as in