From 5b9a50537c1160e5ba031b6af471f8edc74c1bc0 Mon Sep 17 00:00:00 2001 From: James Ray <16969914+jamesray1@users.noreply.github.com> Date: Tue, 20 Feb 2018 12:09:17 +1100 Subject: [PATCH] Replace all \s\b([ceg-hmnz])\b with " \mathrm{$1}" using Libre Open Office with match case and regular expressions ticked as options. --- Paper.tex | 143 +++++++++++++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 72 deletions(-) diff --git a/Paper.tex b/Paper.tex index 7eeea75a..7d06a719 100644 --- a/Paper.tex +++ b/Paper.tex @@ -1,4 +1,3 @@ -% \documentclass[9pt,oneside]{amsart} %\usepackage{tweaklist} \usepackage{cancel} @@ -453,7 +452,7 @@ \subsubsection{Serialisation} where \begin{equation} -\mathbb{B}_{\mathrm{n}} = \{ B: B \in \mathbb{B} \wedge \lVert B \rVert = n \} +\mathbb{B}_{\mathrm{n}} = \{ B: B \in \mathbb{B} \wedge \lVert B \rVert = \mathrm{n} \} \end{equation} We now have a rigorous specification for the construction of a formal block structure. The RLP function $\texttt{\small RLP}$ (see Appendix \ref{app:rlp}) provides the canonical method for transforming this structure into a sequence of bytes ready for transmission over the wire or storage locally. @@ -521,9 +520,9 @@ \subsubsection{Block Header Validity} The nonce, \hyperlink{block_nonce_H__n}{$H_{\mathrm{n}}$}, must satisfy the relations: \begin{equation} -n \leqslant \frac{2^{256}}{H_{\mathrm{d}}} \quad \wedge \quad m = H_{\mathrm{m}} +n \leqslant \frac{2^{256}}{H_{\mathrm{d}}} \quad \wedge \quad \mathrm{m} = H_{\mathrm{m}} \end{equation} -with $(n, m) = \mathtt{PoW}(H_{\hcancel{n}}, H_{\mathrm{n}}, \mathbf{d})$. +with $(n, \mathrm{m}) = \mathtt{PoW}(H_{\hcancel{n}}, H_{\mathrm{n}}, \mathbf{d})$. \hypertarget{block_header_without_nonce_and_mixmash_h__cancel_n}{}\linkdest{H_cancel_n}Where $H_{\hcancel{n}}$ is the new block's header $H$, but \textit{without} the nonce and mix-hash components, $\mathbf{d}$ being the current DAG, a large data set needed to compute the mix-hash, and $\mathtt{PoW}$ is the proof-of-work function (see section \ref{ch:pow}): this evaluates to an array with the first item being the mix-hash, to prove that a correct DAG has been used, and the second item being a pseudo-random number cryptographically dependent on $H$ and $\mathbf{d}$. Given an approximately uniform distribution in the range $[0, 2^{64})$, the expected time to find a solution is proportional to the difficulty, $H_{\mathrm{d}}$. @@ -531,7 +530,7 @@ \subsubsection{Block Header Validity} \hypertarget{block_header_validity_function}{}Thus we are able to define the block header validity function $V(H)$: \begin{eqnarray} -V(H) & \equiv & n \leqslant \frac{2^{256}}{H_{\mathrm{d}}} \wedge m = H_{\mathrm{m}} \quad \wedge \\ +V(H) & \equiv & \mathrm{n} \leqslant \frac{2^{256}}{H_{\mathrm{d}}} \wedge \mathrm{m} = H_{\mathrm{m}} \quad \wedge \\ & & H_{\mathrm{d}} = D(H) \quad \wedge \\ & & H_{\mathrm{g}} \le H_{\mathrm{l}} \quad \wedge \\ & & H_{\mathrm{l}} < {P(H)_{H}}_{\mathrm{l}} + \left\lfloor\frac{{P(H)_{H}}_{\mathrm{l}}}{1024}\right\rfloor \quad \wedge \\ @@ -541,7 +540,7 @@ \subsubsection{Block Header Validity} & & H_{\mathrm{i}} = {P(H)_{H}}_{\mathrm{i}} +1 \quad \wedge \\ & & \lVert H_{\mathrm{x}} \rVert \le 32 \end{eqnarray} -where $(n, m) = \mathtt{PoW}(H_{\hcancel{n}}, H_{\mathrm{n}}, \mathbf{d})$ +where $(n, \mathrm{m}) = \mathtt{PoW}(H_{\hcancel{n}}, H_{\mathrm{n}}, \mathbf{d})$ Noting additionally that \textbf{extraData} must be at most 32 bytes. @@ -627,9 +626,9 @@ \subsection{Execution} Evaluating $\boldsymbol{\sigma}_{P}$ from $\boldsymbol{\sigma}_0$ depends on the transaction type; either contract creation or message call; we define the tuple of post-execution provisional state $\boldsymbol{\sigma}_{P}$, remaining gas $g'$, substate $A$ and status code $z$: \begin{equation} -(\boldsymbol{\sigma}_{P}, g', A, z) \equiv \begin{cases} -\Lambda_{4}(\boldsymbol{\sigma}_0, S(T), T_{\mathrm{o}}, &\\ \quad\quad g, T_{\mathrm{p}}, T_{\mathrm{v}}, T_{\mathbf{i}}, 0, \top) & \text{if} \quad T_{\mathrm{t}} = \varnothing \\ -\Theta_{4}(\boldsymbol{\sigma}_0, S(T), T_{\mathrm{o}}, &\\ \quad\quad T_{\mathrm{t}}, T_{\mathrm{t}}, g, T_{\mathrm{p}}, T_{\mathrm{v}}, T_{\mathrm{v}}, T_{\mathbf{d}}, 0, \top) & \text{otherwise} +(\boldsymbol{\sigma}_{P}, \mathrm{g}', A, \mathrm{z}) \equiv \begin{cases} +\Lambda_{4}(\boldsymbol{\sigma}_0, S(T), T_{\mathrm{o}}, &\\ \quad\quad \mathrm{g}, T_{\mathrm{p}}, T_{\mathrm{v}}, T_{\mathbf{i}}, 0, \top) & \text{if} \quad T_{\mathrm{t}} = \varnothing \\ +\Theta_{4}(\boldsymbol{\sigma}_0, S(T), T_{\mathrm{o}}, &\\ \quad\quad T_{\mathrm{t}}, T_{\mathrm{t}}, \mathrm{g}, T_{\mathrm{p}}, T_{\mathrm{v}}, T_{\mathrm{v}}, T_{\mathbf{d}}, 0, \top) & \text{otherwise} \end{cases} \end{equation} @@ -643,16 +642,16 @@ \subsection{Execution} After the message call or contract creation is processed, the state is finalised by determining the amount to be refunded, $g^*$ from the remaining gas, $g'$, plus some allowance from the refund counter, to the sender at the original rate. \begin{equation} -g^* \equiv g' + \min \{ \Big\lfloor \dfrac{T_{\mathrm{g}} - g'}{2} \Big\rfloor, \hyperlink{refund_balance_defn_words_A__r}{A_{\mathrm{r}}} \} +g^* \equiv \mathrm{g}' + \min \{ \Big\lfloor \dfrac{T_{\mathrm{g}} - \mathrm{g}'}{2} \Big\rfloor, \hyperlink{refund_balance_defn_words_A__r}{A_{\mathrm{r}}} \} \end{equation} -The total refundable amount is the legitimately remaining gas $g'$, added to \hyperlink{refund_balance_defn_words_A__r}{$A_{\mathrm{r}}$}, with the latter component being capped up to a maximum of half (rounded down) of the total amount used $T_{\mathrm{g}} - g'$. +The total refundable amount is the legitimately remaining gas $g'$, added to \hyperlink{refund_balance_defn_words_A__r}{$A_{\mathrm{r}}$}, with the latter component being capped up to a maximum of half (rounded down) of the total amount used $T_{\mathrm{g}} - \mathrm{g}'$. The Ether for the gas is given to the miner, whose address is specified as the beneficiary of the present block $B$. So we define the pre-final state $\boldsymbol{\sigma}^*$ in terms of the provisional state $\boldsymbol{\sigma}_{P}$: \begin{eqnarray} \boldsymbol{\sigma}^* & \equiv & \boldsymbol{\sigma}_{P} \quad \text{except} \\ -\boldsymbol{\sigma}^*[S(T)]_{\mathrm{b}} & \equiv & \boldsymbol{\sigma}_{P}[S(T)]_{\mathrm{b}} + g^* T_{\mathrm{p}} \\ -\boldsymbol{\sigma}^*[m]_{\mathrm{b}} & \equiv & \boldsymbol{\sigma}_{P}[m]_{\mathrm{b}} + (T_{\mathrm{g}} - g^*) T_{\mathrm{p}} \\ +\boldsymbol{\sigma}^*[S(T)]_{\mathrm{b}} & \equiv & \boldsymbol{\sigma}_{P}[S(T)]_{\mathrm{b}} + \mathrm{g}^* T_{\mathrm{p}} \\ +\boldsymbol{\sigma}^*[m]_{\mathrm{b}} & \equiv & \boldsymbol{\sigma}_{P}[m]_{\mathrm{b}} + (T_{\mathrm{g}} - \mathrm{g}^*) T_{\mathrm{p}} \\ m & \equiv & {B_{H}}_{\mathrm{c}} \end{eqnarray} @@ -665,9 +664,9 @@ \subsection{Execution} \hypertarget{tx_total_gas_used_Upsilon_pow_g}{}\linkdest{Upsilon_pow_g}\hypertarget{tx_logs_Upsilon_pow_l}{}\linkdest{Upsilon_pow_l}\hypertarget{tx_status_Upsilon_pow_z}{}\linkdest{Upsilon_pow_z}And finally, we specify $\Upsilon^{\mathrm{g}}$, the total gas used in this transaction, $\Upsilon^\mathbf{l}$, the logs created by this transaction and $\Upsilon^{\mathrm{z}}$, the status code of this transaction: \begin{eqnarray} -\Upsilon^{\mathrm{g}}(\boldsymbol{\sigma}, T) & \equiv & T_{\mathrm{g}} - g' \\ +\Upsilon^{\mathrm{g}}(\boldsymbol{\sigma}, T) & \equiv & T_{\mathrm{g}} - \mathrm{g}' \\ \Upsilon^\mathbf{l}(\boldsymbol{\sigma}, T) & \equiv & \hyperlink{tx_log_series_wordy_defn_A__l}{A_{\mathbf{l}}} \\ -\Upsilon^{\mathrm{z}}(\boldsymbol{\sigma}, T) & \equiv & z +\Upsilon^{\mathrm{z}}(\boldsymbol{\sigma}, T) & \equiv & \mathrm{z} \end{eqnarray} These are used to help define the \hyperlink{Transaction_Receipt}{transaction receipt} and are also used \hyperlink{Upsilon_pow_g2}{later} for state and nonce validation. @@ -676,9 +675,9 @@ \section{Contract Creation}\label{ch:create}\hypertarget{endow}{} There are a number of intrinsic parameters used when creating an account: sender ($s$), original transactor ($o$), available gas ($g$), gas price ($p$), endowment ($v$) together with an arbitrary length byte array, $\mathbf{i}$, the initialisation EVM code and finally the present depth of the message-call/contract-creation stack ($e$). -We define the creation function formally as the function $\Lambda$, which evaluates from these values, together with the state $\boldsymbol{\sigma}$ to the tuple containing the new state, remaining gas, accrued transaction substate and an error message $(\boldsymbol{\sigma}', g', A, \mathbf{o})$, as in section \ref{ch:transactions}: +We define the creation function formally as the function $\Lambda$, which evaluates from these values, together with the state $\boldsymbol{\sigma}$ to the tuple containing the new state, remaining gas, accrued transaction substate and an error message $(\boldsymbol{\sigma}', \mathrm{g}', A, \mathbf{o})$, as in section \ref{ch:transactions}: \begin{equation} -(\boldsymbol{\sigma}', g', A, z, \mathbf{o}) \equiv \Lambda(\boldsymbol{\sigma}, s, o, g, p, v, \mathbf{i}, e, w) +(\boldsymbol{\sigma}', \mathrm{g}', A, \mathrm{z}, \mathbf{o}) \equiv \Lambda(\boldsymbol{\sigma}, s, o, \mathrm{g}, p, v, \mathbf{i}, \mathrm{e}, w) \end{equation} The address of the new account is defined as being the rightmost 160 bits of the Keccak hash of the \hyperlink{rlp}{RLP} encoding of the structure containing only the sender and the \hyperlink{account nonce}{account nonce}. Thus we define the resultant address for the new account $a$: @@ -714,7 +713,7 @@ \section{Contract Creation}\label{ch:create}\hypertarget{endow}{} Finally, the account is initialised through the execution of the initialising EVM code $\mathbf{i}$ according to the execution model (see section \ref{ch:model}). Code execution can effect several events that are not internal to the execution state: the account's storage can be altered, further accounts can be created and further message calls can be made. As such, the code execution function $\Xi$ evaluates to a tuple of the resultant state $\boldsymbol{\sigma}^{**}$, available gas remaining $g^{**}$, the accrued substate $A$ and the body code of the account $\mathbf{o}$. \begin{equation} -(\boldsymbol{\sigma}^{**}, g^{**}, A, \mathbf{o}) \equiv \Xi(\boldsymbol{\sigma}^*, g, I, \{s, a\}) \\ +(\boldsymbol{\sigma}^{**}, \mathrm{g}^{**}, A, \mathbf{o}) \equiv \Xi(\boldsymbol{\sigma}^*, \mathrm{g}, I, \{s, a\}) \\ \end{equation} \pagebreak[1]where $I$ contains the parameters of the \hyperlink{exec_env}{execution environment}, that is:\pagebreak[1] \begin{eqnarray} @@ -725,7 +724,7 @@ \section{Contract Creation}\label{ch:create}\hypertarget{endow}{} I_{\mathrm{s}} & \equiv & s \\ \hyperlink{I__v}{I_{\mathrm{v}}} & \equiv & v \\ I_{\mathbf{b}} & \equiv & \mathbf{i} \\ -I_{\mathrm{e}} & \equiv & e \\ +I_{\mathrm{e}} & \equiv & \mathrm{e} \\ I_{\mathrm{w}} & \equiv & w \end{eqnarray} @@ -738,16 +737,16 @@ \section{Contract Creation}\label{ch:create}\hypertarget{endow}{} c \equiv G_{codedeposit} \times |\mathbf{o}| \end{equation} -If there is not enough gas remaining to pay this, \ie $g^{**} < c$, then we also declare an out-of-gas exception. +If there is not enough gas remaining to pay this, \ie $g^{**} < \mathrm{c}$, then we also declare an out-of-gas exception. The gas remaining will be zero in any such exceptional condition, \ie if the creation was conducted as the reception of a transaction, then this doesn't affect payment of the intrinsic cost of contract creation; it is paid regardless. However, the value of the transaction is not transferred to the aborted contract's address when we are out-of-gas. -If such an exception does not occur, then the remaining gas is refunded to the originator and the now-altered state is allowed to persist. Thus formally, we may specify the resultant state, gas, substate and status code as $(\boldsymbol{\sigma}', g', A, z)$ where: +If such an exception does not occur, then the remaining gas is refunded to the originator and the now-altered state is allowed to persist. Thus formally, we may specify the resultant state, gas, substate and status code as $(\boldsymbol{\sigma}', \mathrm{g}', A, \mathrm{z})$ where: \begin{align} -\quad g' &\equiv \begin{cases} +\quad \mathrm{g}' &\equiv \begin{cases} 0 & \text{if} \quad F \\ -g^{**} - c & \text{otherwise} \\ +g^{**} - \mathrm{c} & \text{otherwise} \\ \end{cases} \\ \quad \boldsymbol{\sigma}' &\equiv \begin{cases} \boldsymbol{\sigma} & \text{if} \quad F \\ @@ -756,12 +755,12 @@ \section{Contract Creation}\label{ch:create}\hypertarget{endow}{} \boldsymbol{\sigma}^{**} \quad \text{except:} & \\ \quad\boldsymbol{\sigma}'[a]_{\mathrm{c}} = \texttt{\small KEC}(\mathbf{o}) & \text{otherwise} \end{cases} \\ -\quad z &\equiv \begin{cases} -0 & \text{if} \quad \boldsymbol{\sigma}^{**} = \varnothing \lor g^{**} < c \\ +\quad \mathrm{z} &\equiv \begin{cases} +0 & \text{if} \quad \boldsymbol{\sigma}^{**} = \varnothing \lor \mathrm{g}^{**} < \mathrm{c} \\ 1 & \text{otherwise} \end{cases} \\ \nonumber \text{where} \\ -F &\equiv \big((\boldsymbol{\sigma}^{**} = \varnothing \ \wedge\ \mathbf{o} = \varnothing) \vee\ g^{**} < c \ \vee\ |\mathbf{o}| > 24576\big) +F &\equiv \big((\boldsymbol{\sigma}^{**} = \varnothing \ \wedge\ \mathbf{o} = \varnothing) \vee\ \mathrm{g}^{**} < \mathrm{c} \ \vee\ |\mathbf{o}| > 24576\big) \end{align} The exception in the determination of $\boldsymbol{\sigma}'$ dictates that $\mathbf{o}$, the resultant byte sequence from the execution of the initialisation code, specifies the final body code for the newly-created account. @@ -776,7 +775,7 @@ \section{Message Call} \label{ch:call} Aside from evaluating to a new state and transaction substate, message calls also have an extra component---the output data denoted by the byte array $\mathbf{o}$. This is ignored when executing transactions, however message calls can be initiated due to VM-code execution and in this case this information is used. \begin{equation} -(\boldsymbol{\sigma}', g', A, z, \mathbf{o}) \equiv \Theta(\boldsymbol{\sigma}, s, o, r, c, g, p, v, \tilde{v}, \mathbf{d}, e, w) +(\boldsymbol{\sigma}', \mathrm{g}', A, \mathrm{z}, \mathbf{o}) \equiv \Theta(\boldsymbol{\sigma}, s, o, r, \mathrm{c}, \mathrm{g}, p, v, \tilde{v}, \mathbf{d}, \mathrm{e}, w) \end{equation} Note that we need to differentiate between the value that is to be transferred, $v$, from the value apparent in the execution context, $\tilde{v}$, for the {\small DELEGATECALL} instruction. @@ -828,23 +827,23 @@ \section{Message Call} \label{ch:call} 0 & \text{if} \quad \boldsymbol{\sigma}^{**} = \varnothing \\ 1 & \text{otherwise} \end{cases} \\ -\qquad (\boldsymbol{\sigma}^{**}, g^{**}, A, \mathbf{o}) & \equiv & \begin{cases} -\Xi_{\mathtt{ECREC}}(\boldsymbol{\sigma}_1, g, I, \mathbf{t}) & \text{if} \quad r = 1 \\ -\Xi_{\mathtt{SHA256}}(\boldsymbol{\sigma}_1, g, I, \mathbf{t}) & \text{if} \quad r = 2 \\ -\Xi_{\mathtt{RIP160}}(\boldsymbol{\sigma}_1, g, I, \mathbf{t}) & \text{if} \quad r = 3 \\ -\Xi_{\mathtt{ID}}(\boldsymbol{\sigma}_1, g, I, \mathbf{t}) & \text{if} \quad r = 4 \\ -\Xi_{\mathtt{EXPMOD}}(\boldsymbol{\sigma}_1, g, I, \mathbf{t}) & \text{if} \quad r = 5 \\ -\Xi_{\mathtt{BN\_ADD}}(\boldsymbol{\sigma}_1, g, I, \mathbf{t}) & \text{if} \quad r = 6 \\ -\Xi_{\mathtt{BN\_MUL}}(\boldsymbol{\sigma}_1, g, I, \mathbf{t}) & \text{if} \quad r = 7 \\ -\Xi_{\mathtt{SNARKV}}(\boldsymbol{\sigma}_1, g, I, \mathbf{t}) & \text{if} \quad r = 8 \\ -\Xi(\boldsymbol{\sigma}_1, g, I, \mathbf{t}) & \text{otherwise} \end{cases} \\ +\qquad (\boldsymbol{\sigma}^{**}, \mathrm{g}^{**}, A, \mathbf{o}) & \equiv & \begin{cases} +\Xi_{\mathtt{ECREC}}(\boldsymbol{\sigma}_1, \mathrm{g}, I, \mathbf{t}) & \text{if} \quad r = 1 \\ +\Xi_{\mathtt{SHA256}}(\boldsymbol{\sigma}_1, \mathrm{g}, I, \mathbf{t}) & \text{if} \quad r = 2 \\ +\Xi_{\mathtt{RIP160}}(\boldsymbol{\sigma}_1, \mathrm{g}, I, \mathbf{t}) & \text{if} \quad r = 3 \\ +\Xi_{\mathtt{ID}}(\boldsymbol{\sigma}_1, \mathrm{g}, I, \mathbf{t}) & \text{if} \quad r = 4 \\ +\Xi_{\mathtt{EXPMOD}}(\boldsymbol{\sigma}_1, \mathrm{g}, I, \mathbf{t}) & \text{if} \quad r = 5 \\ +\Xi_{\mathtt{BN\_ADD}}(\boldsymbol{\sigma}_1, \mathrm{g}, I, \mathbf{t}) & \text{if} \quad r = 6 \\ +\Xi_{\mathtt{BN\_MUL}}(\boldsymbol{\sigma}_1, \mathrm{g}, I, \mathbf{t}) & \text{if} \quad r = 7 \\ +\Xi_{\mathtt{SNARKV}}(\boldsymbol{\sigma}_1, \mathrm{g}, I, \mathbf{t}) & \text{if} \quad r = 8 \\ +\Xi(\boldsymbol{\sigma}_1, \mathrm{g}, I, \mathbf{t}) & \text{otherwise} \end{cases} \\ I_{\mathrm{a}} & \equiv & r \\ I_{\mathrm{o}} & \equiv & o \\ I_{\mathrm{p}} & \equiv & p \\ I_{\mathbf{d}} & \equiv & \mathbf{d} \\ I_{\mathrm{s}} & \equiv & s \\ I_{\mathrm{v}} & \equiv & \tilde{v} \\ -I_{\mathrm{e}} & \equiv & e \\ +I_{\mathrm{e}} & \equiv & \mathrm{e} \\ I_{\mathrm{w}} & \equiv & w \\ \mathbf{t} & \equiv & \{s, r\} \\ \\ \nonumber @@ -898,7 +897,7 @@ \subsection{Execution Environment}\linkdest{exec_env} The execution model defines the function $\Xi$, which can compute the resultant state $\boldsymbol{\sigma}'$, the remaining gas $g'$, the accrued substate $A$ and the resultant output, $\mathbf{o}$, given these definitions. For the present context, we will define it as: \begin{equation} -(\boldsymbol{\sigma}', g', A, \mathbf{o}) \equiv \Xi(\boldsymbol{\sigma}, g, I) +(\boldsymbol{\sigma}', \mathrm{g}', A, \mathbf{o}) \equiv \Xi(\boldsymbol{\sigma}, \mathrm{g}, I) \end{equation} where we will remember that $A$, the accrued substate is defined as the tuple of the suicides set $\mathbf{s}$, the log series $\mathbf{l}$, the touched accounts $\mathbf{t}$ and the refunds $r$: @@ -913,9 +912,9 @@ \subsection{Execution Overview} \hypertarget{empty_sequence_vs_empty_set}{}The empty sequence, denoted $()$, is not equal to the empty set, denoted $\varnothing$; this is important when interpreting the output of $H$, which evaluates to $\varnothing$ when execution is to continue but a series (potentially empty) when execution should halt. \begin{eqnarray} -\Xi(\boldsymbol{\sigma}, g, I, T) & \equiv & (\boldsymbol{\sigma}'\!, \boldsymbol{\mu}'_{\mathrm{g}}, A, \mathbf{o}) \\ +\Xi(\boldsymbol{\sigma}, \mathrm{g}, I, T) & \equiv & (\boldsymbol{\sigma}'\!, \boldsymbol{\mu}'_{\mathrm{g}}, A, \mathbf{o}) \\ (\boldsymbol{\sigma}', \boldsymbol{\mu}'\!, A, ..., \mathbf{o}) & \equiv & X\big((\boldsymbol{\sigma}, \boldsymbol{\mu}, A^0\!, I)\big) \\ -\boldsymbol{\mu}_{\mathrm{g}} & \equiv & g \\ +\boldsymbol{\mu}_{\mathrm{g}} & \equiv & \mathrm{g} \\ \boldsymbol{\mu}_{pc} & \equiv & 0 \\ \boldsymbol{\mu}_{\mathbf{m}} & \equiv & (0, 0, ...) \\ \boldsymbol{\mu}_{\mathrm{i}} & \equiv & 0 \\ @@ -934,7 +933,7 @@ \subsection{Execution Overview} where \begin{eqnarray} \mathbf{o} & \equiv & H(\boldsymbol{\mu}, I) \\ -(a, b, c, d) \cdot e & \equiv & (a, b, c, d, e) \\ +(a, b, \mathrm{c}, d) \cdot \mathrm{e} & \equiv & (a, b, \mathrm{c}, d, \mathrm{e}) \\ \boldsymbol{\mu}' & \equiv & \boldsymbol{\mu}\ \text{except:} \\ \boldsymbol{\mu}'_{\mathrm{g}} & \equiv & \boldsymbol{\mu}_{\mathrm{g}} - C(\boldsymbol{\sigma}, \boldsymbol{\mu}, I) \end{eqnarray} @@ -1087,9 +1086,9 @@ \subsection{Ommer Validation} where $k$ denotes the ``is-kin'' property: \begin{equation} -k(U, H, n) \equiv \begin{cases} false & \text{if} \quad n = 0 \\ +k(U, H, \mathrm{n}) \equiv \begin{cases} false & \text{if} \quad \mathrm{n} = 0 \\ s(U, H) &\\ -\quad \vee \; k(U, P(H)_{H}, n - 1) & \text{otherwise} +\quad \vee \; k(U, P(H)_{H}, \mathrm{n} - 1) & \text{otherwise} \end{cases} \end{equation} @@ -1146,8 +1145,8 @@ \subsection{State \& Nonce Validation}\label{sec:statenoncevalidation} \hypertarget{Phi}{}And finally we define $\Phi$, the block transition function, which maps an incomplete block $B$ to a complete block $B'$: \begin{eqnarray} \Phi(B) & \equiv & B': \quad B' = B^* \quad \text{except:} \\ -B'_{\mathrm{n}} & = & n: \quad x \leqslant \frac{2^{256}}{\hyperlink{H__d}{H_{\mathrm{d}}}} \\ -B'_{\mathrm{m}} & = & m \quad \text{with } (x, m) = \mathtt{PoW}(B^*_{\hyperlink{H_cancel_n}{\hcancel{n}}}, n, \mathbf{d}) \\ +B'_{\mathrm{n}} & = & \mathrm{n}: \quad x \leqslant \frac{2^{256}}{\hyperlink{H__d}{H_{\mathrm{d}}}} \\ +B'_{\mathrm{m}} & = & \mathrm{m} \quad \text{with } (x, \mathrm{m}) = \mathtt{PoW}(B^*_{\hyperlink{H_cancel_n}{\hcancel{n}}}, \mathrm{n}, \mathbf{d}) \\ B^* & \equiv & B \quad \text{except:} \quad {\hyperlink{Transaction Receipt}{B^*_{\mathrm{r}}}} = \hyperlink{r}{r}(\hyperlink{Pi}{\Pi}(\Gamma(B), B)) \end{eqnarray} @@ -1157,12 +1156,12 @@ \subsection{State \& Nonce Validation}\label{sec:statenoncevalidation} \hyperlink{Transaction_Receipt}{As previously detailed}, $\mathbf{R}[n]_{\mathrm{z}}$, $\mathbf{R}[n]_{\mathbf{l}}$ and $\mathbf{R}[n]_{\mathrm{u}}$ are the $n$th corresponding status code, logs and cumulative gas used after each transaction ($\mathbf{R}[n]_{\mathrm{b}}$, the fourth component in the tuple, has already been defined in terms of the logs). We also define the $n$th state $\boldsymbol{\sigma}[n]$, which is defined simply as the state resulting from applying the corresponding transaction to the state resulting from the previous transaction (or the block's initial state in the case of the first such transaction): \begin{equation} -\boldsymbol{\sigma}[n] = \begin{cases} \hyperlink{Gamma}{\Gamma}(B) & \text{if} \quad n < 0 \\ \hyperlink{Upsilon}{\Upsilon}(\boldsymbol{\sigma}[n - 1], B_{\mathbf{T}}[n]) & \text{otherwise} \end{cases} +\boldsymbol{\sigma}[n] = \begin{cases} \hyperlink{Gamma}{\Gamma}(B) & \text{if} \quad \mathrm{n} < 0 \\ \hyperlink{Upsilon}{\Upsilon}(\boldsymbol{\sigma}[n - 1], B_{\mathbf{T}}[n]) & \text{otherwise} \end{cases} \end{equation} In the case of \hyperlink{Transaction_Receipt}{$B_{\mathbf{R}}[n]_{\mathrm{u}}$}, we take a similar approach defining each item as the gas used in evaluating the corresponding transaction summed with the previous item (or zero, if it is the first), giving us a running total: \begin{equation} -\mathbf{R}[n]_{\mathrm{u}} = \begin{cases} 0 & \text{if} \quad n < 0 \\ +\mathbf{R}[n]_{\mathrm{u}} = \begin{cases} 0 & \text{if} \quad \mathrm{n} < 0 \\ \begin{array}[b]{l} \linkdest{Upsilon_pow_g2}\hyperlink{Upsilon_pow_g}{\Upsilon^{\mathrm{g}}}(\boldsymbol{\sigma}[n - 1], B_{\mathbf{T}}[n])\\ \quad + \mathbf{R}[n-1]_{\mathrm{u}} \end{array} @@ -1202,7 +1201,7 @@ \subsection{Mining Proof-of-Work} \label{ch:pow} More formally, the proof-of-work function takes the form of $\mathtt{PoW}$: \begin{equation} -m = H_{\mathrm{m}} \quad \wedge \quad n \leqslant \frac{2^{256}}{H_{\mathrm{d}}} \quad \text{with} \quad (m, n) = \mathtt{PoW}(H_{\hcancel{n}}, H_{\mathrm{n}}, \mathbf{d}) +m = H_{\mathrm{m}} \quad \wedge \quad \mathrm{n} \leqslant \frac{2^{256}}{H_{\mathrm{d}}} \quad \text{with} \quad (m, \mathrm{n}) = \mathtt{PoW}(H_{\hcancel{n}}, H_{\mathrm{n}}, \mathbf{d}) \end{equation} Where $H_{\hcancel{n}}$ is the new block's header but \textit{without} the nonce and mix-hash components; $H_{\mathrm{n}}$ is the nonce of the header; $\mathbf{d}$ is a large data set needed to compute the mixHash and $H_{\mathrm{d}}$ is the new block's difficulty value (i.e. the block difficulty from section \ref{ch:ghost}). $\mathtt{PoW}$ is the proof-of-work function which evaluates to an array with the first item being the mixHash and the second item being a pseudo-random number cryptographically dependent on $H$ and $\mathbf{d}$. The underlying algorithm is called Ethash and is described below. @@ -1333,8 +1332,8 @@ \section{Recursive Length Prefix}\label{app:rlp}\hypertarget{rlp}{} (128 + \lVert \mathbf{x} \rVert) \cdot \mathbf{x} & \text{else if} \quad \lVert \mathbf{x} \rVert < 56 \\ \big(183 + \big\lVert \mathtt{\tiny BE}(\lVert \mathbf{x} \rVert) \big\rVert \big) \cdot \mathtt{\tiny BE}(\lVert \mathbf{x} \rVert) \cdot \mathbf{x} & \text{otherwise} \end{cases} \\ -\mathtt{\tiny BE}(x) & \equiv & (b_0, b_1, ...): b_0 \neq 0 \wedge x = \sum_{n = 0}^{n < \lVert \mathbf{b} \rVert} b_{\mathrm{n}} \cdot 256^{\lVert \mathbf{b} \rVert - 1 - n} \\ -(a) \cdot (b, c) \cdot (d, e) & = & (a, b, c, d, e) +\mathtt{\tiny BE}(x) & \equiv & (b_0, b_1, ...): b_0 \neq 0 \wedge x = \sum_{n = 0}^{n < \lVert \mathbf{b} \rVert} b_{\mathrm{n}} \cdot 256^{\lVert \mathbf{b} \rVert - 1 - \mathrm{n}} \\ +(a) \cdot (b, \mathrm{c}) \cdot (d, \mathrm{e}) & = & (a, b, \mathrm{c}, d, \mathrm{e}) \end{eqnarray} Thus $\mathtt{\tiny BE}$ is the function that expands a positive integer value to a big-endian byte array of minimal length and the dot operator performs sequence concatenation. @@ -1413,7 +1412,7 @@ \section{Modified Merkle Patricia Tree}\label{app:trie}\hypertarget{trie}{} \begin{equation} n(\mathfrak{I}, i) \equiv \begin{cases} () & \text{if} \quad \mathfrak{I} = \varnothing \\ -c(\mathfrak{I}, i) & \text{if} \quad \lVert c(\mathfrak{I}, i)\rVert < 32 \\ +c(\mathfrak{I}, i) & \text{if} \quad \lVert \mathrm{c}(\mathfrak{I}, i)\rVert < 32 \\ \texttt{\small KEC}(c(\mathfrak{I}, i)) & \text{otherwise} \end{cases} \end{equation} @@ -1429,9 +1428,9 @@ \section{Modified Merkle Patricia Tree}\label{app:trie}\hypertarget{trie}{} \begin{equation} c(\mathfrak{I}, i) \equiv \begin{cases} \texttt{\small RLP}\Big( \big(\texttt{\small HP}(I_0[i .. (\lVert I_0\rVert - 1)], true), I_1 \big) \Big) & \text{if} \quad \lVert \mathfrak{I} \rVert = 1 \quad \text{where} \; \exists I: I \in \mathfrak{I} \\ -\texttt{\small RLP}\Big( \big(\texttt{\small HP}(I_0[i .. (j - 1)], false), n(\mathfrak{I}, j) \big) \Big) & \text{if} \quad i \ne j \quad \text{where} \; j = \arg \max_{x} : \exists \mathbf{l}: \lVert \mathbf{l} \rVert = x : \forall_{I \in \mathfrak{I}}: I_0[0 .. (x - 1)] = \mathbf{l} \\ +\texttt{\small RLP}\Big( \big(\texttt{\small HP}(I_0[i .. (j - 1)], false), \mathrm{n}(\mathfrak{I}, j) \big) \Big) & \text{if} \quad i \ne j \quad \text{where} \; j = \arg \max_{x} : \exists \mathbf{l}: \lVert \mathbf{l} \rVert = x : \forall_{I \in \mathfrak{I}}: I_0[0 .. (x - 1)] = \mathbf{l} \\ \texttt{\small RLP}\Big( (u(0), u(1), ..., u(15), v) \Big) & \text{otherwise} \quad \text{where} \begin{array}[t]{rcl} -u(j) & \equiv & n(\{ I : I \in \mathfrak{I} \wedge I_0[i] = j \}, i + 1) \\ +u(j) & \equiv & \mathrm{n}(\{ I : I \in \mathfrak{I} \wedge I_0[i] = j \}, i + 1) \\ v & = & \begin{cases} I_1 & \text{if} \quad \exists I: I \in \mathfrak{I} \wedge \lVert I_0 \rVert = i \\ () & \text{otherwise} @@ -1449,9 +1448,9 @@ \section{Precompiled Contracts}\label{app:precompiled} For each precompiled contract, we make use of a template function, $\Xi_{\mathtt{PRE}}$, which implements the out-of-gas checking. \begin{equation} \label{eq:pre} -\Xi_{\mathtt{PRE}}(\boldsymbol{\sigma}, g, I, T) \equiv \begin{cases} -(\varnothing, 0, A^0, ()) & \text{if} \quad g < g_{\mathrm{r}} \\ -(\boldsymbol\sigma, g - g_{\mathrm{r}}, A^0, \mathbf{o}) & \text{otherwise}\end{cases} +\Xi_{\mathtt{PRE}}(\boldsymbol{\sigma}, \mathrm{g}, I, T) \equiv \begin{cases} +(\varnothing, 0, A^0, ()) & \text{if} \quad \mathrm{g} < g_{\mathrm{r}} \\ +(\boldsymbol\sigma, \mathrm{g} - g_{\mathrm{r}}, A^0, \mathbf{o}) & \text{otherwise}\end{cases} \end{equation} The precompiled contracts each use these definitions and provide specifications for the $\mathbf{o}$ (the output data) and $g_{\mathrm{r}}$, the gas requirements. @@ -1861,7 +1860,7 @@ \subsection{Gas Cost} Another useful function is ``all but one 64th'' function~$L$ defined as: \begin{equation} -L(n) \equiv n - \lfloor n / 64 \rfloor +L(n) \equiv \mathrm{n} - \lfloor \mathrm{n} / 64 \rfloor \end{equation} \subsection{Instruction Set} @@ -2053,7 +2052,7 @@ \subsection{Instruction Set} &&&& where $P$ is the hash of a block of a particular number, up to a maximum age.\\ &&&& 0 is left on the stack if the looked for block number is greater than the current block number \\ &&&& or more than 256 blocks behind the current block. \\ -&&&& $P(h, n, a) \equiv \begin{cases} 0 & \text{if} \quad n > H_{\mathrm{i}} \vee a = 256 \vee h = 0 \\ h & \text{if} \quad n = H_{\mathrm{i}} \\ P(H_{\mathrm{p}}, n, a + 1) & \text{otherwise} \end{cases}$ \\ +&&&& $P(h, \mathrm{n}, a) \equiv \begin{cases} 0 & \text{if} \quad \mathrm{n} > H_{\mathrm{i}} \vee a = 256 \vee \mathrm{h} = 0 \\ \mathrm{h} & \text{if} \quad \mathrm{n} = H_{\mathrm{i}} \\ P(H_{\mathrm{p}}, \mathrm{n}, a + 1) & \text{otherwise} \end{cases}$ \\ &&&& and we assert the header $H$ can be determined as its hash is the parent hash \\ &&&& in the block following it. \\ \midrule @@ -2138,15 +2137,15 @@ \subsection{Instruction Set} \multicolumn{5}{c}{\textbf{60s \& 70s: Push Operations}} \vspace{5pt} \\ \textbf{Value} & \textbf{Mnemonic} & $\delta$ & $\alpha$ & \textbf{Description} \vspace{5pt} \\ 0x60 & {\small PUSH1} & 0 & 1 & Place 1 byte item on stack. \\ -&&&& $\boldsymbol{\mu}'_{\mathbf{s}}[0] \equiv c(\boldsymbol{\mu}_{pc} + 1)$ \\ -&&&& $\text{where} \quad c(x) \equiv \begin{cases} I_{\mathbf{b}}[x] & \text{if} \quad x < \lVert I_{\mathbf{b}} \rVert \\ 0 & \text{otherwise} \end{cases}$ \\ +&&&& $\boldsymbol{\mu}'_{\mathbf{s}}[0] \equiv \mathrm{c}(\boldsymbol{\mu}_{pc} + 1)$ \\ +&&&& $\text{where} \quad \mathrm{c}(x) \equiv \begin{cases} I_{\mathbf{b}}[x] & \text{if} \quad x < \lVert I_{\mathbf{b}} \rVert \\ 0 & \text{otherwise} \end{cases}$ \\ &&&& The bytes are read in line from the program code's bytes array. \\ &&&& The function $c$ ensures the bytes default to zero if they extend past the limits.\\ &&&& The byte is right-aligned (takes the lowest significant place in big endian). \\ \midrule 0x61 & {\small PUSH2} & 0 & 1 & Place 2-byte item on stack. \\ &&&& $\boldsymbol{\mu}'_{\mathbf{s}}[0] \equiv \boldsymbol{c}\big( (\boldsymbol{\mu}_{pc} + 1) \dots (\boldsymbol{\mu}_{pc} + 2) \big)$ \\ -&&&& with $\boldsymbol{c}(\boldsymbol{x}) \equiv (c(\boldsymbol{x}_0), ..., c(\boldsymbol{x}_{\lVert x \rVert -1})) $ with $c$ as defined as above. \\ +&&&& with $\boldsymbol{c}(\boldsymbol{x}) \equiv (c(\boldsymbol{x}_0), ..., \mathrm{c}(\boldsymbol{x}_{\lVert x \rVert -1})) $ with $c$ as defined as above. \\ &&&& The bytes are right-aligned (takes the lowest significant place in big endian). \\ \midrule \multicolumn{1}{c}{\vdots} & \multicolumn{1}{c}{\vdots} & \vdots & \vdots & \multicolumn{1}{c}{\vdots} \\ @@ -2239,11 +2238,11 @@ \subsection{Instruction Set} \midrule 0xf1 & {\small CALL} & 7 & 1 & Message-call into an account. \\ &&&& $\mathbf{i} \equiv \boldsymbol{\mu}_{\mathbf{m}}[ \boldsymbol{\mu}_{\mathbf{s}}[3] \dots (\boldsymbol{\mu}_{\mathbf{s}}[3] + \boldsymbol{\mu}_{\mathbf{s}}[4] - 1) ]$ \\ -&&&& $(\boldsymbol{\sigma}', g', A^+, \mathbf{o}) \equiv \begin{cases}\begin{array}{l}\Theta(\boldsymbol{\sigma}, I_{\mathrm{a}}, I_{\mathrm{o}}, t, t,\\ \quad C_{\text{\tiny CALLGAS}}(\boldsymbol{\mu}), I_{\mathrm{p}}, \boldsymbol{\mu}_{\mathbf{s}}[2], \boldsymbol{\mu}_{\mathbf{s}}[2], \mathbf{i}, I_{\mathrm{e}} + 1, I_{\mathrm{w}})\end{array} & \begin{array}{l}\text{if} \quad \boldsymbol{\mu}_{\mathbf{s}}[2] \leqslant \boldsymbol{\sigma}[I_{\mathrm{a}}]_{\mathrm{b}} \;\wedge \\ \quad\quad I_{\mathrm{e}} < 1024\end{array}\\ (\boldsymbol{\sigma}, g, \varnothing, ()) & \text{otherwise} \end{cases}$ \\ +&&&& $(\boldsymbol{\sigma}', \mathrm{g}', A^+, \mathbf{o}) \equiv \begin{cases}\begin{array}{l}\Theta(\boldsymbol{\sigma}, I_{\mathrm{a}}, I_{\mathrm{o}}, t, t,\\ \quad C_{\text{\tiny CALLGAS}}(\boldsymbol{\mu}), I_{\mathrm{p}}, \boldsymbol{\mu}_{\mathbf{s}}[2], \boldsymbol{\mu}_{\mathbf{s}}[2], \mathbf{i}, I_{\mathrm{e}} + 1, I_{\mathrm{w}})\end{array} & \begin{array}{l}\text{if} \quad \boldsymbol{\mu}_{\mathbf{s}}[2] \leqslant \boldsymbol{\sigma}[I_{\mathrm{a}}]_{\mathrm{b}} \;\wedge \\ \quad\quad I_{\mathrm{e}} < 1024\end{array}\\ (\boldsymbol{\sigma}, \mathrm{g}, \varnothing, ()) & \text{otherwise} \end{cases}$ \\ &&&& $n \equiv \min(\{ \boldsymbol{\mu}_{\mathbf{s}}[6], |\mathbf{o}|\})$ \\ -&&&& $\boldsymbol{\mu}'_{\mathbf{m}}[ \boldsymbol{\mu}_{\mathbf{s}}[5] \dots (\boldsymbol{\mu}_{\mathbf{s}}[5] + n - 1) ] = \mathbf{o}[0 \dots (n - 1)]$ \\ +&&&& $\boldsymbol{\mu}'_{\mathbf{m}}[ \boldsymbol{\mu}_{\mathbf{s}}[5] \dots (\boldsymbol{\mu}_{\mathbf{s}}[5] + \mathrm{n} - 1) ] = \mathbf{o}[0 \dots (n - 1)]$ \\ &&&& $\boldsymbol{\mu}'_{\mathbf{o}} = \mathbf{o}$ \\ -&&&& $\boldsymbol{\mu}'_{\mathrm{g}} \equiv \boldsymbol{\mu}_{\mathrm{g}} + g'$ \\ +&&&& $\boldsymbol{\mu}'_{\mathrm{g}} \equiv \boldsymbol{\mu}_{\mathrm{g}} + \mathrm{g}'$ \\ &&&& $\boldsymbol{\mu}'_{\mathbf{s}}[0] \equiv x$ \\ &&&& $A' \equiv A \Cup A^+$ \\ &&&& $t \equiv \boldsymbol{\mu}_{\mathbf{s}}[1] \mod 2^{160}$ \\ @@ -2274,7 +2273,7 @@ \subsection{Instruction Set} \midrule 0xf2 & {\small CALLCODE} & 7 & 1 & Message-call into this account with an alternative account's code. \\ &&&& Exactly equivalent to {\small CALL} except: \\ -&&&& $(\boldsymbol{\sigma}', g', A^+, \mathbf{o}) \equiv \begin{cases}\begin{array}{l}\Theta(\boldsymbol{\sigma}^*, I_{\mathrm{a}}, I_{\mathrm{o}}, I_{\mathrm{a}}, t,\\\quad C_{\text{\tiny CALLGAS}}(\boldsymbol{\mu}), I_{\mathrm{p}}, \boldsymbol{\mu}_{\mathbf{s}}[2], \boldsymbol{\mu}_{\mathbf{s}}[2], \mathbf{i}, I_{\mathrm{e}} + 1, I_{\mathrm{w}})\end{array} & \begin{array}{l}\text{if} \quad \boldsymbol{\mu}_{\mathbf{s}}[2] \leqslant \boldsymbol{\sigma}[I_{\mathrm{a}}]_{\mathrm{b}} \;\wedge\\ \quad\quad{}I_{\mathrm{e}} < 1024\end{array} \\ (\boldsymbol{\sigma}, g, \varnothing, ()) & \text{otherwise} \end{cases}$ \\ +&&&& $(\boldsymbol{\sigma}', \mathrm{g}', A^+, \mathbf{o}) \equiv \begin{cases}\begin{array}{l}\Theta(\boldsymbol{\sigma}^*, I_{\mathrm{a}}, I_{\mathrm{o}}, I_{\mathrm{a}}, t,\\\quad C_{\text{\tiny CALLGAS}}(\boldsymbol{\mu}), I_{\mathrm{p}}, \boldsymbol{\mu}_{\mathbf{s}}[2], \boldsymbol{\mu}_{\mathbf{s}}[2], \mathbf{i}, I_{\mathrm{e}} + 1, I_{\mathrm{w}})\end{array} & \begin{array}{l}\text{if} \quad \boldsymbol{\mu}_{\mathbf{s}}[2] \leqslant \boldsymbol{\sigma}[I_{\mathrm{a}}]_{\mathrm{b}} \;\wedge\\ \quad\quad{}I_{\mathrm{e}} < 1024\end{array} \\ (\boldsymbol{\sigma}, \mathrm{g}, \varnothing, ()) & \text{otherwise} \end{cases}$ \\ &&&& Note the change in the fourth parameter to the call $\Theta$ from the 2nd stack value $\boldsymbol{\mu}_{\mathbf{s}}[1]$\\ &&&& (as in {\small CALL}) to the present address $I_{\mathrm{a}}$. This means that the recipient is in fact the\\ &&&& same account as at present, simply that the code is overwritten.\\ @@ -2294,7 +2293,7 @@ \subsection{Instruction Set} &&&& argument is $\boldsymbol{\mu}_{\mathbf{s}}[2]$. As a result, $\boldsymbol{\mu}_{\mathbf{s}}[3]$, $\boldsymbol{\mu}_{\mathbf{s}}[4]$, $\boldsymbol{\mu}_{\mathbf{s}}[5]$ and $\boldsymbol{\mu}_{\mathbf{s}}[6]$ in the definition of {\small CALL} \\ &&&& should respectively be replaced with $\boldsymbol{\mu}_{\mathbf{s}}[2]$, $\boldsymbol{\mu}_{\mathbf{s}}[3]$, $\boldsymbol{\mu}_{\mathbf{s}}[4]$ and $\boldsymbol{\mu}_{\mathbf{s}}[5]$. \\ &&&& Otherwise exactly equivalent to {\small CALL} except: \\ -&&&& $(\boldsymbol{\sigma}', g', A^+, \mathbf{o}) \equiv \begin{cases}\begin{array}{l}\Theta(\boldsymbol{\sigma}^*, I_{\mathrm{s}}, I_{\mathrm{o}}, I_{\mathrm{a}}, t,\\\quad \boldsymbol{\mu}_{\mathbf{s}}[0], I_{\mathrm{p}}, 0, I_{\mathrm{v}}, \mathbf{i}, I_{\mathrm{e}} + 1, I_{\mathrm{w}})\end{array} & \text{if} \quad I_{\mathrm{v}} \leqslant \boldsymbol{\sigma}[I_{\mathrm{a}}]_{\mathrm{b}} \;\wedge\; I_{\mathrm{e}} < 1024 \\ (\boldsymbol{\sigma}, g, \varnothing, ()) & \text{otherwise} \end{cases}$ \\ +&&&& $(\boldsymbol{\sigma}', \mathrm{g}', A^+, \mathbf{o}) \equiv \begin{cases}\begin{array}{l}\Theta(\boldsymbol{\sigma}^*, I_{\mathrm{s}}, I_{\mathrm{o}}, I_{\mathrm{a}}, t,\\\quad \boldsymbol{\mu}_{\mathbf{s}}[0], I_{\mathrm{p}}, 0, I_{\mathrm{v}}, \mathbf{i}, I_{\mathrm{e}} + 1, I_{\mathrm{w}})\end{array} & \text{if} \quad I_{\mathrm{v}} \leqslant \boldsymbol{\sigma}[I_{\mathrm{a}}]_{\mathrm{b}} \;\wedge\; I_{\mathrm{e}} < 1024 \\ (\boldsymbol{\sigma}, \mathrm{g}, \varnothing, ()) & \text{otherwise} \end{cases}$ \\ &&&& Note the changes (in addition to that of the fourth parameter) to the second \\ &&&& and ninth parameters to the call $\Theta$.\\ &&&& This means that the recipient is in fact the same account as at present, simply\\ @@ -2328,7 +2327,7 @@ \subsection{Instruction Set} 0 & \text{otherwise} \end{cases}$ \\ &&&&\linkdest{C tiny SELFDESTRUCT}{} $C_{\text{\tiny SELFDESTRUCT}}(\boldsymbol{\sigma}, \boldsymbol{\mu}) \equiv G_{selfdestruct} + \begin{cases} -G_{newaccount} & \text{if} \quad n \\ +G_{newaccount} & \text{if} \quad \mathrm{n} \\ 0 & \text{otherwise} \end{cases}$ \\ &&&& $n \equiv \mathtt{\tiny DEAD}(\boldsymbol{\sigma}, \boldsymbol{\mu}_{\mathbf{s}}[0] \mod 2^{160}) \wedge \boldsymbol{\sigma}[I_{\mathrm{a}}]_{\mathrm{b}} \neq 0$ \\ @@ -2415,10 +2414,10 @@ \subsubsection{Cache} \end{equation} Therefore $ \mathbf{c'}$ can be defined as \begin{equation} - \mathbf{c'}[i] = \mathbf{c}_{i} \quad \forall \quad i < n + \mathbf{c'}[i] = \mathbf{c}_{i} \quad \forall \quad i < \mathrm{n} \end{equation} \begin{equation} - n = \left\lfloor\frac{c_{size}}{J_{hashbytes}}\right\rfloor + \mathrm{n} = \left\lfloor\frac{c_{size}}{J_{hashbytes}}\right\rfloor \end{equation} The cache is calculated by performing $J_{cacherounds}$ rounds of the RandMemoHash algorithm to the initial cache $\mathbf{c'}$: \begin{equation} @@ -2433,10 +2432,10 @@ \subsubsection{Cache} \end{equation} Where a single round modifies each subset of the cache as follows: \begin{equation} - E_\text{\tiny RMH}(\mathbf{x}) = \big( E_{rmh}(\mathbf{x}, 0), E_{rmh}(\mathbf{x}, 1), ... , E_{rmh}(\mathbf{x}, n - 1) \big)\linkdest{E__cacherounds}{} + E_\text{\tiny RMH}(\mathbf{x}) = \big( E_{rmh}(\mathbf{x}, 0), E_{rmh}(\mathbf{x}, 1), ... , E_{rmh}(\mathbf{x}, \mathrm{n} - 1) \big)\linkdest{E__cacherounds}{} \end{equation} \begin{multline} - E_{rmh}(\mathbf{x}, i) = \texttt{KEC512}(\mathbf{x'}[(i - 1 + n) \mod n] \oplus \mathbf{x'}[\mathbf{x'}[i][0] \mod n]) \\ + E_{rmh}(\mathbf{x}, i) = \texttt{KEC512}(\mathbf{x'}[(i - 1 + \mathrm{n}) \mod \mathrm{n}] \oplus \mathbf{x'}[\mathbf{x'}[i][0] \mod \mathrm{n}]) \\ \text{with} \quad \mathbf{x'} = \mathbf{x} \quad \text{except} \quad \mathbf{x'}[j] = E_{rmh}(\mathbf{x}, j) \quad \forall \quad j < i \end{multline}