├── .gitignore
├── .travis.yml
├── Biblio.bib
├── IEEEbib.bst
├── JS.tex
├── Paper.pdf
├── Paper.reflib
├── Paper.tex
├── README.md
├── Wire.tex
├── build.sh
├── build_ethereum_yellow_paper_cn.sh
├── cancel.sty
├── deploykey.enc
├── ethereum_yellow_paper_cn.pdf
├── ethereum_yellow_paper_cn.reflib
├── ethereum_yellow_paper_cn.tex
├── revision_note
└── f72032b_2018-05-04.md
└── travis_deploy.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | *.aux
3 | *.bbl
4 | *.blg
5 | *.log
6 | *.fdb_latexmk
7 | *.fls
8 | *.synctex.gz
9 | *.out
10 |
11 | Version.tex
12 |
13 | .idea
14 |
15 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: required
2 | before_install:
3 | - sudo apt-get -qq update
4 | - sudo apt-get install texlive texlive-latex3
5 | script:
6 | - ./build.sh
7 | deploy:
8 | provider: script
9 | script: ./travis_deploy.sh
10 | skip_cleanup: true
11 | on:
12 | branch: master
13 | env:
14 | global:
15 | - ENCRYPTION_LABEL="19a81de38b62"
16 | - COMMIT_AUTHOR_EMAIL="chris@ethereum.org"
17 | - COMMIT_AUTHOR="Travis CI"
18 | - PUSH_REPO="git@github.com:ethereum/yellowpaper.git"
19 |
--------------------------------------------------------------------------------
/Biblio.bib:
--------------------------------------------------------------------------------
1 | @book{ASICSmithMJS,
2 | title = {{Application-Specific Integrated Circuits}},
3 | author = "Smith, Michael John Sebastian",
4 | publisher = "Addison-Wesley",
5 | year = "1997",
6 | ISBN = "0201500221",
7 | }
8 |
9 | @misc{ECDSAcerticom,
10 | url = "https://web.archive.org/web/20170921160141/http://cs.ucsb.edu/~koc/ccs130h/notes/ecdsa-cert.pdf",
11 | note = "Accessed 21 September 2017, but the original link was inaccessible on 19 October 2017. Refer to section 6.2 for ECDSAPUBKEY, and section 7 for ECDSASIGN and ECDSARECOVER.",
12 | title = {{The Elliptic Curve Digital Signature Algorithm (ECDSA)}},
13 | publisher = {{Certicom Research}},
14 | location = "Canada",
15 | author = "Don Johnson
16 | and Alfred Menezes
17 | and Scott Vanstone",
18 | year = "2001",
19 | abstract = "The Elliptic Curve Digital Signature Algorithm (ECDSA) is the elliptic curve analogue of the Digital Signature Algorithm (DSA). It was accepted in 1999 as an ANSI standard, and was accepted in 2000 as IEEE and NIST standards. It was also accepted in 1998 as an ISO standard, and is under consideration for inclusion in some other ISO standards. Unlike the ordinary discrete logarithm problem and the integer factorization problem, no subexponential-time algorithm is known for the elliptic curve discrete logarithm problem. For this reason, the strength-per-key-bit is substantially greater in an algorithm that uses elliptic curves. This paper describes the ANSI X9.62 ECDSA, and discusses related security, implementation, and interoperability issues.",
20 | }
21 |
22 | @misc{commitdateforEthash,
23 | url = "https://github.com/ethereum/yellowpaper/commit/77a8cf2428ce245bf6e2c39c5e652ba58a278666#commitcomment-24644869",
24 | author = "Christoph Jentzsch",
25 | year = "2015",
26 | publisher = "Github",
27 | title = "Commit date for Ethash",
28 | }
29 |
30 | @misc{npmElectrum2017,
31 | url = "https://www.npmjs.com/package/electrum",
32 | author = "Arnaud, Pierre
33 | and Schroeter, Mathieu
34 | and Le Barbare, Sam",
35 | title = {{Electrum}},
36 | year = {{2017}},
37 | }
38 |
39 | @Inbook{Courtois2014,
40 | author="Courtois, Nicolas T.
41 | and Grajek, Marek
42 | and Naik, Rahul",
43 | editor="Kotulski, Zbigniew
44 | and Ksi{\k{e}}{\.{z}}opolski, Bogdan
45 | and Mazur, Katarzyna",
46 | title="Optimizing SHA256 in Bitcoin Mining",
47 | bookTitle="Cryptography and Security Systems: Third International Conference, CSS 2014, Lublin, Poland, September 22-24, 2014. Proceedings",
48 | year="2014",
49 | publisher="Springer Berlin Heidelberg",
50 | address="Berlin, Heidelberg",
51 | pages="131--144",
52 | abstract="Bitcoin is a ``crypto currency'', a decentralized electronic payment scheme based on cryptography. It implements a particular type of peer-to-peer payment system. Bitcoin depends on well-known cryptographic standards such as SHA-256. In this paper we revisit the cryptographic process which allows one to make money by producing new bitcoins. We reformulate this problem as a specific sort of Constrained Input Small Output (CISO) hashing problem and reduce the problem to a pure block cipher problem, cf. Fig. 1. We estimate the speed of this process and we show that the amortized cost of this process is less than it seems and it depends on a certain cryptographic constant which is estimated to be at most 1.89. These optimizations enable bitcoin miners to save countless millions of dollars per year in electricity bills.",
53 | isbn="978-3-662-44893-9",
54 | doi="10.1007/978-3-662-44893-9_12",
55 | url="https://doi.org/10.1007/978-3-662-44893-9_12",
56 | }
57 |
58 | @misc{Keccak,
59 | url = "https://keccak.team/files/Keccak-submission-3.pdf",
60 | _note = "Accessed 1 July 2019.",
61 | author = "Guido Bertoni
62 | and Joan Daemen
63 | and Michaël Peeters
64 | and Gilles Van Assche",
65 | title = {{The KECCAK SHA-3 submission}},
66 | year = "2011",
67 | }
68 |
69 | @Book{Davey2002_zbMATH01748069,
70 | Author = "B.A. {Davey} and H.A. {Priestley}",
71 | Title = "Introduction to lattices and order. 2nd ed.",
72 | Edition = "2nd ed.",
73 | ISBN = "0-521-78451-4/pbk",
74 | Pages = "xii + 298",
75 | Year = "2002",
76 | Publisher = "Cambridge: Cambridge University Press",
77 | Language = "English",
78 | MSC2010 = "06-01",
79 | Zbl = "1002.06001",
80 | }
81 |
82 | @Misc{EIP-2,
83 | url = "https://eips.ethereum.org/EIPS/eip-2",
84 | title = "{EIP}-2: Homestead Hard-fork Changes",
85 | author = "Vitalik Buterin",
86 | year = "2015",
87 | }
88 |
89 | @Misc{EIP-100,
90 | url = "https://eips.ethereum.org/EIPS/eip-100",
91 | author = "Vitalik Buterin",
92 | title = "{EIP}-100: Change difficulty adjustment to target mean block time including uncles",
93 | year = "2016",
94 | month = "April",
95 | }
96 |
97 | @Misc{EIP-152,
98 | url = "https://eips.ethereum.org/EIPS/eip-152",
99 | author = "Hess, Tjaden and Luongo, Matt and Dyraga, Piotr and Hancock, James",
100 | title = "{EIP}-152: Add {BLAKE2} compression function `{F}` precompile",
101 | year = "2016",
102 | month = "October",
103 | }
104 |
105 | @Misc{EIP-155,
106 | url = "https://eips.ethereum.org/EIPS/eip-155",
107 | author = "Vitalik Buterin",
108 | title = "{EIP}-155: Simple replay attack protection",
109 | year = "2016",
110 | month = "October",
111 | }
112 |
113 | @Misc{EIP-649,
114 | url = "https://eips.ethereum.org/EIPS/eip-649",
115 | author = "Afri Schoedon and Vitalik Buterin",
116 | title = "{EIP}-649: Metropolis Difficulty Bomb Delay and Block Reward Reduction",
117 | year = "2017",
118 | month = "June",
119 | }
120 |
121 | @Misc{EIP-1014,
122 | url = "https://eips.ethereum.org/EIPS/eip-1014",
123 | author = "Vitalik Buterin",
124 | title = "{EIP}-1014: Skinny {CREATE2}",
125 | year = "2018",
126 | month = "April",
127 | }
128 |
129 | @Misc{EIP-1234,
130 | url = "https://eips.ethereum.org/EIPS/eip-1234",
131 | title = "{EIP}-1234: Constantinople Difficulty Bomb Delay and Block Reward Adjustment",
132 | author = "Afri Schoedon",
133 | year = "2018",
134 | }
135 |
136 | @Misc{EIP-1679,
137 | url = "https://eips.ethereum.org/EIPS/eip-1679",
138 | title = "{EIP}-1679: Hardfork Meta: Istanbul",
139 | author = "Beregszaszi, Alex and Schoedon, Afri",
140 | year = "2019",
141 | }
142 |
143 | @Misc{EIP-2200,
144 | url = "https://eips.ethereum.org/EIPS/eip-2200",
145 | title = "{EIP}-2200: Structured Definitions for Net Gas Metering",
146 | author = "Wei Tang",
147 | year = "2019",
148 | }
149 |
150 | @Misc{EIP-2384,
151 | url = "https://eips.ethereum.org/EIPS/eip-2384",
152 | title = "{EIP}-2384: {Muir Glacier} Difficulty Bomb Delay",
153 | author = "Eric Conner",
154 | year = "2019",
155 | month = "November",
156 | }
157 |
158 | @Misc{EIP-2718,
159 | url = "https://eips.ethereum.org/EIPS/eip-2718",
160 | title = "{EIP}-2718: Typed Transaction Envelope",
161 | author = "Zoltu, Micah",
162 | year = "2020",
163 | month = "June",
164 | }
165 |
166 | @Misc{EIP-2929,
167 | url = "https://eips.ethereum.org/EIPS/eip-2929",
168 | title = "{EIP}-2929: Gas cost increases for state access opcodes",
169 | author = "Buterin, Vitalik and Swende, Martin",
170 | year = "2020",
171 | month = "September",
172 | }
173 |
174 | @Misc{EIP-2930,
175 | url = "https://eips.ethereum.org/EIPS/eip-2930",
176 | title = "{EIP}-2930: Optional access lists",
177 | author = "Buterin, Vitalik and Swende, Martin",
178 | year = "2020",
179 | month = "August",
180 | }
181 |
182 | @Misc{EIP-3554,
183 | url = "https://eips.ethereum.org/EIPS/eip-3554",
184 | title = "{EIP}-3554: Difficulty Bomb Delay to {December} 2021",
185 | author = "Hancock, James",
186 | year = "2021",
187 | month = "May",
188 | }
189 |
190 | @Misc{EIP-3607,
191 | url = "https://eips.ethereum.org/EIPS/eip-3607",
192 | title = "{EIP}-3607: Reject transactions from senders with deployed code",
193 | author = "Feist, Dankrad and Khovratovich, Dmitry and van der Wijden, Marius",
194 | year = "2021",
195 | month = "June",
196 | }
197 |
198 | @Misc{EIP-4345,
199 | url = "https://eips.ethereum.org/EIPS/eip-4345",
200 | title = "{EIP}-4345: Difficulty Bomb Delay to {June} 2022",
201 | author = "Beiko, Tim and Hancock, James and Rush, Thomas Jay",
202 | year = "2021",
203 | month = "October",
204 | }
205 |
206 | @Misc{cryptoeprint:2013:881,
207 | url = "https://eprint.iacr.org/2013/881",
208 | author = "Sompolinsky, Yonatan and Zohar, Aviv",
209 | title = "Accelerating Bitcoin{'}s Transaction Processing. Fast Money Grows on Trees, Not Chains",
210 | year = "2013",
211 | }
212 |
213 | @InCollection{gura2004comparing,
214 | url = "https://www.iacr.org/archive/ches2004/31560117/31560117.pdf",
215 | _note = "\url{https://web.archive.org/web/20170810035057/https://www.iacr.org/archive/ches2004/31560117/31560117.pdf}",
216 | BookTitle = "Cryptographic Hardware and Embedded Systems-CHES 2004",
217 | Publisher = "Springer",
218 | author = "Gura, Nils and Patel, Arun and Wander, Arvinderpal and Eberle, Hans and Shantz, Sheueling Chang",
219 | title = "Comparing elliptic curve cryptography and {RSA} on 8-bit {CPUs}",
220 | pages = "119-132",
221 | year = "2004",
222 | }
223 |
224 | @InProceedings{laurie2004proof,
225 | BookTitle = "Workshop on Economics and Information, Security",
226 | author = "Laurie, Ben and Clayton, Richard",
227 | title = "{``}Proof-of-Work{''} proves not to work; version 0.2",
228 | year = "2004",
229 | }
230 |
231 | @Misc{vishnumurthy03karma:a,
232 | url = "https://www.cs.cornell.edu/people/egs/papers/karma.pdf",
233 | _note = "\url{https://web.archive.org/web/20170810031834/https://www.cs.cornell.edu/people/egs/papers/karma.pdf}",
234 | author = "Vivek Vishnumurthy and Sangeeth Chandrakumar and Emin Gün Sirer",
235 | title = "{KARMA}: A Secure Economic Framework for Peer-to-Peer Resource Sharing",
236 | year = "2003",
237 | }
238 |
239 | @InProceedings{dwork92pricingvia,
240 | _note = "\url{https://web.archive.org/web/20170810035254/http://www.wisdom.weizmann.ac.il/~naor/PAPERS/pvp.pdf}",
241 | url = "http://www.wisdom.weizmann.ac.il/~naor/PAPERS/pvp.pdf",
242 | author = "Cynthia Dwork and Moni Naor",
243 | title = {Pricing via processing or combatting junk mail},
244 | booktitle = {In 12th Annual International Cryptology Conference},
245 | year = {1992},
246 | pages = {139--147},
247 | }
248 |
249 | @misc{nakamoto2008bitcoin,
250 | url = {{http://www.bitcoin.org/bitcoin.pdf}},
251 | _note = "The above URL is recommended by the author here: https://www.mail-archive.com/cryptography@metzdowd.com/msg09959.html.",
252 | title = {{Bitcoin: A peer-to-peer electronic cash system}},
253 | author = {Nakamoto, Satoshi},
254 | _journal = {{Consulted}},
255 | _volume = {{1}},
256 | _pages = {2012},
257 | year = {{2008}},
258 | }
259 |
260 | @Misc{sprankel2013technical,
261 | url = {{http://www.coderblog.de/wp-content/uploads/technical-basis-of-digital-currencies.pdf}},
262 | _note = {{\url{https://web.archive.org/web/20170810025028/http://www.coderblog.de/wp-content/uploads/technical-basis-of-digital-currencies.pdf}}},
263 | author = {Sprankel, Simon},
264 | title = {{Technical Basis of Digital Currencies}},
265 | year = {{2013}},
266 | }
267 |
268 | @Article{aron2012bitcoin,
269 | url = {{http://www.sciencedirect.com/science/article/pii/S0262407912601055}},
270 | Publisher = {{Elsevier}},
271 | author = {Aron, Jacob},
272 | title = {{BitCoin software finds new life}},
273 | journal = {{New Scientist}},
274 | volume = {{213}},
275 | number = {{2847}},
276 | pages = {20},
277 | year = {{2012}},
278 | }
279 |
280 | @misc{mastercoin2013willett,
281 | url = {{https://github.com/mastercoin-MSC/spec}},
282 | _note = {{\url{https://web.archive.org/web/20170810035927/https://github.com/OmniLayer/spec}}},
283 | author = {Willett, J. R.},
284 | title = {{MasterCoin Complete Specification}},
285 | year = {{2013}},
286 | }
287 |
288 | @misc{colouredcoins2012rosenfeld,
289 | url = {{https://github.com/Colored-Coins/Colored-Coins-Protocol-Specification}},
290 | _note = {{Archive: \url{https://web.archive.org/web/20180220235952/https://github.com/Colored-Coins/Colored-Coins-Protocol-Specification}. Earlier version: \url{https://docs.google.com/document/d/1AnkP_cVZTCMLIzw4DvsW6M8Q2JC0lIzrTLuoWu2z1BE/}}},
291 | author = {Meni Rosenfeld and Yoni Assia and Vitalik Buterin and m liorhakiLior and Oded Leiba and Assaf Shomer and Eliran Zach},
292 | title = {{Colored Coins Protocol Specification}},
293 | year = {{2012}},
294 | }
295 |
296 | @incollection{boutellier2014pirates,
297 | url = {{https://www.springer.com/gb/book/9783319040158}},
298 | _note = {{\url{http://wiki.erights.org/wiki/Documentation} and \url{https://web.archive.org/web/20170810040208/https://www.springer.com/gb/book/9783319040158}}},
299 | booktitle = {{Growth Through Innovation}},
300 | publisher = {{Springer}},
301 | author = {Boutellier, Roman and Heinzen, Mareike},
302 | title = {{Pirates, Pioneers, Innovators and Imitators}},
303 | pages = {85-96},
304 | year = {{2014}},
305 | }
306 |
307 | @Article{szabo1997formalizing,
308 | url = {{http://firstmonday.org/ojs/index.php/fm/article/view/548}},
309 | _note = {{\url{https://web.archive.org/web/20170810042659/http://firstmonday.org/ojs/index.php/fm/article/view/548}}},
310 | author = {Szabo, Nick},
311 | title = {{Formalizing and securing relationships on public networks}},
312 | journal = {{First Monday}},
313 | volume = {{2}},
314 | number = {{9}},
315 | year = {{1997}},
316 | }
317 |
318 | @InProceedings{miller1997future,
319 | url = {{https://drive.google.com/file/d/0Bw0VXJKBgYPMS0J2VGIyWWlocms/edit?usp=sharing}},
320 | BookTitle = {{paper delivered at the Extro 3 Conference (August 9)}},
321 | author = {Miller, Mark},
322 | title = {{The Future of Law}},
323 | year = {{1997}},
324 | }
325 |
326 | @misc{buterin2013ethereum,
327 | url = {{https://github.com/ethereum/wiki/wiki/White-Paper}},
328 | author = {Vitalik Buterin},
329 | title = {{Ethereum: A Next-Generation Smart Contract and Decentralized Application Platform}},
330 | year = {{2013}},
331 | }
332 |
333 | @misc{back2002hashcash,
334 | url = {{http://www.hashcash.org/papers/amortizable.pdf}},
335 | _note = {{\url{https://web.archive.org/web/20170810043047/http://www.hashcash.org/papers/amortizable.pdf}}},
336 | author = {Adam Back},
337 | title = {{Hashcash - Amortizable Publicly Auditable Cost-Functions}},
338 | year = {{2002}},
339 | }
340 |
341 | @misc{hashimoto,
342 | url = {{http://diyhpl.us/~bryan/papers2/bitcoin/meh/hashimoto.pdf}},
343 | _note = "Using the ~bryan link after an affirmative reply from the author. If that doesn't work anymore, consider https://web.archive.org/web/20170810043640/https://pdfs.semanticscholar.org/3b23/7cc60c1b9650e260318d33bec471b8202d5e.pdf",
344 | author = {Thaddeus Dryja},
345 | title = {{Hashimoto: I/O bound proof of work}},
346 | year = {{2014}},
347 | }
348 |
349 | @misc{dagger,
350 | url = {{http://www.hashcash.org/papers/dagger.html}},
351 | _note = {{\url{https://web.archive.org/web/20170810043955/http://www.hashcash.org/papers/dagger.html}. Dead original link as of 10 August 2017: \url{http://vitalik.ca/ethereum/dagger.html}}},
352 | author = {Vitalik Buterin},
353 | title = {{Dagger: A Memory-Hard to Compute, Memory-Easy to Verify Scrypt Alternative}},
354 | year = {{2013}},
355 | }
356 |
357 | @misc{lerner2014randmemohash,
358 | url = {{http://www.hashcash.org/papers/memohash.pdf}},
359 | _note = {{\url{https://web.archive.org/web/20170810044110/http://www.hashcash.org/papers/memohash.pdf}}},
360 | author = {Sergio Demian Lerner},
361 | title = {{Strict Memory Hard Hashing Functions}},
362 | year = {{2014}},
363 | }
364 |
365 | @misc{FowlerNollVo1991FNVHash,
366 | url = {{http://www.isthe.com/chongo/tech/comp/fnv/index.html}},
367 | _note = {{\url{https://web.archive.org/web/20180205025406/http://www.isthe.com/chongo/tech/comp/fnv/index.html}}},
368 | author = {Glenn Fowler, Landon Curt Noll, Phong Vo},
369 | title = {{Fowler–Noll–Vo hash function}},
370 | year = {{1991}},
371 | }
372 |
373 | @misc{RFC-7693,
374 | url = "https://tools.ietf.org/html/rfc7693",
375 | author = "Markku--Juhani Saarinen and Jean--Philippe Aumasson",
376 | title = "{RFC} 7693: The {BLAKE2} Cryptographic Hash and Message Authentication Code ({MAC})",
377 | year = "2015",
378 | month = "November",
379 | }
380 |
381 | @misc{BeikoBerlin,
382 | url = "https://github.com/ethereum/eth1.0-specs/blob/master/network-upgrades/mainnet-upgrades/berlin.md",
383 | author = "Beiko, Tim and others",
384 | title = "Berlin Network Upgrade Specification",
385 | year = "2021",
386 | }
387 |
--------------------------------------------------------------------------------
/IEEEbib.bst:
--------------------------------------------------------------------------------
1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% IEEE.bst %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 | % Bibliography Syle file for articles according to IEEE instructions
3 | % balemi@aut.ee.ethz.ch <22-JUN-93>
4 | % modified from unsrt.bib. Contributions by Richard H. Roy
5 |
6 | ENTRY
7 | { address
8 | author
9 | booktitle
10 | chapter
11 | edition
12 | editor
13 | howpublished
14 | institution
15 | journal
16 | key
17 | month
18 | note
19 | number
20 | organization
21 | pages
22 | publisher
23 | school
24 | series
25 | title
26 | type
27 | volume
28 | year
29 | }
30 | {}
31 | { label }
32 |
33 | INTEGERS { output.state before.all mid.sentence after.sentence after.block }
34 |
35 | FUNCTION {init.state.consts}
36 | { #0 'before.all :=
37 | #1 'mid.sentence :=
38 | #2 'after.sentence :=
39 | #3 'after.block :=
40 | }
41 |
42 | STRINGS { s t }
43 |
44 | FUNCTION {output.nonnull}
45 | { 's :=
46 | output.state mid.sentence =
47 | { ", " * write$ }
48 | { output.state after.block =
49 | % next line commented out by rhr and changed to write comma
50 | % { add.period$ write$
51 | { ", " * write$
52 | newline$
53 | "\newblock " write$
54 | }
55 | { output.state before.all =
56 | 'write$
57 | { add.period$ " " * write$ }
58 | if$
59 | }
60 | if$
61 | mid.sentence 'output.state :=
62 | }
63 | if$
64 | s
65 | }
66 |
67 | FUNCTION {output}
68 | { duplicate$ empty$
69 | 'pop$
70 | 'output.nonnull
71 | if$
72 | }
73 |
74 | FUNCTION {output.check}
75 | { 't :=
76 | duplicate$ empty$
77 | { pop$ "empty " t * " in " * cite$ * warning$ }
78 | 'output.nonnull
79 | if$
80 | }
81 |
82 | FUNCTION {output.bibitem}
83 | { newline$
84 | "\bibitem{" write$
85 | cite$ write$
86 | "}" write$
87 | newline$
88 | ""
89 | before.all 'output.state :=
90 | }
91 |
92 | FUNCTION {fin.entry}
93 | { add.period$
94 | write$
95 | newline$
96 | }
97 |
98 | % 5/24/89 rhr
99 | % modified fin.entry function - prints note field after body of entry
100 | %FUNCTION {fin.entry}
101 | %{ add.period$
102 | % note empty$
103 | % 'write$
104 | % { "\par\bgroup\parindent=0em " * annote * "\par\egroup " * write$
105 | % }
106 | % if$
107 | % newline$
108 | %}
109 |
110 | FUNCTION {new.block}
111 | { output.state before.all =
112 | 'skip$
113 | { after.block 'output.state := }
114 | if$
115 | }
116 |
117 | % new block without terminating last block with a comma
118 | FUNCTION {new.ncblock}
119 | {
120 | write$
121 | newline$
122 | "\newblock "
123 | before.all 'output.state :=
124 | }
125 |
126 | FUNCTION {new.nccont}
127 | {
128 | write$
129 | " "
130 | before.all 'output.state :=
131 | }
132 |
133 | FUNCTION {new.sentence}
134 | { output.state after.block =
135 | 'skip$
136 | { output.state before.all =
137 | 'skip$
138 | { after.sentence 'output.state := }
139 | if$
140 | }
141 | if$
142 | }
143 |
144 | FUNCTION {not}
145 | { { #0 }
146 | { #1 }
147 | if$
148 | }
149 |
150 | FUNCTION {and}
151 | { 'skip$
152 | { pop$ #0 }
153 | if$
154 | }
155 |
156 | FUNCTION {or}
157 | { { pop$ #1 }
158 | 'skip$
159 | if$
160 | }
161 |
162 | FUNCTION {new.block.checka}
163 | { empty$
164 | 'skip$
165 | 'new.block
166 | if$
167 | }
168 |
169 | FUNCTION {new.block.checkb}
170 | { empty$
171 | swap$ empty$
172 | and
173 | 'skip$
174 | 'new.block
175 | if$
176 | }
177 |
178 | FUNCTION {new.sentence.checka}
179 | { empty$
180 | 'skip$
181 | 'new.sentence
182 | if$
183 | }
184 |
185 | FUNCTION {new.sentence.checkb}
186 | { empty$
187 | swap$ empty$
188 | and
189 | 'skip$
190 | 'new.sentence
191 | if$
192 | }
193 |
194 | FUNCTION {field.or.null}
195 | { duplicate$ empty$
196 | { pop$ "" }
197 | 'skip$
198 | if$
199 | }
200 |
201 | FUNCTION {emphasize}
202 | { duplicate$ empty$
203 | { pop$ "" }
204 | { "{\em " swap$ * "}" * }
205 | if$
206 | }
207 |
208 | FUNCTION {boldface}
209 | { duplicate$ empty$
210 | { pop$ "" }
211 | { "{\bf " swap$ * "}" * }
212 | if$
213 | }
214 |
215 | %FUNCTION {boldface}
216 | %{ 's swap$ :=
217 | % s "" =
218 | % { "" }
219 | % { "{\bf " s * "}" * }
220 | % if$
221 | %}
222 | %
223 | INTEGERS { nameptr namesleft numnames }
224 |
225 | FUNCTION {format.names}
226 | { 's :=
227 | #1 'nameptr :=
228 | s num.names$ 'numnames :=
229 | numnames 'namesleft :=
230 | { namesleft #0 > }
231 | { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
232 | nameptr #1 >
233 | { namesleft #1 >
234 | { ", " * t * }
235 | { numnames #2 >
236 | { "," * }
237 | 'skip$
238 | if$
239 | t "others" =
240 | { " et~al." * }
241 | { " and " * t * }
242 | if$
243 | }
244 | if$
245 | }
246 | 't
247 | if$
248 | nameptr #1 + 'nameptr :=
249 | namesleft #1 - 'namesleft :=
250 | }
251 | while$
252 | }
253 |
254 | FUNCTION {format.authors}
255 | { author empty$
256 | { "" }
257 | { author format.names }
258 | if$
259 | }
260 |
261 | FUNCTION {format.editors}
262 | { editor empty$
263 | { "" }
264 | { editor format.names
265 | editor num.names$ #1 >
266 | { ", Eds." * }
267 | { ", Ed." * }
268 | if$
269 | }
270 | if$
271 | }
272 |
273 | FUNCTION {format.title}
274 | { title empty$
275 | { "" }
276 | { "``" title "t" change.case$ * }
277 | if$
278 | }
279 |
280 | FUNCTION {n.dashify}
281 | { 't :=
282 | ""
283 | { t empty$ not }
284 | { t #1 #1 substring$ "-" =
285 | { t #1 #2 substring$ "--" = not
286 | { "--" *
287 | t #2 global.max$ substring$ 't :=
288 | }
289 | { { t #1 #1 substring$ "-" = }
290 | { "-" *
291 | t #2 global.max$ substring$ 't :=
292 | }
293 | while$
294 | }
295 | if$
296 | }
297 | { t #1 #1 substring$ *
298 | t #2 global.max$ substring$ 't :=
299 | }
300 | if$
301 | }
302 | while$
303 | }
304 |
305 | FUNCTION {format.date}
306 | { year empty$
307 | { month empty$
308 | { "" }
309 | { "there's a month but no year in " cite$ * warning$
310 | month
311 | }
312 | if$
313 | }
314 | { month empty$
315 | 'year
316 | { month " " * year * }
317 | if$
318 | }
319 | if$
320 | }
321 |
322 | % FUNCTION {format.date}
323 | % { year empty$
324 | % 'year
325 | % { " " year * }
326 | % if$
327 | % }
328 |
329 | FUNCTION {format.btitle}
330 | { title emphasize
331 | }
332 |
333 | FUNCTION {tie.or.space.connect}
334 | { duplicate$ text.length$ #3 <
335 | { "~" }
336 | { " " }
337 | if$
338 | swap$ * *
339 | }
340 |
341 | FUNCTION {either.or.check}
342 | { empty$
343 | 'pop$
344 | { "can't use both " swap$ * " fields in " * cite$ * warning$ }
345 | if$
346 | }
347 |
348 | FUNCTION {format.bvolume}
349 | { volume empty$
350 | { "" }
351 | { "vol." volume tie.or.space.connect
352 | series empty$
353 | 'skip$
354 | { " of " * series emphasize * }
355 | if$
356 | "volume and number" number either.or.check
357 | }
358 | if$
359 | }
360 |
361 | FUNCTION {format.number.series}
362 | { volume empty$
363 | { number empty$
364 | { series field.or.null }
365 | { output.state mid.sentence =
366 | { "number" }
367 | { "Number" }
368 | if$
369 | number tie.or.space.connect
370 | series empty$
371 | { "there's a number but no series in " cite$ * warning$ }
372 | { " in " * series * }
373 | if$
374 | }
375 | if$
376 | }
377 | { "" }
378 | if$
379 | }
380 |
381 | FUNCTION {format.edition}
382 | { edition empty$
383 | { "" }
384 | { output.state mid.sentence =
385 | { edition "l" change.case$ " edition" * }
386 | { edition "t" change.case$ " edition" * }
387 | if$
388 | }
389 | if$
390 | }
391 |
392 | INTEGERS { multiresult }
393 |
394 | FUNCTION {multi.page.check}
395 | { 't :=
396 | #0 'multiresult :=
397 | { multiresult not
398 | t empty$ not
399 | and
400 | }
401 | { t #1 #1 substring$
402 | duplicate$ "-" =
403 | swap$ duplicate$ "," =
404 | swap$ "+" =
405 | or or
406 | { #1 'multiresult := }
407 | { t #2 global.max$ substring$ 't := }
408 | if$
409 | }
410 | while$
411 | multiresult
412 | }
413 |
414 | FUNCTION {format.pages}
415 | { pages empty$
416 | { "" }
417 | { pages multi.page.check
418 | { "pp." pages n.dashify tie.or.space.connect }
419 | { "p." pages tie.or.space.connect }
420 | if$
421 | }
422 | if$
423 | }
424 |
425 | FUNCTION {format.vol.num.pages}
426 | {
427 | volume empty$
428 | {"" }
429 | {"vol. " volume *}
430 | if$
431 | number empty$
432 | 'skip$
433 | {", no. " number * *}
434 | if$
435 | pages empty$
436 | 'skip$
437 | { duplicate$ empty$
438 | { pop$ format.pages }
439 | { ", pp. " * pages n.dashify * }
440 | if$
441 | }
442 | if$
443 | }
444 |
445 | %FUNCTION {format.vol.num.pages}
446 | %%boldface added 3/17/87 rhr
447 | %{ volume field.or.null boldface
448 | % number empty$
449 | % 'skip$
450 | % { "(" number * ")" * *
451 | % volume empty$
452 | % { "there's a number but no volume in " cite$ * warning$ }
453 | % 'skip$
454 | % if$
455 | % }
456 | % if$
457 | % pages empty$
458 | % 'skip$
459 | % { duplicate$ empty$
460 | % { pop$ format.pages }
461 | % { ":" * pages n.dashify * }
462 | % if$
463 | % }
464 | % if$
465 | %}
466 |
467 | FUNCTION {format.chapter.pages}
468 | { chapter empty$
469 | 'format.pages
470 | { type empty$
471 | { "chapter" }
472 | { type "l" change.case$ }
473 | if$
474 | chapter tie.or.space.connect
475 | pages empty$
476 | 'skip$
477 | { ", " * format.pages * }
478 | if$
479 | }
480 | if$
481 | }
482 |
483 | FUNCTION {format.in.ed.booktitle}
484 | { booktitle empty$
485 | { "" }
486 | { editor empty$
487 | { "in " booktitle emphasize * }
488 | { "in " booktitle emphasize * ", " * format.editors * }
489 | if$
490 | }
491 | if$
492 | }
493 |
494 | FUNCTION {empty.misc.check}
495 | { author empty$ title empty$ howpublished empty$
496 | month empty$ year empty$ note empty$
497 | and and and and and
498 | { "all relevant fields are empty in " cite$ * warning$ }
499 | 'skip$
500 | if$
501 | }
502 |
503 | FUNCTION {format.thesis.type}
504 | { type empty$
505 | 'skip$
506 | { pop$
507 | type "t" change.case$
508 | }
509 | if$
510 | }
511 |
512 | FUNCTION {format.tr.number}
513 | { type empty$
514 | { "Tech. {R}ep." }
515 | 'type
516 | if$
517 | number empty$
518 | { "t" change.case$ }
519 | { number tie.or.space.connect }
520 | if$
521 | }
522 |
523 | FUNCTION {format.article.crossref}
524 | { key empty$
525 | { journal empty$
526 | { "need key or journal for " cite$ * " to crossref " * crossref *
527 | warning$
528 | ""
529 | }
530 | { "In {\em " journal * "\/}" * }
531 | if$
532 | }
533 | { "In " key * }
534 | if$
535 | " \cite{" * crossref * "}" *
536 | }
537 |
538 | FUNCTION {format.crossref.editor}
539 | { editor #1 "{vv~}{ll}" format.name$
540 | editor num.names$ duplicate$
541 | #2 >
542 | { pop$ " et~al." * }
543 | { #2 <
544 | 'skip$
545 | { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
546 | { " et~al." * }
547 | { " and " * editor #2 "{vv~}{ll}" format.name$ * }
548 | if$
549 | }
550 | if$
551 | }
552 | if$
553 | }
554 |
555 | FUNCTION {format.book.crossref}
556 | { volume empty$
557 | { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
558 | "In "
559 | }
560 | { "vol." volume tie.or.space.connect
561 | " of " *
562 | }
563 | if$
564 | editor empty$
565 | editor field.or.null author field.or.null =
566 | or
567 | { key empty$
568 | { series empty$
569 | { "need editor, key, or series for " cite$ * " to crossref " *
570 | crossref * warning$
571 | "" *
572 | }
573 | { "{\em " * series * "\/}" * }
574 | if$
575 | }
576 | { key * }
577 | if$
578 | }
579 | { format.crossref.editor * }
580 | if$
581 | " \cite{" * crossref * "}" *
582 | }
583 |
584 | FUNCTION {format.incoll.inproc.crossref}
585 | { editor empty$
586 | editor field.or.null author field.or.null =
587 | or
588 | { key empty$
589 | { booktitle empty$
590 | { "need editor, key, or booktitle for " cite$ * " to crossref " *
591 | crossref * warning$
592 | ""
593 | }
594 | { "In {\em " booktitle * "\/}" * }
595 | if$
596 | }
597 | { "In " key * }
598 | if$
599 | }
600 | { "In " format.crossref.editor * }
601 | if$
602 | " \cite{" * crossref * "}" *
603 | }
604 |
605 | FUNCTION {article}
606 | { output.bibitem
607 | format.authors "author" output.check
608 | new.block
609 | format.title ",''" * "title" output.check
610 | new.ncblock
611 | crossref missing$
612 | { journal emphasize "journal" output.check
613 | format.vol.num.pages output
614 | format.date "year" output.check
615 | }
616 | { format.article.crossref output.nonnull
617 | format.pages output
618 | }
619 | if$
620 | new.block
621 | note output
622 | fin.entry
623 | }
624 |
625 | FUNCTION {book}
626 | { output.bibitem
627 | author empty$
628 | { format.editors "author and editor" output.check }
629 | { format.authors output.nonnull
630 | crossref missing$
631 | { "author and editor" editor either.or.check }
632 | 'skip$
633 | if$
634 | }
635 | if$
636 | new.block
637 | format.btitle "title" output.check
638 | crossref missing$
639 | { format.bvolume output
640 | new.block
641 | format.number.series output
642 | new.sentence
643 | publisher "publisher" output.check
644 | address output
645 | }
646 | { new.block
647 | format.book.crossref output.nonnull
648 | }
649 | if$
650 | format.edition output
651 | format.date "year" output.check
652 | new.block
653 | note output
654 | fin.entry
655 | }
656 |
657 | FUNCTION {booklet}
658 | { output.bibitem
659 | format.authors output
660 | new.block
661 | format.title ",''" * "title" output.check
662 | new.nccont
663 | howpublished address new.block.checkb
664 | howpublished output
665 | address output
666 | format.date output
667 | new.block
668 | note output
669 | fin.entry
670 | }
671 |
672 | FUNCTION {inbook}
673 | { output.bibitem
674 | author empty$
675 | { format.editors "author and editor" output.check }
676 | { format.authors output.nonnull
677 | crossref missing$
678 | { "author and editor" editor either.or.check }
679 | 'skip$
680 | if$
681 | }
682 | if$
683 | new.block
684 | format.btitle "title" output.check
685 | crossref missing$
686 | { format.bvolume output
687 | format.chapter.pages "chapter and pages" output.check
688 | new.block
689 | format.number.series output
690 | new.sentence
691 | publisher "publisher" output.check
692 | address output
693 | }
694 | { format.chapter.pages "chapter and pages" output.check
695 | new.block
696 | format.book.crossref output.nonnull
697 | }
698 | if$
699 | format.edition output
700 | format.date "year" output.check
701 | new.block
702 | note output
703 | fin.entry
704 | }
705 |
706 | FUNCTION {incollection}
707 | { output.bibitem
708 | format.authors "author" output.check
709 | new.block
710 | format.title ",''" * "title" output.check
711 | new.ncblock
712 | crossref missing$
713 | { format.in.ed.booktitle "booktitle" output.check
714 | format.bvolume output
715 | format.number.series output
716 | format.chapter.pages output
717 | new.sentence
718 | publisher "publisher" output.check
719 | address output
720 | format.edition output
721 | format.date "year" output.check
722 | }
723 | { format.incoll.inproc.crossref output.nonnull
724 | format.chapter.pages output
725 | }
726 | if$
727 | new.block
728 | note output
729 | fin.entry
730 | }
731 |
732 | FUNCTION {inproceedings}
733 | { output.bibitem
734 | format.authors "author" output.check
735 | new.block
736 | format.title ",''" * "title" output.check
737 | new.ncblock
738 | crossref missing$
739 | { format.in.ed.booktitle "booktitle" output.check
740 | address empty$
741 | { organization publisher new.sentence.checkb
742 | organization output
743 | format.date "year" output.check
744 | }
745 | { address output.nonnull
746 | format.date "year" output.check
747 | organization output
748 | }
749 | if$
750 | format.bvolume output
751 | format.number.series output
752 | format.pages output
753 | publisher output
754 | }
755 | { format.incoll.inproc.crossref output.nonnull
756 | format.pages output
757 | }
758 | if$
759 | new.block
760 | note output
761 | fin.entry
762 | }
763 |
764 | FUNCTION {conference} { inproceedings }
765 |
766 | FUNCTION {manual}
767 | { output.bibitem
768 | author empty$
769 | { organization empty$
770 | 'skip$
771 | { organization output.nonnull
772 | address output
773 | }
774 | if$
775 | }
776 | { format.authors output.nonnull }
777 | if$
778 | new.block
779 | format.btitle "title" output.check
780 | author empty$
781 | { organization empty$
782 | { address new.block.checka
783 | address output
784 | }
785 | 'skip$
786 | if$
787 | }
788 | { organization address new.block.checkb
789 | organization output
790 | address output
791 | }
792 | if$
793 | format.edition output
794 | format.date output
795 | new.block
796 | note output
797 | fin.entry
798 | }
799 |
800 | FUNCTION {mastersthesis}
801 | { output.bibitem
802 | format.authors "author" output.check
803 | new.block
804 | format.title ",''" * "title" output.check
805 | new.ncblock
806 | "M.S. thesis" format.thesis.type output.nonnull
807 | school "school" output.check
808 | address output
809 | format.date "year" output.check
810 | new.block
811 | note output
812 | fin.entry
813 | }
814 |
815 | FUNCTION {misc}
816 | { output.bibitem
817 | format.authors output
818 | title howpublished new.block.checkb
819 | format.title ",''" * output
820 | new.nccont
821 | howpublished new.block.checka
822 | howpublished output
823 | format.date output
824 | new.block
825 | note output
826 | fin.entry
827 | empty.misc.check
828 | }
829 |
830 | FUNCTION {phdthesis}
831 | { output.bibitem
832 | format.authors "author" output.check
833 | new.block
834 | format.btitle "title" output.check
835 | new.block
836 | "Ph.D. thesis" format.thesis.type output.nonnull
837 | school "school" output.check
838 | address output
839 | format.date "year" output.check
840 | new.block
841 | note output
842 | fin.entry
843 | }
844 |
845 | FUNCTION {proceedings}
846 | { output.bibitem
847 | editor empty$
848 | { organization output }
849 | { format.editors output.nonnull }
850 | if$
851 | new.block
852 | format.btitle "title" output.check
853 | format.bvolume output
854 | format.number.series output
855 | address empty$
856 | { editor empty$
857 | { publisher new.sentence.checka }
858 | { organization publisher new.sentence.checkb
859 | organization output
860 | }
861 | if$
862 | publisher output
863 | format.date "year" output.check
864 | }
865 | { address output.nonnull
866 | format.date "year" output.check
867 | new.sentence
868 | editor empty$
869 | 'skip$
870 | { organization output }
871 | if$
872 | publisher output
873 | }
874 | if$
875 | new.block
876 | note output
877 | fin.entry
878 | }
879 |
880 | FUNCTION {techreport}
881 | { output.bibitem
882 | format.authors "author" output.check
883 | new.block
884 | format.title ",''" * "title" output.check
885 | new.ncblock
886 | format.tr.number output.nonnull
887 | institution "institution" output.check
888 | address output
889 | format.date "year" output.check
890 | new.block
891 | note output
892 | fin.entry
893 | }
894 |
895 | FUNCTION {unpublished}
896 | { output.bibitem
897 | format.authors "author" output.check
898 | new.block
899 | format.title ",''" * "title" output.check
900 | new.ncblock
901 | note "note" output.check
902 | format.date output
903 | fin.entry
904 | }
905 |
906 | FUNCTION {default.type} { misc }
907 |
908 | MACRO {jan} {"Jan."}
909 |
910 | MACRO {feb} {"Feb."}
911 |
912 | MACRO {mar} {"Mar."}
913 |
914 | MACRO {apr} {"Apr."}
915 |
916 | MACRO {may} {"May"}
917 |
918 | MACRO {jun} {"June"}
919 |
920 | MACRO {jul} {"July"}
921 |
922 | MACRO {aug} {"Aug."}
923 |
924 | MACRO {sep} {"Sept."}
925 |
926 | MACRO {oct} {"Oct."}
927 |
928 | MACRO {nov} {"Nov."}
929 |
930 | MACRO {dec} {"Dec."}
931 |
932 | MACRO {acmcs} {"ACM Computing Surveys"}
933 |
934 | MACRO {acta} {"Acta Informatica"}
935 |
936 | MACRO {cacm} {"Communications of the ACM"}
937 |
938 | MACRO {ibmjrd} {"IBM Journal of Research and Development"}
939 |
940 | MACRO {ibmsj} {"IBM Systems Journal"}
941 |
942 | MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
943 |
944 | MACRO {ieeetc} {"IEEE Transactions on Computers"}
945 |
946 | MACRO {ieeetcad}
947 | {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
948 |
949 | MACRO {ipl} {"Information Processing Letters"}
950 |
951 | MACRO {jacm} {"Journal of the ACM"}
952 |
953 | MACRO {jcss} {"Journal of Computer and System Sciences"}
954 |
955 | MACRO {scp} {"Science of Computer Programming"}
956 |
957 | MACRO {sicomp} {"SIAM Journal on Computing"}
958 |
959 | MACRO {tocs} {"ACM Transactions on Computer Systems"}
960 |
961 | MACRO {tods} {"ACM Transactions on Database Systems"}
962 |
963 | MACRO {tog} {"ACM Transactions on Graphics"}
964 |
965 | MACRO {toms} {"ACM Transactions on Mathematical Software"}
966 |
967 | MACRO {toois} {"ACM Transactions on Office Information Systems"}
968 |
969 | MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
970 |
971 | MACRO {tcs} {"Theoretical Computer Science"}
972 |
973 | READ
974 |
975 | STRINGS { longest.label }
976 |
977 | INTEGERS { number.label longest.label.width }
978 |
979 | FUNCTION {initialize.longest.label}
980 | { "" 'longest.label :=
981 | #1 'number.label :=
982 | #0 'longest.label.width :=
983 | }
984 |
985 | FUNCTION {longest.label.pass}
986 | { number.label int.to.str$ 'label :=
987 | number.label #1 + 'number.label :=
988 | label width$ longest.label.width >
989 | { label 'longest.label :=
990 | label width$ 'longest.label.width :=
991 | }
992 | 'skip$
993 | if$
994 | }
995 |
996 | EXECUTE {initialize.longest.label}
997 |
998 | ITERATE {longest.label.pass}
999 |
1000 | FUNCTION {begin.bib}
1001 | { preamble$ empty$
1002 | 'skip$
1003 | { preamble$ write$ newline$ }
1004 | if$
1005 | "\begin{thebibliography}{" longest.label * "}" * write$ newline$
1006 | }
1007 |
1008 | EXECUTE {begin.bib}
1009 |
1010 | EXECUTE {init.state.consts}
1011 |
1012 | ITERATE {call.type$}
1013 |
1014 | FUNCTION {end.bib}
1015 | { newline$
1016 | "\end{thebibliography}" write$ newline$
1017 | }
1018 |
1019 | EXECUTE {end.bib}
1020 |
1021 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%% End of IEEE.bst %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1022 |
--------------------------------------------------------------------------------
/JS.tex:
--------------------------------------------------------------------------------
1 | \section{Javascript API}\label{app:jsapi}
2 |
3 | The JavaScript API provides a consistent API across multiple scenarios including each of the clients' web-based in-process \DH{}App frameworks and the out-of-process RPC-based infrastructure. All key access takes places though the special \texttt{eth} object, part of the global namespace.
4 |
5 | \subsection{Values}
6 | There are no special object types in the API; all values are strings. As strings, values may be of several forms, and are interpreted by the API according to a series of rules:
7 |
8 | \begin{enumerate}
9 | \item If the string contains only digits from 0-9, then it is interpreted as a decimal integer;
10 | \item if the string begins with the characters \texttt{0x}, then it is interpreted as a hexadecimal integer;
11 | \item it is interpreted as a binary string otherwise.
12 | \end{enumerate}
13 |
14 | The only exception to this are for parameters that expect a binary string; in this case the string is always interpreted as such.
15 |
16 | Values are implicitly converted between integers and hashes/byte-arrays; when this happens, integers are interpreted as big-endian as is standard for Ethereum. The following forms are allowed; they are all interpreted in the same way:
17 |
18 | \begin{enumerate}
19 | \item \texttt{"4276803"}
20 | \item \texttt{"0x414243"}
21 | \item \texttt{"ABC"}
22 | \end{enumerate}
23 |
24 | In each case, they are interpreted as the number 4276803. The first two values may be alternated between with the additional String methods \texttt{bin()} and \texttt{unbin()}.
25 |
26 | As byte arrays, values may be concatenated with the \texttt{+} operator as is normal for strings.
27 |
28 | Strings also have a number of additional methods to help with conversion and alignment when switching between addresses, 256-bit integers and free-form byte-arrays for transaction data:
29 |
30 | \begin{itemize}
31 | \item \texttt{bin()}: Converts the string to binary format.
32 | \item \texttt{pad(l)}: Converts the string to binary format (ready for data parameters) and pads with zeroes until it is of width \texttt{l}. Will pad to the left if the original string is numeric, or to the right if binary. If \texttt{l} is less than the width of the string, it is resized accordingly.
33 | \item \texttt{pad(a, b)}: Converts the string to binary format (ready for data parameters) and pads with zeroes on the left size until it is of width \texttt{a}. Then pads with zeroes on the right side until it has grown to size \texttt{b}. If \texttt{b} is less hat the width of the string, it is resized accordingly.
34 | \item \texttt{unbin()}: Converts the string from binary format to hex format.
35 | \item \texttt{unpad()}: Converts the string from binary format to hex format, first removing any zeroes from the right side.
36 | \item \texttt{dec()}: Converts the string to decimal format (typically from hex).
37 | \end{itemize}
38 |
39 | \subsection{The \texttt{eth} object}
40 |
41 | \subsubsection{Properties}
42 |
43 | For each such item, there is also an asynchronous method, taking a parameter of the callback function, itself taking a single parameter of the property's return value and of the same name but prefixed with get and recapitalised, e.g. \texttt{getCoinbase(fn)}.
44 |
45 | \begin{itemize}
46 | \item \texttt{coinbase} Returns the coinbase address of the client.
47 | \item \texttt{isListening} Returns true if and only if the client is actively listening for network connections.
48 | \item \texttt{isMining} Returns true if and only if the client is actively mining new blocks.
49 | \item \texttt{gasPrice} Returns the client's present price of gas.
50 | \item \texttt{key} Returns the special key-pair object corresponding to the preferred account owned by the client.
51 | \item \texttt{keys} Returns a list of the special key-pair objects corresponding to all accounts owned by the client.
52 | \item \texttt{peerCount} Returns the number of peers currently connected to the client.
53 | \end{itemize}
54 |
55 | \subsubsection{Synchronous Getters}
56 | For each such item, there is also an asynchronous method, taking an additional parameter of the callback function, itself taking a single parameter of the synchronous method's return value and of the same name but prefixed with get and recapitalised, e.g. \texttt{getBalanceAt(a, fn)}.
57 |
58 | \begin{itemize}
59 | \item \texttt{balanceAt(a)} Returns the balance of the account of address given by the address \texttt{a}.
60 | \item \texttt{storageAt(a, x)} Returns the value in storage at position given by the number x of the account of address given by the address \texttt{a}.
61 | \item \texttt{txCountAt(a)} Returns the number of transactions send from the account of address given by \texttt{a}.
62 | \item \texttt{isContractAt(a)} Returns true if the account of address given by \texttt{a} has associated code.
63 | \end{itemize}
64 |
65 | \subsubsection{Transactions}
66 |
67 | \begin{itemize}
68 | \item \texttt{create(sec, xEndowment, bCode, xGas, xGasPrice, fn)} Creates a new contract-creation transaction, given parameters:
69 | \begin{itemize}
70 | \item \texttt{sec}, the secret-key for the sender;
71 | \item \texttt{xEndowment}, the number equal to the account's endowment;
72 | \item \texttt{bCode}, the binary string (byte array) of EVM-bytecode for the initialisation of the account;
73 | \item \texttt{xGas}, the number equal to the amount of gas to purchase for the transaction (unused gas is refunded);
74 | \item \texttt{xGasPrice}, the number equal to the price of gas for this transaction. Returns the special address object representing the new account; and
75 | \item \texttt{fn}, the callback function, called on completion of the transaction.
76 | \end{itemize}
77 | \item \texttt{transact(sec, xValue, aDest, bData, xGas, xGasPrice, fn)} Creates a new message-call transaction, given parameters:
78 | \begin{itemize}
79 | \item \texttt{sec}, the secret-key for the sender;
80 | \item \texttt{xValue}, the value transferred for the transaction (in Wei);
81 | \item \texttt{aDest}, the address representing the destination address of the message;
82 | \item \texttt{bData}, the binary string (byte array), containing the associated data of the message;
83 | \item \texttt{xGas}, the amount of gas to purchase for the transaction (unused gas is refunded);
84 | \item \texttt{xGasPrice}, the price of gas for this transaction; and
85 | \item \texttt{fn}, the callback function, called on completion of the transaction.
86 | \end{itemize}
87 | \end{itemize}
88 |
89 | \subsubsection{Events}
90 |
91 | \begin{itemize}
92 | \item \texttt{watch(a, fn)}: Registers \texttt{fn} as a callback for whenever anything about the state of the account at address \texttt{a} changes, and also on the initial load.
93 | \item \texttt{watch(a, x, fn)}: Registers \texttt{fn} as a callback for whenever the storage location \texttt{x} of the account at address \texttt{a} changes, and also on the initial load.
94 | \item \texttt{newBlock(fn)}: Registers \texttt{fn} as a callback for whenever the state changes, and also on the initial load.
95 | \end{itemize}
96 |
97 | \subsubsection{Misc}
98 |
99 | \begin{itemize}
100 | \item \texttt{secretToAddress(a)}: Determines the address from the secret key \texttt{a}.
101 | \end{itemize}
102 |
103 |
--------------------------------------------------------------------------------
/Paper.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuange1024/ethereum_yellowpaper/c0ca7d5180e63768b7100f7329bda7bf289d3c05/Paper.pdf
--------------------------------------------------------------------------------
/Paper.reflib:
--------------------------------------------------------------------------------
1 |
2 |
3 | Biblio.bib
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | cryptoeprint:2013:881
12 |
13 | Misc
14 |
15 | Accelerating Bitcoin’s Transaction Processing. Fast Money Grows on Trees, Not Chains
16 | Sompolinsky, Yonatan and Zohar, Aviv
17 |
18 |
19 |
20 |
21 | 2013
22 | http://eprint.iacr.org/
23 | Cryptology ePrint Archive, Report 2013/881
24 |
25 |
26 |
27 |
28 | gura2004comparing
29 |
30 | InCollection
31 |
32 | Comparing elliptic curve cryptography and RSA on 8-bit CPUs
33 | Gura, Nils and Patel, Arun and Wander, Arvinderpal and Eberle, Hans and Shantz, Sheueling Chang
34 |
35 |
36 |
37 | 119-132
38 | 2004
39 | Cryptographic Hardware and Embedded Systems-CHES 2004
40 | Springer
41 |
42 |
43 |
44 |
45 | laurie2004proof
46 |
47 | InProceedings
48 |
49 | Proof-of-Work” proves not to work; version 0.2
50 | Laurie, Ben and Clayton, Richard
51 |
52 |
53 |
54 |
55 | 2004
56 | Workshop on Economics and Information, Security
57 |
58 |
59 |
60 |
61 | nakamoto2008bitcoin
62 |
63 | Article
64 |
65 | Bitcoin: A peer-to-peer electronic cash system
66 | Nakamoto, Satoshi
67 | Consulted
68 | 1
69 |
70 | 2012
71 | 2008
72 |
73 |
74 |
75 |
76 | sprankel2013technical
77 |
78 | Misc
79 |
80 | Technical Basis of Digital Currencies
81 | Sprankel, Simon
82 |
83 |
84 |
85 |
86 | 2013
87 |
88 |
89 |
90 |
91 | aron2012bitcoin
92 |
93 | Article
94 |
95 | BitCoin software finds new life
96 | Aron, Jacob
97 | New Scientist
98 | 213
99 | 2847
100 | 20
101 | 2012
102 | Elsevier
103 |
104 |
105 |
106 |
107 | mastercoin2013willett
108 |
109 | article
110 |
111 | MasterCoin Complete Specification
112 | J. R. Willett
113 |
114 |
115 |
116 |
117 | 2013
118 | https://github.com/mastercoin-MSC/spec
119 |
120 |
121 |
122 |
123 | colouredcoins2012rosenfeld
124 |
125 | article
126 |
127 | Overview of Colored Coins
128 | Meni Rosenfeld
129 |
130 |
131 |
132 |
133 | 2012
134 | https://bitcoil.co.il/BitcoinX.pdf
135 |
136 |
137 |
138 |
139 | boutellier2014pirates
140 |
141 | incollection
142 |
143 | Pirates, Pioneers, Innovators and Imitators
144 | Boutellier, Roman and Heinzen, Mareike
145 |
146 |
147 |
148 | 85-96
149 | 2014
150 | Growth Through Innovation
151 | Springer
152 |
153 |
154 |
155 |
156 | szabo1997formalizing
157 |
158 | Article
159 |
160 | Formalizing and securing relationships on public networks
161 | Szabo, Nick
162 | First Monday
163 | 2
164 | 9
165 |
166 | 1997
167 |
168 |
169 |
170 |
171 | miller1997future
172 |
173 | InProceedings
174 |
175 | The Future of Law
176 | Miller, Mark
177 |
178 |
179 |
180 |
181 | 1997
182 | paper delivered at the Extro 3 Conference (August 9)
183 |
184 |
185 |
186 |
187 | buterin2013ethereum
188 |
189 | article
190 |
191 | Ethereum: A Next-Generation Smart Contract and Decentralized Application Platform
192 | Vitalik Buterin
193 |
194 |
195 |
196 |
197 | 2013
198 | http://ethereum.org/ethereum.html
199 |
200 |
201 |
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Ethereum Yellow Paper 以太坊黄皮书
2 |
3 | [](https://creativecommons.org/licenses/by-sa/4.0/)
4 | [](https://gitter.im/ethereum/yellowpaper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
5 |
6 | The Yellow Paper is a formal definition of the Ethereum protocol, originally by Gavin Wood, currently maintained by Nick Savers and with contributions from many people around the world.
7 |
8 | It is free culture work, licensed under the Creative Commons Attribution Share-Alike (CC-BY-SA) version 4.0.
9 |
10 |
11 | 以太坊白皮书概要性地介绍了以太坊,以太坊黄皮书通过大量的定义和公式详细地描述了以太坊的技术实现。
12 |
13 | # 各个语言版本
14 | - [English Version](https://github.com/ethereum/yellowpaper) originally by Gavin Wood, currently maintained by Nick Savers and with contributions from many people around the world.
15 | - [中文版](https://github.com/yuange1024/ethereum_yellowpaper/blob/master/ethereum_yellow_paper_cn.pdf) 由万山、高天露 和 riversyang 联合翻译。
16 | - [French Version](https://github.com/asseth/yellowpaper) translated by Asseth (checkout to branch 'french' ).
17 |
--------------------------------------------------------------------------------
/Wire.tex:
--------------------------------------------------------------------------------
1 | \section{Wire Protocol}\label{app:wire}
2 | The wire-protocol specifies a network-level protocol for how two peers can communicate. It includes handshake procedures and the means for transferring information such as peers, blocks and transactions. Peer-to-peer communications between nodes running Ethereum clients are designed to be governed by a simple wire-protocol making use of existing Ethereum technologies and standards such as RLP wherever practical.
3 |
4 | Ethereum nodes may connect to each other over TCP only. Peers are free to advertise and accept connections on any port(s) they wish, however, a default port on which the connection may be listened and made will be 30303.
5 |
6 | Though TCP provides a connection-oriented medium, Ethereum nodes communicate in terms of packets. These packets are formed as a 4-byte synchronisation token (0x22400891), a 4-byte "payload size", to be interpreted as a big-endian integer and finally an N-byte \textbf{RLP-serialised} data structure, where N is the aforementioned "payload size". To be clear, the payload size specifies the number of bytes in the packet ''following'' the first 8.
7 |
8 | There are a number of different types of message that may be sent. This ``type'' is always determined by the first entry of the structure, represented as a scalar. The structure of each message type is described below.
9 |
10 | \begin{tabular*}{\columnwidth}[h]{rlll}
11 | \toprule
12 | \multicolumn{4}{c}{\textbf{00s: Session control}} \vspace{5pt} \\
13 | \textbf{Value} & \textbf{Mnemonic} & \textbf{Expected Reply} & \textbf{Packet Format} \vspace{5pt} \\
14 | 0x00 & \textsc{Hello} & & $(\text{0x}00, v \in \mathbb{P}, n \in \mathbb{P}, \mathbf{i} \in \mathbb{B}, c \in \mathbb{P}, p \in \mathbb{P}, u \in \mathbb{B}_{64})$ \\
15 | & \multicolumn{3}{p{0.8\columnwidth}}{
16 | This is the first packet sent over the connection, and sent once by both sides. No other messages may be sent until a \textsc{Hello} is received.
17 | \begin{itemize}
18 | \item $v$ is the Protocol Version. See the latest documentation for which version is current.
19 | \item $n$ is the Network Id should be 0.
20 | \item $\mathbf{i}$ is the Client Id and specifies the client software identity as a human-readable string (e.g. ``Ethereum(++)/1.0.0'').
21 | \item $c$ is the client's Capabilities and specifies the capabilities of the client as a set of flags; presently three bits are used:
22 | \begin{description}
23 | \item[0x01] Client provides peer discovery service;
24 | \item[0x02] Client provides transaction relaying service;
25 | \item[0x04] Client provides block-chain querying service.
26 | \end{description}
27 | \item $p$ is the Listen Port and specifies the port that the client is listening on (on the interface that the present connection traverses). If 0 it indicates the client is not listening.
28 | \item $u$ is the Unique Identity of the node and specifies a 512-bit hash that identifies this node.
29 | \end{itemize}
30 | }\\
31 | \midrule
32 | 0x01 & \textsc{Disconnect} && $(\text{0x}01, r \in \mathbb{P})$ \\
33 | & \multicolumn{3}{p{0.8\columnwidth}}{
34 | Inform the peer that a disconnection is imminent; if received, a peer should disconnect immediately. When sending, well-behaved hosts give their peers a fighting chance (read: wait 2 seconds) to disconnect to before disconnecting themselves.
35 | \begin{itemize}
36 | \item $r$ is an integer specifying one of a number of reasons for disconnect:
37 | \begin{description}
38 | \item[0x00] Disconnect requested;
39 | \item[0x01] TCP sub-system error;
40 | \item[0x02] Bad protocol;
41 | \item[0x03] Useless peer;
42 | \item[0x04] Too many peers;
43 | \item[0x05] Already connected;
44 | \item[0x06] Incompatible network protocols;
45 | \item[0x07] Client quitting.
46 | \end{description}
47 | \end{itemize}
48 | }\\
49 | \midrule
50 | 0x02 & \textsc{Ping} & \textsc{Pong} & $(\text{0x}02)$ \\
51 | & \multicolumn{3}{p{0.8\columnwidth}}{Requests an immediate reply of \textsc{Pong} from the peer.}\\
52 | \midrule
53 | 0x03 & \textsc{Pong} && $(\text{0x}03)$ \\
54 | & \multicolumn{3}{p{0.8\columnwidth}}{Reply to peer's \textsc{Ping} packet.}\\
55 | \bottomrule
56 | \end{tabular*}
57 |
58 |
59 | \begin{tabular*}{\columnwidth}[h]{rlll}
60 | \toprule
61 | \multicolumn{4}{c}{\textbf{10s: Information}} \vspace{5pt} \\
62 | \textbf{Value} & \textbf{Mnemonic} & \textbf{Expected Reply} & \textbf{Packet Format} \vspace{5pt} \\
63 | 0x10 & \textsc{GetPeers} & \textsc{Peers} & $(\text{0x}10)$ \\
64 | & \multicolumn{3}{p{0.8\columnwidth}}{Request the peer to enumerate some known peers for us to connect to. This should include the peer itself.}\\
65 | \midrule
66 | 0x11 & \textsc{Peers} & & $(\text{0x}11, (a_0 \in \mathbb{B}_4, p_0 \in \mathbb{P}, i_0 \in \mathbb{B}_{64}), (a_1 \in \mathbb{B}_4, p_1 \in \mathbb{P}, i_1 \in \mathbb{B}_{64}), ...)$ \\
67 | & \multicolumn{3}{p{0.8\columnwidth}}{
68 | Specifies a number of known peers.
69 | \begin{itemize}
70 | \item $a_0$, $a_1$, ... is the node's IPv4 address, a 4-byte array that should be interpreted as the IP address $a_0[0]$.$a_0[1]$.$a_0[2]$.$a_0[3]$.
71 | \item $p_0$, $p_1$, ... is the node's Port and is an integer.
72 | \item $i_0$, $i_1$, ... is the node's Unique Identifier and is the 512-bit hash that serves to identify the node.
73 | \end{itemize}
74 | }\\
75 | \midrule
76 | 0x12 & \textsc{Transactions} & & $(\text{0x}12, L_T(T_0), L_T(T_1), ...)$ \\
77 | & \multicolumn{3}{p{0.8\columnwidth}}{
78 | where $L_T$ is the transaction preparation function, as specified in section \ref{ch:block}.
79 |
80 | Specify a transaction or transactions that the peer should make sure is included on its transaction queue. The items in the list (following the first item 0x12) are transactions in the format described in the main Ethereum specification.
81 | \begin{itemize}
82 | \item $T_0$, $T_1$, ... are the transactions that should be assimilated.
83 | \end{itemize}
84 | }\\
85 | \midrule
86 | 0x13 & \textsc{Blocks} && $(\text{0x}13, L_B(b_0), L_B(b_1), ...)$ \\
87 | & \multicolumn{3}{p{0.8\columnwidth}}{
88 | Where $L_B$ is the block preparation function, as specified in section \ref{ch:block}.
89 |
90 | Specify a block or blocks that the peer should know about. The items in the list (following the first item, 0x13) are blocks as described in the format described in the main specification.
91 | \begin{itemize}
92 | \item $b_0$, $b_1$, ... are the blocks that should be assimilated.
93 | \end{itemize}
94 | }\\
95 | \midrule
96 | 0x14 & \textsc{GetChain} & \textsc{Blocks} or \textsc{NotInChain} & $(\text{0x}14, p_0 \in \mathbb{B}_{32}, p_1 \in \mathbb{B}_{32}, ..., c \in \mathbb{P})$ \\
97 | & \multicolumn{3}{p{0.8\columnwidth}}{
98 | Request the peer to send $c$ blocks in the current canonical block chain that are children of one of a number of given blocks, according to a preferential order with $p_0$ being the most prefered. If the designated parent is the present block chain head, an empty reply should be sent. If none of the parents are in the current canonical block chain, then a NotInChain message should be sent along with $p_n$, the least preferential parent. If no parents are passed, then a reply need not be made.
99 | \begin{itemize}
100 | \item $p_0$, $p_1$, ... are the SHA3 hashes of the parents of blocks that we should be informed of with a \textsc{Blocks} reply. Typically, these will be specified in increasing age (or decreasing block number).
101 | \item $c$ is the number of children blocks of the most preferred parent that we should be informed of through the corresponding \textsc{Blocks} reply.
102 | \end{itemize}
103 | }\\
104 | \midrule
105 | 0x15 & \textsc{NotInChain} && $(\text{0x}15, p \in \mathbb{B}_{32})$ \\
106 | & \multicolumn{3}{p{0.8\columnwidth}}{Inform the peer that a particular block was not found in its block chain.
107 | \begin{itemize}
108 | \item $p$ is the SHA3 hash of the block that was not found in the block chain. Typically, this will be the least preferential (oldest) block hash given in a previous \textsc{GetChain} message.
109 | \end{itemize}
110 | }\\
111 | \midrule
112 | 0x16 & \textsc{GetTransactions} & \textsc{Transactions} & $(\text{0x}16)$ \\
113 | & \multicolumn{3}{p{0.8\columnwidth}}{Request the peer to send all transactions currently in the queue. See \textsc{Transactions}.}\\
114 | \bottomrule
115 | \end{tabular*}
116 |
117 |
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | if [ -d ".git" ]; then
6 |
7 | SHA=`git rev-parse --short --verify HEAD`
8 | DATE=`git show -s --format="%cd" --date=short HEAD`
9 | REV="$SHA - $DATE"
10 |
11 | else
12 |
13 | REV="unknown revision"
14 |
15 | fi
16 |
17 | echo "\newcommand{\YellowPaperVersionNumber}{$REV}" > Version.tex
18 |
19 | pdflatex -interaction=errorstopmode -halt-on-error Paper.tex && \
20 | bibtex Paper && \
21 | pdflatex -interaction=errorstopmode -halt-on-error Paper.tex && \
22 | pdflatex -interaction=errorstopmode -halt-on-error Paper.tex && \
23 | pdflatex -interaction=errorstopmode -halt-on-error Paper.tex
24 |
--------------------------------------------------------------------------------
/build_ethereum_yellow_paper_cn.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | rm -rf Options.tex
6 |
7 | if [ -d ".git" ]; then
8 |
9 | SHA=`git rev-parse --short --verify HEAD`
10 | DATE=`git show -s --format="%cd" --date=short HEAD`
11 | # REV="$SHA - $DATE"
12 | # chinese version's origin version
13 | REV="f72032b - 2022-06-05"
14 | echo "\def\YellowPaperVersionNumber{$REV}" >> Options.tex
15 |
16 | fi
17 |
18 |
19 | if [ "$1" == "white" ]; then
20 |
21 | echo "\definecolor{pagecolor}{rgb}{1,1,1}" >> Options.tex
22 |
23 | fi
24 |
25 | echo "\newcommand{\YellowPaperVersionNumber}{$REV}" > Version.tex
26 |
27 |
28 | xelatex -interaction=errorstopmode -halt-on-error ethereum_yellow_paper_cn.tex && \
29 | bibtex ethereum_yellow_paper_cn && \
30 | xelatex -interaction=errorstopmode -halt-on-error ethereum_yellow_paper_cn.tex && \
31 | xelatex -interaction=errorstopmode -halt-on-error ethereum_yellow_paper_cn.tex && \
32 | xelatex -interaction=errorstopmode -halt-on-error ethereum_yellow_paper_cn.tex && \
33 | rm -rf Options.tex
34 |
35 |
--------------------------------------------------------------------------------
/cancel.sty:
--------------------------------------------------------------------------------
1 | % cancel.sty version 2.2 12-Apr-2013.
2 | % Donald Arseneau asnd@triumf.ca
3 | % This software is contributed to the public domain by its author,
4 | % who disclaims all copyrights. For people and jurisdictions that
5 | % do not recognize contribution to the public domain, this software
6 | % is licensed by the terms of the unlicense, .
7 | %
8 | % Commands:
9 | % ~~~~~~~~~
10 | % \cancel draws a diagonal line (slash) through its argument.
11 | % \bcancel uses the negative slope (a backslash).
12 | % \xcancel draws an X (actually \cancel plus \bcancel).
13 | % \cancelto{}{} draws a diagonal arrow through the
14 | % expression, pointing to the value.
15 | %
16 | % The first three work in math and text mode, but \cancelto is only
17 | % for math mode.
18 | % The slope of the line or arrow depends on what is being cancelled.
19 | %
20 | % Options:
21 | % ~~~~~~~~
22 | % By default, none of these commands affects the horizontal spacing,
23 | % so they might over-print neighboring parts of the formula (or text).
24 | % They do add their height to the expression, so there should never be
25 | % unintended vertical overlap. There is a package option [makeroom] to
26 | % increase the horizontal spacing to make room for the cancellation value.
27 | %
28 | % If you use the color package, then you can declare
29 | % \renewcommand{\CancelColor}{}
30 | % and the cancellation marks will be printed in that color (e.g., \blue).
31 | % However, if you are using color, I recommend lightly shaded blocks rather
32 | % than diagonal arrows for cancelling.
33 | %
34 | % The option [thicklines] asks for heavier lines and arrows. This may be
35 | % useful when the lines are colored a light shade.
36 | %
37 | % The size (math style) of the \cancelto value depends on package options
38 | % according to this table:
39 | %
40 | % Current style [samesize] [smaller] [Smaller]
41 | % ------------- ---------------- ---------------- ----------------
42 | % \displaystyle \displaystyle \textstyle \scriptstyle
43 | % \textstyle \textstyle \scriptstyle \scriptstyle
44 | % \scriptstyle \scriptstyle \scriptscriptstyle \scriptscriptstyle
45 | % \scriptscriptstyle \scriptscriptstyle \scriptscriptstyle \scriptscriptstyle
46 | %
47 | % ("smaller" is the default behavior. It gives textstyle limits in
48 | % displaystyle, whereas "Smaller" gives scriptstyle limits.)
49 | %
50 | % This package is provided without guarantees or support. Drawing slashes
51 | % through math to indicate "cancellation" is poor design. I don't recommend
52 | % that you use this package at all.
53 |
54 | \ProvidesPackage{cancel}[2013/04/12 v2.2 Cancel math terms]
55 |
56 | \newcommand{\CancelColor}{}
57 | \newcommand{\cancelto}{1}% default option = smaller
58 | \let\canto@fil\hidewidth
59 | \let\canc@thinlines\thinlines
60 |
61 | \DeclareOption{samesize}{\def\cancelto{999}}
62 | \DeclareOption{smaller}{\def\cancelto{1}}
63 | \DeclareOption{Smaller}{\def\cancelto{0}}
64 | \DeclareOption{makeroom}{\def\canto@fil{\hfil}}
65 | \DeclareOption{overlap}{\let\canto@fil\hidewidth}
66 | \DeclareOption{thicklines}{\let\canc@thinlines\thicklines}
67 |
68 | \ProcessOptions
69 |
70 | \DeclareRobustCommand\cancel[1]{\ifmmode
71 | \mathpalette{\@cancel{\@can@slash{}}}{#1}\else
72 | \@cancel{\@can@slash{}}\hbox{#1}\fi}
73 | \DeclareRobustCommand\bcancel[1]{\ifmmode
74 | \mathpalette{\@cancel{\@can@slash{-}}}{#1}\else
75 | \@cancel{\@can@slash{-}}\hbox{#1}\fi}
76 | \DeclareRobustCommand\xcancel[1]{\ifmmode
77 | \mathpalette{\@cancel{\@can@slash{+}\@can@slash{-}}}{#1}\else
78 | \@cancel{\@can@slash{+}\@can@slash{-}}\hbox{#1}\fi}
79 |
80 | \newcommand\@cancel[3]{%
81 | \OriginalPictureCmds\@begin@tempboxa\hbox{\m@th$#2{#3}$}%
82 | \dimen@\height
83 | \setbox\@tempboxa\hbox{$\m@th\vcenter{\box\@tempboxa}$}%
84 | \advance\dimen@-\height % the difference in height
85 | \unitlength\p@ \canc@thinlines
86 | {\/\raise\dimen@\hbox{\ooalign{#1\hfil\box\@tempboxa\hfil \cr}}}%
87 | \@end@tempboxa
88 | }
89 |
90 | \def\@can@slash#1{\canto@fil$\m@th \CancelColor\vcenter{\hbox{%
91 | \dimen@\width \@min@pt\dimen@ 2\@min@pt\totalheight6%
92 | \ifdim\totalheight<\dimen@ % wide
93 | \@min@pt\dimen@ 8%
94 | \@tempcnta\totalheight \multiply\@tempcnta 5 \divide\@tempcnta\dimen@
95 | \advance\dimen@ 2\p@ % "+2"
96 | \edef\@tempa{(\ifcase\@tempcnta 6,#11\or 4,#11\or 2,#11\or 4,#13\else 1,#11\fi
97 | ){\strip@pt\dimen@}}%
98 | \else % tall
99 | \@min@pt\totalheight8%
100 | \advance\totalheight2\p@ % "+2"
101 | \@tempcnta\dimen@ \multiply\@tempcnta 5 \divide\@tempcnta\totalheight
102 | \dimen@ \ifcase\@tempcnta .16\or .25\or .5\or .75\else 1\fi \totalheight
103 | \edef\@tempa{(\ifcase\@tempcnta 1,#16\or 1,#14\or 1,#12\or 3,#14\else 1,#11\fi
104 | ){\strip@pt\dimen@}}%
105 | \fi
106 | \expandafter\line\@tempa}}$\canto@fil \cr}
107 |
108 | \ifcase\cancelto
109 | \def\cancelto#1#2{\mathchoice % Smaller option
110 | {\@cancelto\scriptstyle{#1}\displaystyle{#2}}%
111 | {\@cancelto\scriptstyle{#1}\textstyle{#2}}%
112 | {\@cancelto\scriptscriptstyle{#1}\scriptstyle{#2}}%
113 | {\@cancelto\scriptscriptstyle{#1}\scriptscriptstyle{#2}}%
114 | }
115 | \or
116 | \def\cancelto#1#2{\mathchoice % smaller option (default)
117 | {\@cancelto\textstyle{#1}\displaystyle{#2}}%
118 | {\@cancelto\scriptstyle{#1}\textstyle{#2}}%
119 | {\@cancelto\scriptscriptstyle{#1}\scriptstyle{#2}}%
120 | {\@cancelto\scriptscriptstyle{#1}\scriptscriptstyle{#2}}%
121 | }
122 | \else
123 | \def\cancelto#1#2{\mathchoice % samesize option
124 | {\@cancelto\textstyle{#1}\displaystyle{#2}}%
125 | {\@cancelto\textstyle{#1}\textstyle{#2}}%
126 | {\@cancelto\scriptstyle{#1}\scriptstyle{#2}}%
127 | {\@cancelto\scriptscriptstyle{#1}\scriptscriptstyle{#2}}%
128 | }
129 | \fi
130 |
131 | \newcommand\@cancelto[4]{%
132 | \OriginalPictureCmds\@begin@tempboxa\hbox{\m@th$#3{#4}$}%
133 | \dimen@\width % wide
134 | \@min@pt\dimen@ 2\@min@pt\totalheight4
135 | \ifdim\totalheight<\dimen@
136 | \@tempcnta\totalheight \multiply\@tempcnta 5 \divide\@tempcnta\dimen@
137 | \@tempdimb 3\p@ % extra width for arrowhead ("+2")
138 | \advance\dimen@ \ifcase\@tempcnta 5\or 5\or 4\or 3\else 2\fi \p@
139 | \@min@pt\dimen@9\advance\dimen@\p@
140 | \edef\@tempa{\ifcase\@tempcnta 5441\or 5441\or 5421\or 4443\else 3611\fi
141 | {\strip@pt\dimen@}{\strip@pt\@tempdimb}}%
142 | \def\@tempb{Cancel #4 to #2; case wide }%
143 | \else % tall
144 | \advance\totalheight3\p@ % "+2"
145 | \@tempcnta\dimen@ \multiply\@tempcnta 5 \divide\@tempcnta\totalheight
146 | \advance\totalheight3\p@ % "+2"
147 | \dimen@ \ifcase\@tempcnta .25\or .25\or .5\or .75\else 1\fi \totalheight
148 | \@tempdimb \ifcase\@tempcnta .8\or .8\or 1.2\or 1.5\else 2\fi \p@
149 | \edef\@tempa{\ifcase\@tempcnta 0814\or 0814\or 1812\or 2734\else 3611\fi
150 | {\strip@pt\dimen@}{\strip@pt\@tempdimb}}%
151 | \fi
152 | \dimen@\height
153 | \setbox\@tempboxa\hbox{$\m@th\vcenter{\box\@tempboxa}$}%
154 | \advance\dimen@-\height % the difference in height
155 | \unitlength\p@ \canc@thinlines
156 | {\/\raise\dimen@\hbox{\expandafter\canto@vector\@tempa{#1}{#2}}}%
157 | \@end@tempboxa
158 | }
159 |
160 | % #1, #2 offset of label #6 extra width to clear arrowhead
161 | % #3, #4 vector direction #7 superscript label style
162 | % #5 vector width #8 superscript label
163 | \def\canto@vector#1#2#3#4#5#6#7#8{%
164 | \dimen@.5\p@
165 | \setbox\z@\vbox{\boxmaxdepth.5\p@
166 | \hbox{\kern-1.2\p@\kern#1\dimen@$#7{#8}\m@th$}}%
167 | \ifx\canto@fil\hidewidth \wd\z@\z@ \else \kern-#6\unitlength \fi
168 | \ooalign{%
169 | \canto@fil$\m@th \CancelColor
170 | \vcenter{\hbox{\dimen@#6\unitlength \kern\dimen@
171 | \multiply\dimen@#4\divide\dimen@#3 \vrule\@depth\dimen@\@width\z@
172 | \vector(#3,#4){#5}%
173 | }}^{\raise#2\dimen@\copy\z@\kern-\scriptspace}$%
174 | \canto@fil \cr
175 | \hfil \box\@tempboxa \kern\wd\z@ \hfil \cr}}
176 |
177 | \def\@min@pt#1#2{\ifdim#1<#2\p@ #1#2\p@ \relax\fi}
178 |
179 | % pict2e removes bounding box from line and vector, so use original
180 | % versions by declaring \OriginalPictureCmds; make it a no-op if undefined
181 |
182 | \@ifundefined{OriginalPictureCmds}{\let\OriginalPictureCmds\relax}{}
183 |
184 | % Sometime maybe find a better solution that uses all slopes with pict2e
185 |
--------------------------------------------------------------------------------
/deploykey.enc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuange1024/ethereum_yellowpaper/c0ca7d5180e63768b7100f7329bda7bf289d3c05/deploykey.enc
--------------------------------------------------------------------------------
/ethereum_yellow_paper_cn.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuange1024/ethereum_yellowpaper/c0ca7d5180e63768b7100f7329bda7bf289d3c05/ethereum_yellow_paper_cn.pdf
--------------------------------------------------------------------------------
/ethereum_yellow_paper_cn.reflib:
--------------------------------------------------------------------------------
1 |
2 |
3 | Biblio.bib
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | cryptoeprint:2013:881
12 |
13 | Misc
14 |
15 | Accelerating Bitcoin’s Transaction Processing. Fast Money Grows on Trees, Not Chains
16 | Sompolinsky, Yonatan and Zohar, Aviv
17 |
18 |
19 |
20 |
21 | 2013
22 | http://eprint.iacr.org/
23 | Cryptology ePrint Archive, Report 2013/881
24 |
25 |
26 |
27 |
28 | gura2004comparing
29 |
30 | InCollection
31 |
32 | Comparing elliptic curve cryptography and RSA on 8-bit CPUs
33 | Gura, Nils and Patel, Arun and Wander, Arvinderpal and Eberle, Hans and Shantz, Sheueling Chang
34 |
35 |
36 |
37 | 119-132
38 | 2004
39 | Cryptographic Hardware and Embedded Systems-CHES 2004
40 | Springer
41 |
42 |
43 |
44 |
45 | laurie2004proof
46 |
47 | InProceedings
48 |
49 | Proof-of-Work” proves not to work; version 0.2
50 | Laurie, Ben and Clayton, Richard
51 |
52 |
53 |
54 |
55 | 2004
56 | Workshop on Economics and Information, Security
57 |
58 |
59 |
60 |
61 | nakamoto2008bitcoin
62 |
63 | Article
64 |
65 | Bitcoin: A peer-to-peer electronic cash system
66 | Nakamoto, Satoshi
67 | Consulted
68 | 1
69 |
70 | 2012
71 | 2008
72 |
73 |
74 |
75 |
76 | sprankel2013technical
77 |
78 | Misc
79 |
80 | Technical Basis of Digital Currencies
81 | Sprankel, Simon
82 |
83 |
84 |
85 |
86 | 2013
87 |
88 |
89 |
90 |
91 | aron2012bitcoin
92 |
93 | Article
94 |
95 | BitCoin software finds new life
96 | Aron, Jacob
97 | New Scientist
98 | 213
99 | 2847
100 | 20
101 | 2012
102 | Elsevier
103 |
104 |
105 |
106 |
107 | mastercoin2013willett
108 |
109 | article
110 |
111 | MasterCoin Complete Specification
112 | J. R. Willett
113 |
114 |
115 |
116 |
117 | 2013
118 | https://github.com/mastercoin-MSC/spec
119 |
120 |
121 |
122 |
123 | colouredcoins2012rosenfeld
124 |
125 | article
126 |
127 | Overview of Colored Coins
128 | Meni Rosenfeld
129 |
130 |
131 |
132 |
133 | 2012
134 | https://bitcoil.co.il/BitcoinX.pdf
135 |
136 |
137 |
138 |
139 | boutellier2014pirates
140 |
141 | incollection
142 |
143 | Pirates, Pioneers, Innovators and Imitators
144 | Boutellier, Roman and Heinzen, Mareike
145 |
146 |
147 |
148 | 85-96
149 | 2014
150 | Growth Through Innovation
151 | Springer
152 |
153 |
154 |
155 |
156 | szabo1997formalizing
157 |
158 | Article
159 |
160 | Formalizing and securing relationships on public networks
161 | Szabo, Nick
162 | First Monday
163 | 2
164 | 9
165 |
166 | 1997
167 |
168 |
169 |
170 |
171 | miller1997future
172 |
173 | InProceedings
174 |
175 | The Future of Law
176 | Miller, Mark
177 |
178 |
179 |
180 |
181 | 1997
182 | paper delivered at the Extro 3 Conference (August 9)
183 |
184 |
185 |
186 |
187 | buterin2013ethereum
188 |
189 | article
190 |
191 | Ethereum: A Next-Generation Smart Contract and Decentralized Application Platform
192 | Vitalik Buterin
193 |
194 |
195 |
196 |
197 | 2013
198 | http://ethereum.org/ethereum.html
199 |
200 |
201 |
202 |
--------------------------------------------------------------------------------
/revision_note/f72032b_2018-05-04.md:
--------------------------------------------------------------------------------
1 |
2 | ## 校订说明(f72032b 2018-05-04)
3 |
4 | ### 根据最新英文版本的内容更新/追加
5 |
6 | 根据最新的拜占庭版本黄皮书原文进行译文比对,补全/更新所有原文中修订的部分,增加相应的译文或根据原文修改已有译文。(比如 4.3.4 节中增加的一整段对冰河期协议修改的相关叙述以及在交易收据定义中增加了状态代码字段等等。)
7 |
8 | ### 原译文勘误。
9 |
10 | 根据原文对先前的译文全文进行校订,改正先前译文中的理解错误/翻译偏差。
11 |
12 | 这里仅举两例说明:
13 |
14 | 第一例、原文中 4.3 节最后,``The other two components in the block are simply a list of ommer block headers (of the same format as above), BU and a series of the transactions, BT. ``
15 |
16 | 这句话,先前的译文译为:``此外, 当前区块还记录着这个区块的交易列表, 以及 2 个 叔链 (ommer) 的区块头列表。 ``
17 |
18 | 这是明显的错误。已改为:``区块的另两个组成部分就是 ommer 区块头(与以上格式相同)列表 BU 和一系列的交易 BT。 ``
19 |
20 | 第二例、原文第 7 章开始部分,``Note we use one fewer than the sender’s nonce value; we assert that we have incremented the sender account’s nonce prior to this call, and so the value used is the sender’s nonce at the beginning of the responsible transaction or VM operation. ``
21 |
22 | 这句话,先前的译文译为:``注 意, 我们使用的是一个比发送者随机数要小的值;我们断言 会在在这个合约创建是前会增加发送者账户的随机数,因 此在刚开始在交易或 VM 操作中使用的随机数就是发送者 的随机数。 ``
23 |
24 | 这也是明显把原文的意思理解错了,已改为:``注意, 我们使用的是一个比发送者 nonce 要小的值(减了 1);因 为我们认定我们已经在这个调用之前对发送者的 nonce 加 了 1,并且在一个可靠的交易执行或 VM 操作开始时也会 对发送者的 nonce 加 1。 ``
25 |
26 | 原文中类似的插入语、同位语结构很多,先前的译文中还有一些对修饰关系理解错误,或对实际意义理解错误的例子,这里就不一一列举了。
27 |
28 | ### 译文的整体润色
29 |
30 | 对中文译文进行了整体润色。原先的译文中经常会缺少连接词、副词,读起来不够通顺;另外有些语句沿用英文的倒装语序,中文读起来也很拗口;我都相应做了优化和调整。
31 |
32 | ### 部分术语的译法异议
33 |
34 | 对于两个关键的术语 nonce 和 gas,我选择全文没有翻译。因为 nonce 实际上仅在区块头数据中与 mixHash 一起作为工作量证明数据时,才是所谓的随机数;在其他大部分情况中,比如在账户状态、交易数据中,nonce 并不是随机数,而是一个逻辑上确定的值。这个词的本意是一次性使用的数值,我认为全文译为随机数是不对的。所以全部保留了原文,这样,结合具体的译文就不会有理解误差。而对于 gas,我个人认为还是不要译,因为其实译为汽油、燃料甚至气都是可以的,但用在中文句子中会有些直观上的歧义,用英文术语会更准确和专业。
35 |
36 | 在其他的部分技术性描述语句中使用的账户状态、交易数据、区块头里的字段名术语时,我也选择了不翻译,这样会更准确。
37 |
38 | ### 译文格式统一
39 |
40 | 先前译文中的标点符号使用混乱,有很多英文标点混在中文中,这次的校订对此做了统一,包括一些空格的添加。
41 | 这部分格式统一,参考的是 sparanoid 中文译文排版说明:https://github.com/sparanoid/chinese-copywriting-guidelines
42 |
43 | ### 原译文中引用标记的追加
44 |
45 | 新版黄皮书的附录结构做了一些调整和内容增加,正文中也修改了很多引用,这次的校订也对中文版中的这些地方做了统一更新。
46 |
47 | ### 工程文件更新
48 |
49 | 更新了 bib 文件;更新了中文版编译的 sh 文件。删除了编译临时文件,并更新了 gitignore。
50 |
51 |
--------------------------------------------------------------------------------
/travis_deploy.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | set -e
4 |
5 | SHA=`git rev-parse --verify HEAD`
6 |
7 | git config user.name "$COMMIT_AUTHOR"
8 | git config user.email "$COMMIT_AUTHOR_EMAIL"
9 | git checkout --orphan gh-pages
10 | git rm --cached -r .
11 | echo "# Automatic build" > README.md
12 | echo "Built pdf from \`$SHA\`. See https://github.com/ethereum/yellowpaper/ for details." >> README.md
13 | echo "The generated pdf is here: https://ethereum.github.io/yellowpaper/paper.pdf" >> README.md
14 | echo '' > index.html
15 | mv Paper.pdf paper.pdf
16 | git add -f README.md index.html paper.pdf
17 | git commit -m "Built pdf from {$SHA}."
18 |
19 | ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
20 | ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
21 | ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
22 | ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
23 | openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in deploykey.enc -out deploykey -d
24 | chmod 600 deploykey
25 | eval `ssh-agent -s`
26 | ssh-add deploykey
27 |
28 | git push -f "$PUSH_REPO" gh-pages
29 |
--------------------------------------------------------------------------------