├── .gitignore ├── LICENSE.md ├── Makefile ├── README.md ├── YPCheatSheet.pdf └── YPCheatSheet.tex /.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.dvi 3 | *.log 4 | Paper.tex 5 | paper.pdf 6 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ## creative commons 2 | 3 | # Attribution-ShareAlike 4.0 International 4 | 5 | Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. 6 | 7 | ### Using Creative Commons Public Licenses 8 | 9 | Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. 10 | 11 | * __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors). 12 | 13 | * __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees). 14 | 15 | ## Creative Commons Attribution-ShareAlike 4.0 International Public License 16 | 17 | By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. 18 | 19 | ### Section 1 – Definitions. 20 | 21 | a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. 22 | 23 | b. __Adapter's License__ means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. 24 | 25 | c. __BY-SA Compatible License__ means a license listed at [creativecommons.org/compatiblelicenses](http://creativecommons.org/compatiblelicenses), approved by Creative Commons as essentially the equivalent of this Public License. 26 | 27 | d. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. 28 | 29 | e. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. 30 | 31 | f. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. 32 | 33 | g. __License Elements__ means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike. 34 | 35 | h. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License. 36 | 37 | i. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. 38 | 39 | j. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License. 40 | 41 | k. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. 42 | 43 | l. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. 44 | 45 | m. __You__ means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. 46 | 47 | ### Section 2 – Scope. 48 | 49 | a. ___License grant.___ 50 | 51 | 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: 52 | 53 | A. reproduce and Share the Licensed Material, in whole or in part; and 54 | 55 | B. produce, reproduce, and Share Adapted Material. 56 | 57 | 2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 58 | 59 | 3. __Term.__ The term of this Public License is specified in Section 6(a). 60 | 61 | 4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. 62 | 63 | 5. __Downstream recipients.__ 64 | 65 | A. __Offer from the Licensor – Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. 66 | 67 | B. __Additional offer from the Licensor – Adapted Material.__ Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply. 68 | 69 | C. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 70 | 71 | 6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). 72 | 73 | b. ___Other rights.___ 74 | 75 | 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 76 | 77 | 2. Patent and trademark rights are not licensed under this Public License. 78 | 79 | 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. 80 | 81 | ### Section 3 – License Conditions. 82 | 83 | Your exercise of the Licensed Rights is expressly made subject to the following conditions. 84 | 85 | a. ___Attribution.___ 86 | 87 | 1. If You Share the Licensed Material (including in modified form), You must: 88 | 89 | A. retain the following if it is supplied by the Licensor with the Licensed Material: 90 | 91 | i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); 92 | 93 | ii. a copyright notice; 94 | 95 | iii. a notice that refers to this Public License; 96 | 97 | iv. a notice that refers to the disclaimer of warranties; 98 | 99 | v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; 100 | 101 | B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and 102 | 103 | C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 104 | 105 | 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 106 | 107 | 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 108 | 109 | b. ___ShareAlike.___ 110 | 111 | In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply. 112 | 113 | 1. The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License. 114 | 115 | 2. You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material. 116 | 117 | 3. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply. 118 | 119 | ### Section 4 – Sui Generis Database Rights. 120 | 121 | Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: 122 | 123 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; 124 | 125 | b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and 126 | 127 | c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. 128 | 129 | For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. 130 | 131 | ### Section 5 – Disclaimer of Warranties and Limitation of Liability. 132 | 133 | a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__ 134 | 135 | b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__ 136 | 137 | c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. 138 | 139 | ### Section 6 – Term and Termination. 140 | 141 | a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. 142 | 143 | b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 144 | 145 | 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 146 | 147 | 2. upon express reinstatement by the Licensor. 148 | 149 | For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. 150 | 151 | c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. 152 | 153 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. 154 | 155 | ### Section 7 – Other Terms and Conditions. 156 | 157 | a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. 158 | 159 | b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.t stated herein are separate from and independent of the terms and conditions of this Public License. 160 | 161 | ### Section 8 – Interpretation. 162 | 163 | a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. 164 | 165 | b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. 166 | 167 | c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. 168 | 169 | d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. 170 | 171 | ``` 172 | Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. 173 | 174 | Creative Commons may be contacted at [creativecommons.org](http://creativecommons.org/). 175 | ``` -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | %.pdf: %.tex 2 | latex $< && dvipdf $*.dvi 3 | 4 | all: YPCheatSheet.pdf 5 | 6 | clean: 7 | rm -f YPCheatSheet.log YPCheatSheet.dvi YPCheatSheet.aux 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## The Yellow Paper cheat sheet 2 | 3 | This is intended as a quick reference for some of the symbols, functions and conventions in the [Ethereum Yellow Paper](https://github.com/ethereum/yellowpaper/). 4 | 5 | It is still a work in progress. Things to do: 6 | 7 | * Complete the TODOs in the document. 8 | * Add more stuff! In particular, I've more-or-less ignored the appendices for now. 9 | * Add a little further explanation where appropriate. 10 | * Consider the format - could it usefully be made more compact? 11 | * [Stretch goal] Link with the original YP so that it can contain cross-references to equations and sections. 12 | 13 | PRs welcome in due course, but might be worth waiting a little while to let things settle down. 14 | 15 | ---- 16 | 17 | This work is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). 18 | -------------------------------------------------------------------------------- /YPCheatSheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benjaminion/YellowPaper_CheatSheet/55a88681786777f93c67ebf65faaf259502b68f6/YPCheatSheet.pdf -------------------------------------------------------------------------------- /YPCheatSheet.tex: -------------------------------------------------------------------------------- 1 | \documentclass[9pt,oneside]{amsart} 2 | \usepackage{amsmath} 3 | \usepackage{amssymb} 4 | \usepackage[a4paper,width=170mm,top=18mm,bottom=22mm,includeheadfoot]{geometry} 5 | \usepackage{booktabs} 6 | \usepackage[usenames,dvipsnames]{xcolor} 7 | \usepackage{longtable} 8 | \usepackage{array} 9 | 10 | \definecolor{lightyellow}{rgb}{1,0.98,0.9} 11 | 12 | \begin{document} 13 | 14 | \pagecolor{lightyellow} 15 | 16 | \section{Conventions} 17 | 18 | \center 19 | 20 | \newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}p{#1}} 21 | \begin{tabular}{L{0.25\linewidth}L{0.25\linewidth}L{0.3\linewidth}} 22 | \toprule 23 | \textbf{Item} & \textbf{Convention} & \textbf{Examples} \\ 24 | \midrule 25 | Top level structures & Lower case bold Greek & $\boldsymbol{\sigma}$, the world state\newline $\boldsymbol{\mu}$, the machine state. \\ 26 | \midrule 27 | Functions on highly structured values & Upper case Greek & $\Upsilon$, the Ethereum state transition function. \\ 28 | \midrule 29 | Most functions & Upper case letters, possibly subscripted & $C$, the general cost function\newline $C_\text{\tiny SSTORE}$, the cost function for the {\tiny SSTORE} operation. \\ 30 | \midrule 31 | Specialised functions & Typewriter & $\texttt{KEC}$, the Keccak-256 hash\newline $\texttt{KEC512}$, the Keccak-512 hash function. \\ 32 | \midrule 33 | Tuple & Upper case letter & $T$, a transaction. \\ 34 | \midrule 35 | Component of a Tuple & Subscripted upper-case letter.\newline A capital subscript refers to a component that is a tuple. & $T_n$, the transaction nonce\newline $I_H$, The header of the current block (a tuple). \\ 36 | \midrule 37 | Scalars, fixed size byte sequences/arrays & Usually a lower-case letter Sometimes Greek & $n$, a transaction's nonce\newline $\delta$, the number of stack items required. \\ 38 | \midrule 39 | Arbitrary length sequences & Bold lower-case & $\mathbf{o}$, output data of message call. \\ 40 | \midrule 41 | Sets & Double struck capitals & $\mathbb{P}_{256}$, positive integers less than $2^{256}$\newline $\mathbb{B}_{32}$, byte sequences of length $32$. \\ 42 | \midrule 43 | Components or subsequences of sequences & Square brackets & $\boldsymbol{\mu}_\mathbf{s}[0]$, the first item on the stack\newline $\boldsymbol{\mu}_\mathbf{m}[0..31]$ the first $32$ items in memory. \\ 44 | \midrule 45 | Modified (and utilisable) value & Prime mark & $g'$ gas remaining. \\ 46 | \midrule 47 | Intermediate values & Asterisk superscripts & $g^*$ gas to be refunded\newline $g^{**}$ available gas remaining after code execution.\\ 48 | \midrule 49 | Element-wise transformations & Asterisk superscript on a function & $f^*\big((x_0, x_1, ...) \big) \equiv \big( f(x_0), f(x_1), ... \big)$ for any function $f$. \\ 50 | \bottomrule 51 | \end{tabular} 52 | 53 | \endcenter 54 | 55 | \vspace{7pt} 56 | \section{Symbols} 57 | 58 | \begin{longtable}{p{0.10\linewidth}p{0.85\linewidth}} 59 | \toprule 60 | Name & Description \\ 61 | \midrule 62 | \endhead 63 | \multicolumn{2}{l}{\textbf{High level constructs}} \\*[5pt] 64 | $\boldsymbol{\sigma}$ & The world-state, comprising all accounts' nonces, balances, storage and code. \\ 65 | $\boldsymbol{\sigma}_t$ & World-state at time $t$. \\ 66 | $\boldsymbol{\mu}$ & Machine-state tuple, $(g, pc, \mathbf{m}, i, \mathbf{s})$, which are gas, program counter, memory, memory size, stack. \\ 67 | $T$ & An Ethereum transaction \\ 68 | $T_0$, $T_1$, ... & Individual transactions within a block \\ 69 | $B$ & A block: $B \equiv (..., (T_0, T_1, ...) )$ \\ 70 | $\Upsilon$ & The Ethereum state transition function: $\boldsymbol{\sigma}_{t+1} \equiv \Upsilon(\boldsymbol{\sigma}_t, T)$ \\ 71 | $\Omega$ & The block-finalisation state transition function (pays out the mining reward). \\ 72 | $\Pi$ & The block-level state-accumulation function: $\Pi(\boldsymbol{\sigma}, B) \equiv \Omega(B, \Upsilon(\Upsilon(\boldsymbol{\sigma}, T_0), T_1) ...)$ \\ 73 | 74 | \vspace{5pt} \\ 75 | \midrule 76 | \multicolumn{2}{l}{\textbf{World state}} \\*[5pt] 77 | $\boldsymbol{\sigma}[a]$ & The account state of account $a$, being a tuple of (nonce, balance, storageRoot, codeHash). \\ 78 | $\boldsymbol{\sigma}[a]_n$ & The nonce of account $a$. \\ 79 | $\boldsymbol{\sigma}[a]_b$ & The balance of account $a$. \\ 80 | $\boldsymbol{\sigma}[a]_s$ & A 256-bit hash of the root node of a Merkle Patricia tree that encodes the storage contents of account $a$. Note that $\texttt{\small TRIE}\big(L_I^*(\boldsymbol{\sigma}[a]_\mathbf{s})\big) \equiv \boldsymbol{\sigma}[a]_s$ \\ 81 | $\boldsymbol{\sigma}[a]_c$ & The hash of the EVM code of account $a$. Equal to $\texttt{\small KEC}(\mathbf{b})$ where $\mathbf{b}$ is the account's code.\\ 82 | 83 | \vspace{5pt} \\ 84 | \midrule 85 | \multicolumn{2}{l}{\textbf{Machine state}} \\*[5pt] 86 | $\boldsymbol{\mu}_g$ & The gas available. \\ 87 | $\boldsymbol{\mu}_{pc}$ & The program counter. \\ 88 | $\boldsymbol{\mu}_\mathbf{m}$ & The memory contents. \\ 89 | $\boldsymbol{\mu}_i$ & The number of memory words allocated. \\ 90 | $\boldsymbol{\mu}_\mathbf{s}$ & The stack. \\ 91 | $\boldsymbol{\mu}_\mathbf{s}[n]$ & Item at stack depth $n$. \\ 92 | 93 | \vspace{5pt} \\ 94 | \midrule 95 | \multicolumn{2}{l}{\textbf{Substate}} \\*[5pt] 96 | $A$ & A Transaction substate during execution: $A \equiv (A_\mathbf{s}, A_\mathbf{l}, A_\mathbf{t}, A_r) \equiv (\mathbf{s}, \mathbf{l}, \mathbf{t}, r)$. \\ 97 | $A_\mathbf{s}$ & The self-destruct set. These accounts will be discarded following the transaction's completion. \\ 98 | $A_\mathbf{l}$ & The log series. \\ 99 | $A_\mathbf{t}$ & The set of touched accounts. Empty ones are deleted at the end of the transaction.\\ 100 | $A_r$ & The gas refund balance. Can partially offset execution costs.\\ 101 | $A^0$ & The empty substate: $A^0 \equiv (\varnothing, (), \varnothing, 0)$. \\ 102 | 103 | \vspace{5pt} \\ 104 | \midrule 105 | \multicolumn{2}{l}{\textbf{Execution environment}} \\*[5pt] 106 | $I$ & Tuple of the following items provided to the execution environment. \\ 107 | $I_a$ & The address of the account which owns the code that is executing. \\ 108 | $I_o$ & The sender address of the transaction that originated this execution. \\ 109 | $I_p$ & The price of gas in the transaction that originated this execution. \\ 110 | $I_\mathbf{d}$ & The byte array that is the input data to this execution; if the execution agent is a transaction, this would be the transaction data. \\ 111 | $I_s$ & The address of the account which caused the code to be executing; if the execution agent is a transaction, this would be the transaction sender. \\ 112 | $I_v$ & The value, in Wei, passed to this account as part of the same procedure as execution; if the execution agent is a transaction, this would be the transaction value. \\ 113 | $I_\mathbf{b}$ & The byte array that is the machine code to be executed. \\ 114 | $I_H$ & The block header of the present block. \\ 115 | $I_e$ & The depth of the present message-call or contract-creation (i.e. the number of {\small CALL}s or {\small CREATE}s being executed at present). \\ 116 | $I_w$ & Flag for permission to make modifications to the state. See EIP-214, STATICCALL \\ 117 | 118 | \vspace{5pt} \\ 119 | \multicolumn{2}{l}{Execution} \\*[5pt] 120 | $\Xi$ & The code execution function $(\boldsymbol{\sigma}', g', A, \mathbf{o}) \equiv \Xi(\boldsymbol{\sigma}, g, I)$. \\ 121 | $\mathbf{o}$ & The output data of a message call, $\mathbf{o} \equiv H(\boldsymbol{\mu}, I)$.\newline At contract creation, the contract bytecode to be deployed. \\ 122 | $\mathbf{i}$ & The initialisation EVM code for newly deployed contract (contract constructor). \\ 123 | $H(\boldsymbol{\mu}, I)$ & The normal halting function, usually the value provided by the RETURN or REVERT opcodes, or empty in the case of STOP. \\ 124 | $Z(\boldsymbol{\sigma}, \boldsymbol{\mu}, I)$ & The exceptional halting function. \\ 125 | $w$ & The current operation to be executed: $w \equiv I_\mathbf{b}[\boldsymbol{\mu}_{pc}]$ if $\boldsymbol{\mu}_{pc} < \lVert I_\mathbf{b} \rVert$, and \small{STOP} otherwise. \\ 126 | 127 | \vspace{5pt} \\ 128 | \midrule 129 | \multicolumn{2}{l}{\textbf{Blocks}} \\*[5pt] 130 | $B$ & A block: $B \equiv (B_H, B_\mathbf{T}, B_\mathbf{U}).$ \\ 131 | $B_H$ & The block's header. \\ 132 | $B_\mathbf{T}$ & The block's transactions. \\ 133 | $B_\mathbf{U}$ & Headers of ommer/uncle blocks of this block. \\ 134 | $B_\mathbf{R}$ & Transaction receipts. \\ 135 | $D(H)$ & The difficulty of the block with header $H$. \\ 136 | $P(H)$ & The parent block of the block with header $H$. \\ 137 | $V(H)$ & The block header validity function. \\ 138 | 139 | \vspace{5pt} \\ 140 | \multicolumn{2}{l}{Block header} \\*[5pt] 141 | $H_p$ & \textbf{parentHash}: The Keccak 256-bit hash of the parent block's header, in its entirety. \\ 142 | $H_o$ & \textbf{ommersHash} The Keccak 256-bit hash of the ommers list portion of this block. \\ 143 | $H_c$ & \textbf{beneficiary} The 160-bit address to which all fees collected from the successful mining of this block be transferred. \\ 144 | $H_r$ & \textbf{stateRoot} The Keccak 256-bit hash of the root node of the state trie, after all transactions are executed and finalisations applied. \\ 145 | $H_t$ & \textbf{transactionsRoot} The Keccak 256-bit hash of the root node of the trie structure populated with each transaction in the transactions list portion of the block. \\ 146 | $H_e$ & \textbf{receiptsRoot} The Keccak 256-bit hash of the root node of the trie structure populated with the receipts of each transaction in the transactions list portion of the block. \\ 147 | $H_b$ & \textbf{logsBloom} The Bloom filter composed from indexable information (logger address and log topics) contained in each log entry from the receipt of each transaction in the transactions list. \\ 148 | $H_d$ & \textbf{difficulty} A scalar value corresponding to the difficulty level of this block. \\ 149 | $H_i$ & \textbf{number} A scalar value equal to the number of ancestor blocks. The genesis block has a number of zero. \\ 150 | $H_l$ & \textbf{gasLimit} A scalar value equal to the current limit of gas expenditure per block. \\ 151 | $H_g$ & \textbf{gasUsed} A scalar value equal to the total gas used in transactions in this block. \\ 152 | $H_s$ & \textbf{timestamp} A scalar value equal to the reasonable output of Unix's time() at this block's inception. \\ 153 | $H_x$ & \textbf{extraData} An arbitrary byte array containing data relevant to this block. This must be 32 bytes or fewer. \\ 154 | $H_m$ & \textbf{mixHash} A 256-bit hash which proves combined with the nonce that a sufficient amount of computation has been carried out on this block. \\ 155 | $H_n$ & \textbf{nonce} A 64-bit hash which proves combined with the mix-hash that a sufficient amount of computation has been carried out on this block. \\ 156 | 157 | \vspace{5pt} \\ 158 | \midrule 159 | \multicolumn{2}{l}{\textbf{Transactions}} \\*[5pt] 160 | $T_n$ & Transaction nonce. \\ 161 | $T_p$ & Gas price for the transaction. \\ 162 | $T_g$ & The maximum gas for a transaction. \\ 163 | $T_t$ & The ``to'' address for the transaction. \\ 164 | $T_v$ & The value to be transferred by the transaction. \\ 165 | $T_w$, $T_r$, $T_s$ & The $v$, $r$, $s$ values of the transaction signature. \\ 166 | $T_\mathbf{i}$ & EVM-code for account initialisation (i.e. contract deployment). \\ 167 | $T_\mathbf{d}$ & Input data of a message call. \\ 168 | $S(T)$ & Sender function---recovers the sender address from the transaction: \newline $S(T) \equiv \mathcal{B}_{96..255}\big(\mathtt{KEC}\big( \mathtt{ECDSARECOVER}(h(T), T_w, T_r, T_s) \big) \big).$ \\ 169 | 170 | \vspace{5pt} \\ 171 | \multicolumn{2}{l}{Transaction Receipt} \\*[5pt] 172 | $R$ & A transaction receipt: $R \equiv (R_z, R_u, R_b, R_\mathbf{l})$ \\ 173 | $R_z$ & The status code of the transaction. \\ 174 | $R_u$ & The cumulative gas used so far in the block. \\ 175 | $R_b$ & The bloom filter composed from the information in the transaction logs. \\ 176 | $R_\mathbf{l}$ & The log entries created by the transaction, $(O_0, O_1, ...)$. \\ 177 | $O$ & A log entry: $O \equiv (O_a, ({O_\mathbf{t}}_0, {O_\mathbf{t}}_1, ...), O_\mathbf{d})$. \\ 178 | $O_a$ & The logger's address. \\ 179 | $O_\mathbf{t}$ & A 32-byte log topic. \\ 180 | $O_\mathbf{d}$ & The log data for this entry. \\ 181 | 182 | $\Upsilon^g$ & The total gas used in this transaction. \\ 183 | $\Upsilon^\mathbf{l}$ & The logs created by this transaction. \\ 184 | $\Upsilon^z$ & The status code of this transaction, $z$. \\ 185 | 186 | \vspace{5pt} \\ 187 | \midrule 188 | \multicolumn{2}{l}{\textbf{Miscellaneous functions}} \\*[5pt] 189 | $\ell(\mathbf{x})$ & The last item in sequence $\mathbf{x}$: $\ell(\mathbf{x}) \equiv \mathbf{x}[\lVert \mathbf{x} \rVert - 1]$ \\ 190 | $L(n)$ & The ``all but one 64th'' function: $L(n) \equiv n - \lfloor n / 64 \rfloor$.\\ 191 | $L_I\big( (k, v) \big)$ & Representation of key--value pairs in the trie: $L_I\big( (k, v) \big) \equiv \big(\texttt{KEC}(k), \texttt{RLP}(v)\big)$ \\ 192 | $L_R$ & TODO \\ 193 | $L_S$ & World-state collapse function. TODO: expand. Seems to have a different function in computing the message hash.\\ 194 | $L_T$ & TODO \\ 195 | $M(s, f, l)$ & Memory expansion function. $s$ is the current top of memory; $f$ is the start of writing; $l$ is the number of bytes to be written. \\ 196 | $\mathcal{B}$ & Bit reference function such that $\mathcal{B}_j(\mathbf{x})$ equals the bit of index $j$ (indexed from 0) in the byte array $\mathbf{x}$ \\ 197 | $\mathtt{EMPTY}(\boldsymbol{\sigma}, a)$ & An account $a$ is \textit{empty} when it has no code, zero nonce and zero balance, $\boldsymbol{\sigma}[a]_c = \texttt{\small KEC}\big(()\big) \wedge \boldsymbol{\sigma}[a]_n = 0 \wedge \boldsymbol{\sigma}[a]_b = 0$. \\ 198 | $\mathtt{DEAD}(\boldsymbol{\sigma}, a)$ & An account $a$ is \textit{dead} when its account state is non-existent or empty: $\varnothing \vee \mathtt{EMPTY}(\boldsymbol{\sigma}, a)$. \\ 199 | $\mathtt{TRIE}$ & The root hash of the Merkle Patricia tree constructed from its arguments. \\ 200 | $\mathtt{KEC}$ & TODO \\ 201 | $\mathtt{RLP}$ & TODO \\ 202 | $\mathtt{PoW}$ & TODO \\ 203 | 204 | \vspace{5pt} \\ 205 | \midrule 206 | \multicolumn{2}{l}{\textbf{Operators and symbols}} \\*[5pt] 207 | $\lVert ... \rVert$, $| ... |$ & Length of a sequence. These seem to be used interchangeably, but I may have missed something. \\ 208 | $\wedge$ & Logical ``And''. \\ 209 | $\vee$ & Logical ``Or''. \\ 210 | $\varnothing$ & The empty set. \\ 211 | $\cdot$ & Concatenation, $(a, b, c, d) \cdot e \equiv (a, b, c, d, e)$, or scalar multiplication depending on context. \\ 212 | 213 | \vspace{5pt} \\ 214 | \midrule 215 | \multicolumn{2}{l}{\textbf{Todo}} \\*[5pt] 216 | $\mathbb{B}$ & The set of all sequences of bytes. \\ 217 | $\mathbb{B}_n$ & The set of all byte sequences of length $n$ bytes: $\mathbb{B}_n = \{ B: B \in \mathbb{B} \wedge \lVert B \rVert = n \}$ \\ 218 | $\mathbb{P}$ & The set of positive integers [what's wrong with $\mathbb{N}$??? Grrr...]. \\ 219 | $\mathbb{P}_n$ & The set of all positive integers smaller than $2^n$: $\mathbb{P}_n = \{ P: P \in \mathbb{P} \wedge P < 2^n \}$ \\ 220 | $M_{3:2048}$ & Specialised Bloom filter. \\ 221 | $\Lambda(...)$ & Contract creation function. \\ 222 | $\Theta(...)$ & ``Message call''/contract execution function? Not very clearly defined anywhere, but used extensively. \\ 223 | $\Gamma(B)$ & The ``initiation state'' of block $B$. Usually $\boldsymbol{\sigma}_i: \mathtt{TRIE}(L_S(\boldsymbol{\sigma}_i)) = {P(B_H)_H}_r$. \\ 224 | $\Psi(B)$ & A block transition function that maps an incomplete block $B$ to a complete block $B'$ (adds in mixHash, nonce, stateRoot). \\ 225 | $r(...)$ & Calculates stateRoot? Used once but not defined. \\ 226 | \textit{etc.} \\ 227 | 228 | \bottomrule 229 | \end{longtable} 230 | 231 | \end{document} 232 | --------------------------------------------------------------------------------