├── README.md
├── Biblio.bib
├── JS.tex
├── Paper.reflib
├── Wire.tex
├── cancel.sty
└── IEEEbib.bst
/README.md:
--------------------------------------------------------------------------------
1 | # yellowpaper
2 |
3 | [](https://gitter.im/ethereum/yellowpaper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4 |
5 | The paper comes as a single ``latex`` file ``Paper.tex``. The latest version is generally available as a PDF at http://paper.gavwood.com .
6 |
7 | It can be viewed in ``PDF`` format with ``pdflatex Paper.tex`` (local install of a current free tex distribution required).
8 |
9 | After creating ``Paper.pdf`` for the first time and every time the bibliography file (``Biblio.bib``) is updated, you will also need to run ``bibtex Paper`` and then ``pdflater Paper`` twice (e.g. ``bibtex Paper && pdflatex Paper && pdflatex Paper``) in order to correctly incorporate all the bibliography references.
10 |
11 | There are also some online tools like http://latex.informatik.uni-halle.de/latex-online/latex.php you can use for
12 | compiling/preview.
13 |
14 |
--------------------------------------------------------------------------------
/Biblio.bib:
--------------------------------------------------------------------------------
1 | @Misc{cryptoeprint:2013:881,
2 | Note = {{http://eprint.iacr.org/}},
3 | Url = {{Cryptology ePrint Archive, Report 2013/881}},
4 | author = {Sompolinsky, Yonatan and Zohar, Aviv},
5 | title = {{Accelerating Bitcoin{'}s Transaction Processing. Fast Money Grows on Trees, Not Chains}},
6 | year = {{2013}},
7 | }
8 |
9 | @InCollection{gura2004comparing,
10 | BookTitle = {{Cryptographic Hardware and Embedded Systems-CHES 2004}},
11 | Publisher = {{Springer}},
12 | author = {Gura, Nils and Patel, Arun and Wander, Arvinderpal and Eberle, Hans and Shantz, Sheueling Chang},
13 | title = {{Comparing elliptic curve cryptography and RSA on 8-bit CPUs}},
14 | pages = {119-132},
15 | year = {{2004}},
16 | }
17 |
18 | @InProceedings{laurie2004proof,
19 | BookTitle = {{Workshop on Economics and Information, Security}},
20 | author = {Laurie, Ben and Clayton, Richard},
21 | title = {{Proof-of-Work{''} proves not to work; version 0.2}},
22 | year = {{2004}},
23 | }
24 |
25 | @Misc{vishnumurthy03karma:a,
26 | author = {Vivek Vishnumurthy and Sangeeth Chandrakumar and Emin Gün Sirer},
27 | title = {KARMA: A Secure Economic Framework for Peer-to-Peer Resource Sharing},
28 | year = {2003}
29 | }
30 |
31 | @InProceedings{dwork92pricingvia,
32 | author = {Cynthia Dwork and Moni Naor},
33 | title = {Pricing via processing or combatting junk mail},
34 | booktitle = {In 12th Annual International Cryptology Conference},
35 | year = {1992},
36 | pages = {139--147}
37 | }
38 |
39 | @Article{nakamoto2008bitcoin,
40 | author = {Nakamoto, Satoshi},
41 | title = {{Bitcoin: A peer-to-peer electronic cash system}},
42 | journal = {{Consulted}},
43 | volume = {{1}},
44 | pages = {2012},
45 | year = {{2008}},
46 | }
47 |
48 | @Misc{sprankel2013technical,
49 | author = {Sprankel, Simon},
50 | title = {{Technical Basis of Digital Currencies}},
51 | year = {{2013}},
52 | }
53 |
54 | @Article{aron2012bitcoin,
55 | Publisher = {{Elsevier}},
56 | author = {Aron, Jacob},
57 | title = {{BitCoin software finds new life}},
58 | journal = {{New Scientist}},
59 | volume = {{213}},
60 | number = {{2847}},
61 | pages = {20},
62 | year = {{2012}},
63 | }
64 |
65 | @article{mastercoin2013willett,
66 | url = {{https://github.com/mastercoin-MSC/spec}},
67 | author = {J. R. Willett},
68 | title = {{MasterCoin Complete Specification}},
69 | year = {{2013}},
70 | }
71 |
72 | @article{colouredcoins2012rosenfeld,
73 | url = {{https://bitcoil.co.il/BitcoinX.pdf}},
74 | author = {Meni Rosenfeld},
75 | title = {{Overview of Colored Coins}},
76 | year = {{2012}},
77 | }
78 |
79 | @incollection{boutellier2014pirates,
80 | booktitle = {{Growth Through Innovation}},
81 | publisher = {{Springer}},
82 | author = {Boutellier, Roman and Heinzen, Mareike},
83 | title = {{Pirates, Pioneers, Innovators and Imitators}},
84 | pages = {85-96},
85 | year = {{2014}},
86 | }
87 |
88 | @Article{szabo1997formalizing,
89 | author = {Szabo, Nick},
90 | title = {{Formalizing and securing relationships on public networks}},
91 | journal = {{First Monday}},
92 | volume = {{2}},
93 | number = {{9}},
94 | year = {{1997}},
95 | }
96 |
97 | @InProceedings{miller1997future,
98 | BookTitle = {{paper delivered at the Extro 3 Conference (August 9)}},
99 | author = {Miller, Mark},
100 | title = {{The Future of Law}},
101 | year = {{1997}},
102 | }
103 |
104 | @article{buterin2013ethereum,
105 | url = {{http://ethereum.org/ethereum.html}},
106 | author = {Vitalik Buterin},
107 | title = {{Ethereum: A Next-Generation Smart Contract and Decentralized Application Platform}},
108 | year = {{2013}},
109 | }
110 |
111 | @article{back2002hashcash,
112 | url = {{http://www.hashcash.org/papers/amortizable.pdf}},
113 | author = {Adam Back},
114 | title = {{Hashcash - Amortizable Publicly Auditable Cost-Functions}},
115 | year = {{2002}},
116 | }
117 |
118 | @article{hashimoto,
119 | url = {{https://mirrorx.com/files/hashimoto.pdf}},
120 | author = {Thaddeus Dryja},
121 | title = {{Hashimoto: I/O bound proof of work}},
122 | year = {{2014}},
123 | }
124 |
125 | @article{dagger,
126 | url = {{http://vitalik.ca/ethereum/dagger.html}},
127 | author = {Vitalik Buterin},
128 | title = {{Dagger: A Memory-Hard to Compute, Memory-Easy to Verify Scrypt Alternative}},
129 | year = {{2013}},
130 | }
131 |
132 | @article{lerner2014randmemohash,
133 | url = {{http://www.hashcash.org/papers/memohash.pdf}},
134 | author = {Sergio Demian Lerner},
135 | title = {{Strict Memory Hard Hashing Functions}},
136 | year = {{2014}},
137 | }
138 |
139 | @article{FowlerNollVo1991FNVHash,
140 | url = {{https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#cite_note-2}},
141 | author = {Glenn Fowler, Landon Curt Noll, Phong Vo},
142 | title = {{Fowler–Noll–Vo hash function}},
143 | year = {{1991}},
144 | }
--------------------------------------------------------------------------------
/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.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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------