Skip to content

Commit

Permalink
Merge pull request #437 from ergoplatform/i392
Browse files Browse the repository at this point in the history
Update fee and economy model
  • Loading branch information
kushti authored Sep 24, 2018
2 parents 1ed0fde + 567630d commit 05356c6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 18 deletions.
40 changes: 40 additions & 0 deletions papers/yellow/economy.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
\section{Economic survivability}

We outline following two properties required for long-term survivability of the chain:

\begin{itemize}
\item{} Coins with lost keys should be returned into circulation.
Otherwise, after the end of the initial coins emission period, amount of the coins
in the circulation always decrease and eventually reach zero.
\item{} Nothing should be kept in the state forever and for free.
Otherwise, the size of the state is always increasing, thus reducing clients performance.
\end{itemize}

To achieve this, we propose the following modifications to the consensus rules.
Register $R2$ of the box will contain tuple $(tx\_id, out\_num,
last\_height)$. $last\_height$ field is used to determine the block height
at the moment of transaction generation. Transaction can only be put in the
block of height $h$ if for every created box $R2.last\_height < h$.

Once the subsidized period for the box ends (that is,
$current\_block\_height \ge R2.last\_height + SP$), anyone (presumably a miner) can
create the new box with the exactly the same content (including the guarding
script) except the monetary value and $R2$ content. The monetary value is
reduced by $K \cdot B$, where $B$ is the box size and $K$ is the storage cost of one byte.
Thus, $K \cdot B$ coins are to be paid to the miner.
If box value is less that $K \cdot B$, all box content including tokens goes to miner.
$R2.tx\_id$ and $R2.out\_num$ content of created box should contain correct transaction id
and index, while $R2.last\_height$ should be set to $R2.last\_height$ of spending box
plus $SP$, to ensure that subsidized period starts over.

We propose the following concrete parameters:
\begin{itemize}
\item{} $K$ - cost of storage of 1 byte of data in a State for 1 block.
Should be determined by miner votes, $10^{-6} (Ergo/byte)$ by default.
\item{} $SP$ - number of blocks, box can be stored in a State for free untouched.
Since Ergo have tokens as a first-class citizens, it might be possible that tokens value
sufficiently exceed Ergo value in a box, thus $SP$ should be big enough to protect users
that only keep tokens in their boxes.
However, $SP$ should not exceed emission length to reward miners.
It is predefined $SP = 1051200 = 4$ years.
\end{itemize}
20 changes: 2 additions & 18 deletions papers/yellow/main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,8 @@ \subsection{Regular}

\include{emission}

\include{economy}

\section{Transactions}


Expand Down Expand Up @@ -799,24 +801,6 @@ \subsection{Token Emission}
\section{Voting}
\input{voting.tex}

\section{Transaction Fees}
Register $R2$ of the box contains tuple $(tx\_id, out\_num,
last\_height)$. $last\_height$ field is used to determine the block height
at the start of the subsidized period. Transaction can only be put in the
block of height $h$ if for every created box $R2.last\_height<h$.

Transaction fees must satisfy relation $fee\ge max(K\sum_i B_i, Cd_{comp})$.
Here $K$ is the storage cost of one byte for the subsidized period, $B_i$ is the
size of $i$th created box. $d_{comp}$ is the amount of computations required by
the transaction, and $C$ is the cost of unit computation.

Once the subsidized period for the box ends (that is,
$current\_block\_height\ge R2.last\_height + subsidized\_period$), anyone can
create the new box with the exactly the same content (including the guarding
script) except the monetary value and $last\_height$. The monetary value is
reduced by $KB$ where $B$ is the box size, and $KB$ coins are to be paid to
miner. $last\_height$ is replaced with the $current\_block\_height$, so that the
subsidized period starts over.

\vnote{Script needed}

Expand Down

0 comments on commit 05356c6

Please sign in to comment.