Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Metropolis: EIP86 account abstraction #277

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
EIP86: specify CREATE2
  • Loading branch information
pirapira committed Jul 6, 2017
commit 242e0f7e2b7375423db209358e8a60e1684b341a
20 changes: 16 additions & 4 deletions Paper.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2030,10 +2030,22 @@ \subsection{Instruction Set}
&&&& This means that the recipient is in fact the same account as at present, simply\\
&&&& that the code is overwritten {\it and} the context is almost entirely identical.\\
\midrule
0xfb & {\small CREATE\_P2SH} & 3 & 1 & Create a new account with associated code on an address calculated using the \\
&&&& creator's address. \\
&&&& Exactly equivalent to {\small CREATE} except: \\
&&&& $a \equiv \mathcal{B}_{96..255}\Big(\mathtt{\tiny KEC}\big(I_a \cdot \mathtt{\tiny KEC}(\mathbf{i})\big)\Big)$ \\
0xfb & {\small CREATE2} & 4 & 1 & Create a new account with associated code on a predictable address. \\
&&&& $\mathbf{i} \equiv \boldsymbol{\mu}_\mathbf{m}[\boldsymbol{\mu}_\mathbf{s}[2]..(\boldsymbol{\mu}_\mathbf{s}[2] + \boldsymbol{\mu}_\mathbf{s}[3] - 1)]$ \\
&&&& $a \equiv \mathcal{B}_{96..255}\Big(\mathtt{\tiny KEC}\big(I_a\cdot \boldsymbol{\mu}_\mathbf{s}[1]\cdot \mathtt{\tiny KEC}(\mathbf i)\big)\Big)$ \\
&&&& $(\boldsymbol{\sigma}', \boldsymbol{\mu}_g', A^+) \equiv \begin{cases}
\begin{array}{l}\Lambda(\boldsymbol{\sigma}^*, I_a, I_o, L(\boldsymbol{\mu}_g), I_p, \\ \phantom{\Lambda(}\boldsymbol{\mu}_\mathbf{s}[0], \mathbf{i}, I_e + 1, a)\end{array} & \text{if}\begin{array}{l}(\boldsymbol{\sigma}^*[a]=\varnothing\vee\boldsymbol{\sigma}^*[a]_c=())\wedge\\\boldsymbol{\mu}_\mathbf{s}[0]\le\boldsymbol{\sigma}[I_a]_b\wedge I_e<1024\end{array}\\
(\boldsymbol{\sigma},\boldsymbol{\mu}_g,\varnothing)&\text{otherwise}
\end{cases}$ \\
&&&& $\boldsymbol{\sigma}^*\equiv\boldsymbol{\sigma}$ except $\boldsymbol{\sigma}^*[I_a]_n=\boldsymbol{\sigma}[I_a]_n+1$ \\
&&&& $A'\equiv A\Cup A^+$ (with $\Cup$ defined in the definition of {\small CREATE}) \\
&&&& $\boldsymbol{\mu}'_\mathbf{s}[0] \equiv x$ \\
&&&& where $x = 0$ if the code execution for this operation failed due to an exceptional \\
&&&& halting $Z(\boldsymbol{\sigma}^*,\boldsymbol{\mu}, I) = \top$ or $I_e = 1024$ (the maximum call depth limit is reached) or \\
&&&& $\boldsymbol{\mu}_\mathbf{s}[0] > \boldsymbol{\sigma}[I_a]_b$ (balance of the caller is too low to fulfill the balance transfer) or \\
&&&& $\boldsymbol{\sigma}[a]_c \neq ()$ (a contract already exists); otherwise $x = a$. \\
&&&& $\boldsymbol{\mu}'_i \equiv M(\boldsymbol{\mu}_i, \boldsymbol{\mu}_\mathbf{s}[2], \boldsymbol{\mu}_\mathbf{s}[3])$ \\
&&&& Thus the operand order is: value, salt, input offset, input size. \\
\midrule
0xfe & {\small INVALID} & $\varnothing$ & $\varnothing$ & Designated invalid instruction. \\
\midrule
Expand Down