The Bitcoin Backbone Protocol

Bitcoin is the first and most popular decentralized cryptocurrency to date. In this work, we
extract and analyze the core of the Bitcoin protocol, which we term the Bitcoin backbone, and
prove two of its fundamental properties which we call common prefix and chain quality in the
static setting where the number of players remains fixed. Our proofs hinge on appropriate and
novel assumptions on the “hashing power” of the adversary relative to network synchronicity;
we show our results to be tight under high synchronization.

The Bitcoin Backbone Protocol:

Analysis and Applications

Juan A. Garay Aggelos Kiayias Yahoo Research University of Edinburgh garay@yahoo-inc.com akiayias@inf.ed.ac.uk Nikos Leonardos National and Kapodistrian University of Athens. nikos.leonardos@gmail.com

November 22, 2016

Abstract Bitcoin is the first and most popular decentralized cryptocurrency to date. In this work, we extract and analyze the core of the Bitcoin protocol, which we term the Bitcoin backbone, and prove two of its fundamental properties which we call common prefix and chain quality in the static setting where the number of players remains fixed. Our proofs hinge on appropriate and novel assumptions on the hashing power of the adversary relative to network synchronicity; we show our results to be tight under high synchronization. Next, we propose and analyze applications that can be built on top of the backbone pro- tocol, specifically focusing on Byzantine agreement (BA) and on the notion of a public trans- action ledger. Regarding BA, we observe that Nakamotos suggestion falls short of solving it, and present a simple alternative which works assuming that the adversarys hashing power is bounded by 1/3. The public transaction ledger captures the essence of Bitcoins operation as a cryptocurrency, in the sense that it guarantees the liveness and persistence of committed transactions. Based on this notion we describe and analyze the Bitcoin system as well as a more elaborate BA protocol, proving them secure assuming high network synchronicity and that the adversarys hashing power is strictly less than 1/2, while the adversarial bound needed for security decreases as the network desynchronizes.

1 IntroductionBitcoin, introduced in [Nak08a], is a decentralized payment system that is based on maintaininga public transaction ledger in a distributed manner. The ledger is maintained by anonymous par-ticipants (players) called miners, executing a protocol that maintains and extends a distributeddata structure called the blockchain. The protocol requires from miners to solve a proof of work(POW, aka cryptographic puzzle see, e.g., [DN92, RSW96, Bac97, JB99]), which essentiallyamounts to brute-forcing a hash inequality based on SHA-256, in order to generate new blocksfor the blockchain. The blocks that comprise the blockchain contain sets of transactions that are

An abridged version of this paper appears in Proc. Eurocrypt 2015.

Research partly supported by ERC project CODAMODA, # 259152.

Work partly done while at the National and Kapodistrian University of Athens.

Work partly done while at LIAFA, Universit Paris DiderotParis 7.

1generated at will by owners of bitcoins, who issue transactions that credit any entity of their choicewho accepts payments in bitcoin. Payers broadcast transactions and miners include the transactionsthey receive into the blocks they generate. Miners are rewarded for maintaining the blockchain byreceiving bitcoins; it is in this manner bitcoins are created and distributed among the miners whoare the first recipients of newly minted bitcoins. An important concern in Bitcoin (or any e-payment system for that matter) is the prevention ofdouble-spending attacks. Specifically, in the context of Bitcoin, a double-spending attack can occurwhen the attacker initially credits an account, receives service or goods by the account holder, butthen manages to reorganize the transaction ledger so that the transaction that credits the accountholder is reverted. In this way, the attacker keeps her bitcoin while receiving services and thus sheis able to spend it again somewhere else. In [Nak08a], Nakamoto provides an initial set of arguments of why the Bitcoin system willprevent double-spending attacks. Specifically, he argues that if a payee waits for the transactionthat gives her credit to advance into the blockchain a number of k blocks, then the probabilitythat an attacker can build an alternative blockchain that reorganizes the public blockchain (whichcontains the credit transaction) drops exponentially with k. Nakamoto argues this by modeling theattacker and the set of honest players as two competing actors performing a random walk movingtoward a single direction with probabilistic steps. He demonstrates that the k blocks the payeewaits are enough to ensure a negligible (in k) probability of the attacker catching up with thehonest players. Nevertheless, the above analysis can be easily seen to be oversimplified: in particular, it does notaccount for the fact that in Bitcoins decentralized setting the attacker may attempt to introducedisagreement between the honest miners, thus splitting their hashing power on different POWinstances. Nakamoto himself appeared to recognize the relevance of agreement in the context ofBitcoin, arguing in a forum post [Nak08b] that actually Bitcoins basic concept of building andexchanging a blockchain is capable of solving Byzantine agreement (BA) [PSL80, LSP82] in thepresence of an actively malicious adversary.1 However a thorough analysis establishing the exactsecurity properties of the Bitcoin system has yet to appear.Our results. In this paper we extract, formally describe, and analyze the core of the Bitcoinprotocol. We call this protocol the Bitcoin backbone, as we describe it in a way that is versatile andextensible and can be used to solve other problems as well not just the problem of maintaininga public transaction ledger. The Bitcoin backbone protocol is executed by players that build ablockchain following the Bitcoin source code [Nak09] and allows a set of players to maintain ablockchain in a distributed fashion. The protocol is parameterized by three external functionsV (), I(), R() which we call the content validation predicate, the input contribution function, andthe chain reading function, respectively. At a high level, V () determines the proper structure of theinformation that is stored into the blockchain, I() specifies how the contents of the blocks are formedby the players, and R() determines how a blockchain is supposed to be interpreted in the contextof the application. Note that the structure, contents, and interpretation of the blockchain are notimportant for the description of the backbone protocol and are left to be specified by the threeexternal functions above, which are application-specific (we provide examples of these functions inSection 5). 1 In [Nak08b], Nakamoto refers to the problem as Byzantine Generals, which is often used to refer to the single-source version of the problem. Note that since more than one general may propose a time to attack this in fact isthe case where every party has an input value, i.e., Byzantine agreement. In fact, in an anonymous setting such asBitcoins, the single-source version is nonsensical. Note that in the traditional cryptographic setting, with trustedsetup, the two problems are not equivalent in terms of the number of tolerated misbehaving parties t (t < n vs.t < n/2, respectively).

2 We analyze the Bitcoin backbone protocol in a static setting when the participants operate ina synchronous communication network (more details below and in Section 2) in the presence ofan adversary that controls a subset of the players. We assume that the protocol is executed by afixed number n of players; note, however, that this number is not necessarily known to the protocolparticipants. The players themselves cannot authenticate each other and therefore there is no wayto know the source of a message; we capture this by allowing the adversary to spoof the sourceaddress of any message that is delivered. We assume that messages are eventually delivered and allparties in the network are able to synchronize in the course of a round. The notion of round isnot important for the description of the backbone protocol (which can also be executed in a looseand asynchronous fashion in the same way that Bitcoin works), however, it is important in termsof Bitcoins inherent computational assumption regarding the players ability to produce POWs. Specifically, we assume that in a single round, all parties involved are allowed the same numberof queries to a cryptographic hash function, as well as to communicate with the other participants.The hash function is modeled as a random oracle [BR93]. For simplicity we assume a flat model,where all parties have the same quota of hashing queries per round, say q; the non-flat model whereparties have differing hashing power capabilities can be easily captured by clustering the flat-modelparties into larger virtual entities that are comprised by more than one flat-model player. In factmining pools in Bitcoin can be thought of such aggregations of flat-model players. The adversaryitself represents such pool as it controls t < n players; for this reason, the adversarys quota perround is t q hashing queries. Note that in this setting, the fact t < n/2 directly correspondsto the adversary controlling strictly less than half of the systems total hashing power that allplayers collectively harness, thus, we will use terms such as honest majority and (1/2)-boundedadversary interchangeably. In our analysis of the Bitcoin backbone protocol we formalize and prove two fundamental prop-erties it possesses. The properties are quantified by three parameters , and f ; and roughlycorrespond to the collective hashing power per round of the honest players and the adversary, re-spectively, while f represents the expected number of POWs that may be found per round by theBitcoin network participants as a whole. The common prefix property. We prove that if > for some [1, ) that satisfies 2 f + 1 0, then the blockchains maintained by the honest players will possess a large common prefix. More specifically, if two honest parties prune (i.e., cut off) k blocks from the end of their local chains, the probability that the resulting pruned chains will not be mutual prefixes of each other drops exponentially in k (see Definition 3 for the precise formulation). Provided that f is very close to 0 this enables us to choose very close to 1 and thus establish the common prefix property as long as an honest majority of participants in the flat-model setting is guaranteed (equivalently, when the adversary controls strictly less than 50% of the hashing power). On the other hand, when the network desynchronizes and f gets closer to 1, achieving a common prefix requires , where is the golden ratio, which in turn suggests much stricter bounds on the adversarial behavior (in fact, the upper bound on the adversary for our analysis approaches 0). The chain-quality property. We prove that if > , for some [1, ), then the ratio of blocks in the chain of any honest player that are contributed by honest players is at least (1 1 ). Again observe that if is close to 1, we obtain that the blockchain maintained by honest players is guaranteed to have few, but still some, blocks contributed by honest players; a higher would be necessary to guarantee bigger percentages of blocks contributed by honest players in the blockchain. We also observe that this result is basically tight, i.e., that the adversary is capable of following a strategy (that deviates from the strategy of honest players) that enables

3Figure 1: An overview of the backbone protocols applications: Nakamotos BA protocol nak BA , our 1/3 1/2BA protocols BA and BA , and the public ledger protocol PL . All properties must be satisfiedwith overwhelming probability. In each box we state the name of the property as well as themaximum ratio of the adversarial hashing power that we can prove the protocol withstands (basedon the corresponding backbone property). The value stands for a negligible quantity.

the introduction of that many blocks in the blockchain, under a favorable (for the adversary) assumption on the propagation of adversarial blocks in the network. While the above two security properties may seem rather abstract since they refer to propertiesof the data structure that is maintained distributedly by the parties, we demonstrate that theyare in fact quite powerful and show that the Bitcoin backbone protocol armed with the aboveproperties can be used as a basis for solving other problems, including the problem of distributivelymaintaining a robust public transaction ledger. In Figure 1 we show how the two properties relateto the properties of the applications that are explained below and is provided in order to assist thereader in conceptualizing the logic behind the security proofs of the applications.Byzantine agreement for (1/3)-bounded adversaries. As a first application, we show how a ran-domized BA protocol can be built on top of the Bitcoin backbone protocol more or less directly,and based solely on the POW assumption. We instantiate the V (), I(), R() functions so thatparties form blockchains and act according to the following rules: each party i attempts to insertits own input vi {0, 1} into the blockchain; a blockchain is valid only if blocks contain elementsin {0, 1}; the protocol terminates when the blockchain has reached a sufficient length; and, theblockchain is read by the honest parties by pruning k elements from its end and returning the ma-jority bit appearing in the resulting blockchains prefix. We show how the common prefix propertyand the chain-quality property of the backbone protocol ensure Agreement and Validity (BAs basicproperties; see Section 2) with high probability, thus turning the Bitcoin backbone protocol into aprobabilistic BA protocol. Observe that for the above protocol to work the chain-quality property should ensure that amajority of blocks in the blockchain originate from the honest players (otherwise Validity is lost).Our chain quality property enables this with overwhelming probability assuming the adversarialpower is bounded by 1/3. This approach is different from Nakamotos proposal [Nak08b] for BA,which, as we also show, only guarantees Validity with overwhelming probability if the adversaryhas a negligible amount of hashing power. On the positive side, we stress that Nakamotos protocolfails gracefully when the adversarial power gets close to 50% as Validity can be shown with constantprobability (but not overwhelming).

4Public transaction ledgers and BA for honest majority. Next, we focus on how a robust publictransaction ledger can be built on top of the Bitcoin backbone. We instantiate the V (), I(), R()functions so that parties form blockchains and act according to the following rules: each party(which in this context is called a miner) receives a set S of transactions on its input tape andattempts to insert those in its blockchain, omitting any transactions in S that are already includedin it. (A Bitcoin transaction is, for example, a statement of the type account A credits accountB a z number of bitcoins, which is signed using the secret key that corresponds to account AsBitcoin address; each account has a unique Bitcoin address.) Reading a blockchain, on the otherhand, amounts to returning the total sequence of transactions that is contained in the blockchainof the miner (and note that miners may disagree about the chain they report). We show how the common prefix property and the chain-quality property ensure two propertiesneeded by the ledger, which we call Persistence and Liveness, assuming an honest majority andarbitrary adversarial behavior. Persistence states that once a transaction goes more than k blocksdeep into the blockchain of one honest player, then it will be included in every honest playersblockchain with overwhelming probability, and it will be assigned a permanent position in the ledger.On the other hand, Liveness says that all transactions originating from honest account holders willeventually end up at a depth more than k blocks in an honest players blockchain, and hence theadversary cannot perform a selective denial of service attack against honest account holders. Forboth properties to hold we require an honest majority (i.e., that the adversarys hashing poweris strictly less than 50%) assuming high network synchronicity (i.e., that the expected number ofPOW solutions per round satisfies2 f 0). If this is violated, Persistence requires stricter boundson adversarial hashing power in order to be preserved following the bounds of the common prefixproperty. In the context of Bitcoin, our analysis implies that the Bitcoin backbone provides an operationaltransaction ledger under the assumptions: (i) the adversary controls less than half of the totalhashing power, and (ii) the network synchronizes much faster relative to the POW solution rate,(iii) digital signatures cannot be forged. On the other hand, when the network desynchronizes ourresults cannot support that the ledger is maintained by assuming an honest majority. This negativeresult is consistent with the experimental analysis provided by Decker and Wattenhoffer [DW13],who predicted a drop below 50% in the required adversarial bound for any setting when informationpropagation is problematic. Our result also provides some justification for the slow rate of 10-minute increments used in Bitcoin block generation. Specifically, information propagation in theBitcoin network is on the order of seconds3 so the ratio (essentially f ) of this time window overthe average 10-minute period is reasonably close to small and thus transaction persistence canbe shown for roughly an honest majority. On the other hand, cryptocurrencies including Litecoin,Primecoin and others, reacting to the demand to offer faster transaction processing, opted for afaster response rate (some as small as 1 minute), which results in more precarious situations, e.g.,f > 0.1, which is far from being negligible and thus cannot support our analysis that a commonprefix would be guaranteed by merely assuming an honest majority. We finally note that thePersistence and Liveness properties we put forth and prove should not be interpreted as proofsthat all Bitcoins objectives are met. In particular, they do not guarantee that miners are properlyincentivized to carry out the backbone protocol, and they can only offer guarantees in a setting ofan honest majority amongst a fixed number of players as opposed to a setting where there is anever changing population of parties acting rationally; see related work below as well as Section 7for further discussion. 2 Note that we use the notation f 0 to mean that f is close to 0 since f will be a constant in our analysis. 3 See, for example, http://bitcoinstats.com/network/propagation/.

5 Finally, we present a BA protocol assuming an honest majority, by suitably exploiting theproperties of the robust transaction ledger above. The protocol substitutes Bitcoins transactionswith a type of transactions that are themselves based on POWs, and hence uses POWs in twodistinct ways: for the maintenance of the ledger and for the generation of the transactions. Weshow that the ledgers Persistence implies Agreement, and that Liveness implies Validity, becauseassuming the ledger is maintained for long enough, a majority of transactions originating fromthe honest parties will be included (despite the fact that honest parties may control a minority ofblocks in the blockchain). The protocol requires special care in the way it employs POWs since theadversary should be incapable of shifting work between the two POW tasks that it faces in eachround. To solve this problem, we introduce a special strategy for POW-based protocol compositionwhich we call 2-for-1 POWs.Related work. Realizing a digital currency with a centralized entity but while achieving strongprivacy was proposed early on by Chaum in [Cha82]. A number of other works improved variousaspects of this concept, however the approach remained centralized. Nakamoto [Nak08a] proposedthe first decentralized currency system based on POWs while relaxing the anonymity property ofthe payment system to mere pseudonymity. This work was followed by a multitude of other relatedproposals including Litecoin4 , Primecoin [Kin13], and Zerocash [BSCG+ 14], to mention a few. Ouranalysis of the Bitcoin backbone covers all these works as well, since they are based on exactly thesame protocol. It is interesting to juxtapose our positive results to the results of Eyal and Sirer [ES14], whointroduce an attack strategy called selfish mining that shows how the number of blocks contributedto the blockchain by an adversary can exceed the percentage of the hashing power the adversarypossesses. Their results are consistent and complementary to ours. The crux of the issue is (inour terminology) in terms of the chain-quality property, as its formulation is quite permissive: inparticular we show that if the adversary controls a suitably bounded amount of hashing power,then it is also suitably bounded in terms of the number of blocks it has managed to insert inthe blockchain that honest players maintain. Specifically, recall that we prove that if the hashingpower of the adversary satisfies < 1 (where roughly corresponds to the hashing power of thehonest players), then the adversary may control at most a 1 percentage of the blocks in the chain.For instance, if the adversary controls up to 1/3 of the hashing power (i.e., = 2), then it willprovably control less than 50% of the blocks in the honest players blockchain. As it can be easilyseen, this does not guarantee that the rate of a partys hashing power translates to an equal rateof rewards (recall that in Bitcoin the rewards are linearly proportional to the number of blocksthat a party contributes in the chain). We define as ideal chain quality the property that for anycoalition of parties (following any mining strategy) the percentage of blocks in the blockchain isexactly proportional to their collective hashing power. The chain quality property that we prove isnot ideal and the results of [ES14] show that in fact there is a strategy that magnifies the percentageof a malicious coalition. Still, their mining attack does much worse than our bound. To close thegap, we sketch (cf. Remark 6) a simple selfish mining strategy that matches our upper bound andhence our chain quality result is tight in our model5 assuming the number of honest parties is large. Byzantine agreement (BA, aka distributed consensus) [PSL80, LSP82] considers a set of n partiesconnected by reliable and authenticated pair-wise communication links and with possible conflictinginitial inputs that wish to agree on a common output in the presence of the disruptive (evenmalicious) behavior of some of them. The problem has received a considerable amount of attention 4 http://www.litecoin.com. 5 Our model allows the unfavorable event of adversarial messages winning all head-to-head races in terms of deliverywith honestly generated messages in any given round.

6under various models. In this paper we are interested in randomized solutions to the problem (e.g.,[BO83, Rab83, BG93, FM97, FG03, KK09])6 as in the particular setting we are in, deterministic BAalgorithms are not possible. In more detail, we consider BA in the anonymous synchronous setting,i.e., when processors do not have identifiers and cannot correlate messages to their sources, evenacross rounds, and, further, there is no trusted setup. This model for BA was considered by Okun,who classified it as anonymous model without port awareness, and proved the aforementionedimpossibility result, that deterministic algorithms are impossible for even a single failure [Oku05b,Oku05a]. In addition, Okun showed that probabilistic BA is feasible by suitably adapting Ben-Orsprotocol [BO83] for the standard, non-anonymous setting (cf. [Oku05b])7 ; the protocol, however,takes exponentially many rounds. It turns out that by additionally assuming that the parties areport-aware (i.e., they can correlate messages to sources across rounds), deterministic protocols arepossible and some more efficient solutions were proposed in [OB08]. The anonymous synchronous setting was also considered by Aspnes et al. [AJK05] who pointedto the potential usefulness of proofs of work (e.g., [DN92, RSW96, Bac97, JB99]) as an identityassignment tool, in such a way that the number of identities assigned to the honest and adversarialparties can be made proportional to their aggregate computational power, respectively. For example,by assuming that the adversarys computational power is less than 50%, one of the algorithmsin [AJK05] results in a number of adversarial identities less than half of that obtained by the honestparties. By running this procedure in a pre-processing stage, it is then suggested that a standardauthenticated BA protocol could be run. Such protocols, however, would require the establishmentof a consistent PKI (as well as of digital signatures), details of which are not laid out in [AJK05]. In contrast, and as mentioned above, building on our analysis of the Bitcoin backbone protocol,we propose two BA protocols solely based on POWs that operate in O(k) rounds with error prob-ability e(k) . The protocols solve BA with overwhelming probability under the assumption thatthe adversary controls less than 1/3 and 1/2 of the computational power, respectively. The connection between Bitcoin and probabilistic BA was also considered by Miller and LaViolain [ML14] where they take a different approach compared to ours, by not formalizing how Bitcoinworks, but rather only focusing on Nakamotos suggestion for BA [Nak08b] as a standalone protocol.As we observe here, and also recognized in [ML14], Nakamotos protocol does not quite solve BAsince it does not satisfy Validity with overwhelming probability. The exact repercussions of thisfact are left open in [ML14], while with our analysis, we provide explicit answers regarding thetransaction ledgers actual properties and the level of security that the backbone realization canoffer. Finally, related to the anonymous setting, the feasibility of secure computation without authenti-cated links was considered by Barak et al. in [BCL+ 11] in a more extreme model where all messagessent by the parties are controlled by the adversary and can be tampered with and modified (i.e., notonly source addresses can be spoofed, but also messages contents can be altered and messagesmay not be delivered). It is shown in [BCL+ 11] that it is possible to limit the adversary so that allhe can do is to partition the network into disjoint sets, where in each set the computation is secure,and also independent of the computation in the other sets. Evidently, in such system, one cannothope to build a global ledger.Organization of the paper. The rest of the paper is organized as follows. In Section 2 we presentour model within which we formally express the Bitcoin backbone protocol and prove its basic 6 We remark that, in contrast to the approach used in typical randomized solutions to the problem, where achievingBA is reduced to (the construction of) a shared random coin, the probabilistic aspect here stems from the parties like-lihood of being able to provide proofs of work. In addition, as our analysis relies on the random oracle model [BR93],we are interested in computational/cryptographic solutions to the problem. 7 Hence, BA in this setting shares a similar profile with BA in the asynchronous setting [FLP85].

7properties. The backbone protocol builds blockchains based on a cryptographic hash function;we introduce notation for this data structure as well as the backbone protocol itself in Section 3,followed by its analysis in Section 4. Sections 5 and 6 are dedicated to the applications built ontop of the backbone protocol (simple) BA protocols and robust transaction ledger, respectively.Specifically, Section 5 covers Nakamotos (insufficient) suggestion for BA as well as our solutionfor 1/3 adversarial power, while in Section 6 we present our treatment of a robust public ledgerformalizing the properties of Persistence and Liveness and how they apply to Bitcoin. Finally, wealso include in this section our BA protocol for 1/2 adversarial power. Some directions for futureresearch are offered in Section 7.

2 Model and Definitions

In this section we define our notion of protocol execution and provide a definition of Byzantine agree-ment in our model. We will describe and analyze our protocols in a multiparty setting that employselements from previous formulations of secure multiparty computation (specifically, Canettis for-mulation of real world execution as in [Can00a] and [Can00b, Can01]). We adopt the notation anddefinitions of [Can00b, Can01] while we also employ ideas regarding the formulation of synchronous,proceeding in rounds, multiparty computation from [KMTZ13].Programs involved in a protocol execution. The execution of a protocol is driven by anenvironment program Z that may spawn multiple instances running the protocol . The programsin question can be thought of as interactive Turing machines (ITM) that have communication,input and output tapes. An instance of an ITM running a certain program will be referred to asan interactive Turing machine instance or ITI. The spawning of new ITIs by an existing ITI aswell as the interaction between them is at the discretion of a control program which is also an ITMand is denoted by C. The pair (Z, C) is called a system of ITMs, cf. [Can00b]. As in this latterpaper we will be restricting our exposition to locally polynomial-bounded systems of ITMs whichensures a polynomial-time execution overall [Can00b, Proposition 3]. Moreover, we will be using amore stringent control program C that will be forcing the environment to perform a round-robinparticipant execution sequence for a fixed set of parties. Specifically, the execution driven by Z is defined with respect to a protocol , an adversary A(also an ITM) and a set of parties P1 , . . . , Pn ; these are hardcoded in the control program C. Theprotocol is defined in a hybrid setting and has access to two ideal functionalities, which aretwo other ITMs to be defined below, called the random oracle and the diffusion channel. They areused as subroutines by the programs involved in the execution (the ITIs of and A) and they areaccessible by all parties once they are spawned. Initially, the environment Z is restricted by C to spawn the adversary A. Each time theadversary is activated, it may send one or more messages of the form (Corrupt, Pi ) to C. The controlprogram C will register party Pi as corrupted, only provided that the environment has previouslygiven an input of the form (Corrupt, Pi ) to A and that the number of corrupted parties is less orequal t, a bound that is also hardcoded in C. The first ITI party to be spawned running protocol is restricted by C to be party P1 . After a party Pi is activated, the environment is restricted toactivate party Pi+1 , except when Pn is activated in which case the next ITI to be activated is alwaysthe adversary A. Note that when a corrupted party Pi is activated the adversary A is activatedinstead.Communication and hashing power. We describe next the two functionalities that are ac-cessible to the parties. These functionalities will reflect the parties ability (i) to communicate witheach other and (ii) to calculate values of a hash function H() : {0, 1} {0, 1} concurrently. We

8note that they share a state and thus they can be viewed as a single functionality, nevertheless it isconvenient to describe them as separate entities.

The random oracle (RO) functionality. When queried by honest party Pi with a value x marked for calculation for the function H(), assuming x has not been queried before, it returns a value y which is selected at random from {0, 1} ; furthermore, it stores the pair (x, y) in the table of H(). Each honest party Pi is allowed to ask q queries in each round as determined by the diffuse functionality (see below). On the other hand, each honest party is given unlimited queries for verification for the function H(). In a similar vein, the adversary A is given t0 q queries in each round as determined by the diffuse functionality where t0 is the number of corrupted parties. No verification queries are provided to A. Note that q is a function of , the security parameter. We note that the functionality may maintain tables for functions other than H() as well (for instance, in our protocol descriptions, we will utilise a function G()), but, by convention the functionality will impose query quotas to function H() only.

The diffuse functionality. Initially, the functionality sets a variable round to be 1. It also maintains a Receive() string defined for each party Pi . A party is allowed at any moment to fetch the contents of its personal Receive() string. Moreover, when the functionality receives an instruction to diffuse a message m from party Pi it marks the party as complete for the current round; note that m is allowed to be empty. At any moment, the adversary A is allowed to receive the contents of all messages for the round and specify the contents of the Receive() string for each party Pi . The adversary has to specify when it is complete for the current round. When all parties are complete for the current round, the functionality inspects the contents of all Receive() strings and includes any messages m that were diffused by the parties in the current round but not contributed by the adversary to the Receive() tapes. The variable round is then incremented.

We note that by adopting the resource bounded computation modeling of systems of ITMs by[Can00b, Can01] we obviate the need of imposing a strict upper bound on the number of messagesthat may be transmitted by the adversary in each activation. In our setting, honest parties, atthe discretion of the environment, are given sufficient time to process all messages delivered via thediffuse functionality including all messages that are injected by the adversary. This is also facilitatedby the fact that the q bound that is imposed on queries to H() is not imposed for hash verification(with foresight, the q-bound will be only imposed for hash computations during the proof of workstage of the protocol). Note that the above formulation also reflects the fact that the communication graph is not fullyconnected and messages are delivered through diffusion, a communication means that reflectsBitcoins peer-to-peer structure. As evidenced by the above, our adversarial model in the networkis adaptive, meaning that the adversary is allowed to take control of parties on the fly, andrushing, meaning that in any given round the adversary gets to see all honest players messagesbefore deciding his strategy, and, furthermore, there is no definite source information that can beguaranteed for each delivered message. Note that the adversary cannot change the contents of themessages sent by honest parties nor prevent them from being delivered as restricted by the diffusefunctionality. Effectively, this parallels communication over TCP/IP in the Internet where messagesbetween parties are delivered reliably, but nevertheless malicious parties may spoof the source of amessage they transmit and make it appear as originating from an arbitrary party (including anotherhonest party) in the view of the receiver. Note that the adversary is permitted to abuse the diffusion

9mechanism and attempt to confuse honest parties by sending and delivering inconsistent messagesto them (thus diffuse does not constitute a reliable broadcast).8 The parties inputs are provided by the environment Z which also receives the parties outputs.Parties that receive no input from the environment remain inactive, in the sense that they willnot act when their turn comes in each round. The environment activates parties in each round bywriting to their input tape. Note that C forces the environment to give all parties an activation inround-robin fashion. In our exposition we will denote by Input() the input tape of each party.The q-bounded synchronous setting. Based on the above, we can now use the notation{exect,n ,A,Z (z)}z{0,1} to denote the random variable ensemble that determines the output of theenvironment Z on input z for a protocol that uses the two functionalities of random oracleand diffuse (we will only be concerned with such protocols). Moreover, we will use the notation{viewP,t,n ,A,Z (z)}z{0,1} to denote the random variable ensemble describing the view of party P af-ter the completion of an execution with environment Z, running protocol , and adversary A, onauxiliary input z {0, 1} . In our exposition we are concerned with a stand-alone execution of and thus we will considerz to be fixed to 1 for N. For this reason we will simply refer to the ensemble by viewP,t,n ,A,Z .If n parties P1 , . . . , Pn execute , the concatenation of the view of all parties hviewP,A,Z i ,t,n ii=1,...,n t,nis denoted by view,A,Z . With foresight, we note that, in contrast to the standard setting whereparties are aware of the number of parties executing the protocol, we are interested in protocols that do not make explicit use of the number of parties n or their identities. Further, notethat because of the unauthenticated nature of the communication model the parties may never becertain about the number of participants in a protocol execution. Nonetheless note that the numberof parties is fixed during the course of the protocol execution, as this is hardcoded in the controlprogram C. The parties limited ability to produce POWs is reflected in the limit imposed to all parties intheir access of the function H(). Parties are allowed to perform a number of queries q per round. Weremark that this is a flat-model interpretation of the parties computation power, where all partiesare assumed equal. In the real world, different honest parties may have different hashing power;nevertheless, our flat-model does not sacrifice generality since one can imagine that real honestparties are simply clusters of some arbitrary number of honest flat-model parties. The adversaryA is allowed to perform t0 q queries per round, where t0 t is the number of corrupted parties.The environment Z, on the other hand, is not permitted any queries to H(). The rationale forthis, is that we would like to bound the CPU power [Nak08a] of the adversary to be proportionateto the number of parties it controls while making it infeasible for them to be aided by externalsources or by transferring the hashing power potentially invested in concurrent or previous protocolexecutions. This underscores the fact that in our analysis is the standalone setting, where a singleprotocol instance is executed in isolation. We will refer to all the above restrictions on the environment, the parties and the adversary asthe q-bounded synchronous setting.Properties of protocols. In our theorems we will be concerned with properties of protocols in the q-bounded synchronous setting. Such properties will be defined as predicates over therandom variable viewt,n ,A,Z by quantifying over all possible adversaries A and environments Zthat are polynomially bounded. Note that all our protocols will only satisfy properties with a 8 In the conference version of this paper [GKL15] we used the term Broadcast instead of Diffuse to mean thesame thing. Given that this leads to some misunderstanding we changed the terminology to employ the term Diffuseinstead of Broadcast. As in the conference version, note that Diffuse remains an atomic operation and hence thecorruption of a party may not happen while the operation is taking place (cf. [HZ10, GKKZ11]).

10small probability of error in as well as in potentially other parameters. The probability space isdetermined by the random choices of the random oracle functionality as well as the private coins ofall ITIs.Definition 1. Given a predicate Q and a bound q, t, n N with t < n, we say that the protocol satisfies property Q in the q-bounded setting for n parties assuming the number of corruptionsis bounded by t, provided that for all polynomial-time Z, A, the probability that Q(viewt,n ,A,Z ) isfalse is negligible in . Note that we will only consider properties that are polynomial-time computable predicates.Byzantine agreement. As a simple illustration of the formulation above we define the propertiesof a Byzantine agreement (BA) protocol.Definition 2. A protocol solves BA in the q-bounded synchronous setting provided it satisfiesthe following two properties: Agreement. There is a round after which all honest parties return the same output if queried by the environment. Validity. The output returned by an honest party P equals the input of some party P 0 that is honest at the round P s output is produced. We note that in our protocols, the participants are capable of detecting agreement and further-more they can also detect whether other parties detect agreement, thus termination can be easilyachieved by all honest parties. In the traditional cryptographic setting with no trusted setup, itis known that the problem does not have a solution if t n3 [Bor96]. Interestingly, one of ourPOW-based BA protocols works for t < n2 , assuming only a simultaneous start without a PKI, thesame bound that is achievable when a PKI is available. The formulation of Validity above is intended to capture security/correctness against adaptiveadversaries. The notion (specifically, the requirement that the output value be one of the honestparties inputs) has also been called Strong Validity [Nei94], but the distinction is only importantin the case of non-binary inputs. In either case, it is known that in the synchronous cryptographicsetting with trusted setup the problem has a solution if and only if n > |V |t, where V is theinput/decision domain [FG03]. Our POW-based protocol also achieves this bound.Remark 1. One may consider a model where a certain percentage of the honest parties is notalways able to receive all messages broadcast on the network. We point out that such a situation issubsumed by our adversarial model: simply we let the adversary control these players and simulatethem honestly while dropping messages from their incoming tape arbitrarily. Of course, to applythe theorems we prove, one should adjust the total power of the adversary accordingly and addthese parties to the adversarial ones.

(H(ctr, G(s, x)) < D) (ctr q).

The parameter D N is also called the blocks difficulty level. The parameter q N is a boundthat in the Bitcoin implementation determines the size of the register ctr; in our treatment we allow

11this to be arbitrary, and use it to denote the maximum allowed number of hash queries in a round.We do this for convenience and our analysis applies in a straightforward manner to the case thatctr is restricted to the range 0 ctr < 232 and q is independent of ctr. A blockchain, or simply a chain is a sequence of blocks. The rightmost block is the head ofthe chain, denoted head(C). Note that the empty string is also a chain; by convention we sethead() = . A chain C with head(C) = hs0 , x0 , ctr0 i can be extended to a longer chain by appendinga valid block B = hs, x, ctri that satisfies s = H(ctr0 , G(s0 , x0 )). In case C = , by convention anyvalid block of the form hs, x, ctri may extend it. In either case we have an extended chain Cnew = CBthat satisfies head(Cnew ) = B. The length of a chain len(C) is its number of blocks. Given a chain C that has length len(C) =n > 0 we can define a vector xC = hx1 , . . . , xn i that contains all the x-values that are stored in thechain such that xi is the value of the i-th block. Consider a chain C of length m and any nonnegative integer k. We denote by C dk the chainresulting from the pruning the k rightmost blocks. Note that for k len(C), C dk = . If C1 is aprefix of C2 we write C1 C2 . We note that Bitcoin uses chains of variable difficulty, i.e., the value D may change acrossdifferent blocks within the same chain according to some rule that is determined by the x valuesstored in the chain9 . This is done to account for the fact that the number of parties (and hencethe total hashing power of the system) is variable from round to round (as opposed to the unknownbut fixed number of parties n we assume). See Section 7 for further discussion. We are now readyto describe the protocol.

3.1 The backbone protocol

The Bitcoin backbone protocol is executed by an arbitrary number of parties over an unauthenti-cated network. For concreteness, we assume that the number of parties running the protocol is n;however, parties need not be aware of this number when they execute the protocol. As mentionedin Section 2, communication over the network is achieved by utilizing a send-to-all Broadcastfunctionality that is available to all parties (and maybe abused by the adversary in the sense ofdelivering different messages to different parties). Each party maintains a blockchain, as definedabove, starting from the empty chain and mining a block that contains the value s = 0 (by con-vention this is the genesis block)10 . Each partys chain may be different, but, as we will prove,under certain well-defined conditions, the chains of honest parties will share a large common prefix.(Figure 2 depicts the local view of each party as well as the shared portion of their chains.) In the protocol description we intentionally avoid specifying the type of values that parties tryto insert in the chain, the type of chain validation they perform (beyond checking for its structuralproperties with respect to the hash functions G(), H()), and the way they interpret the chain. In ourdescription, these actions are abstracted by the external functions V (), I(), R() which are specifiedby the application that runs on top of the backbone protocol. We will purposely leave thesefunctions undetermined in our description assuming they conform to the following specifications.We will provide explicit instantiations of them in Section 5. Briefly, they are described as follows:

Content validation predicate V (). The content validation predicate receives as input the content of a chain C, denoted by xC , and will return 1 if and only if the contents are consistent 9 In Bitcoin every 2016 blocks the difficulty is recalibrated according to the time-stamps stored in the blocks sothat the block generation rate remains at approximately 10 minutes per block. 10 Alternatively, s can point to an actual block that contains some trusted setup information (in the case of Bitcointhe genesis block contains the string The Times 03/Jan/2009 Chancellor on brink of second bailout for banks). Ouranalysis however is in the standalone setting and thus we choose the simplest possible genesis block.

12Figure 2: Overview of the basic operation of the Bitcoin backbone protocol. Miner M1 receivesfrom the environment a Read instruction that results in the application of the R() function onthe contents of its chain which are equal to the vector hx1 , x2 , x3 , x4 , x5 i. Miner M2 receives fromthe environment an Insert instruction and uses the function I() to determine the value y5 that itsubsequently successfully inserts in its local block chain by solving a proof of work; this results ina broadcast of the newly extended chain. Finally miner M3 receives the newly extended chain andvalidates it both structurally as well as using the content validation predicate V (). M3 will adoptthis chain if M3 deems it better than its local chain as specified by the backbone protocol. Notethat the joint view of M1 , M2 , M3 is inconsistent but there is agreement on the prefix hx1 , x2 , x3 i.

with the intended application implemented on top of the chain. In its simplest form, V () can ensure that the elements of xC are of the proper type.

Input contribution function I(). It receives as input a tuple, (st, C, round, Input(), Receive()), that stands respectively for state data st, current chain C, current round round, contents of input tape Input() and contents of network tape Receive(). Given these, it will produce an updated state st0 as well as an input x that should be the next input to be inserted in a block. For instance, I() can be as simple as copying the contents of the input tape into x and keeping st = , or performing a more complex operation that involves parsing C or even maintaining old input values that have not yet been processed as part of the state st.

Chain reading function R(). It receives as input a chain C and provides an interpretation of it. In the simplest case it can be just returning xC and leaving it to the callee to process the contents of the chain.

In general our treatment will be independent of the exact operation of V, I, R apart from requir-ing the following minimal set of conditions.

2. Input Entropy. The probability of the event that two independent invocations of I(st, C, v, w) where st, C, v, w are arbitrary values consistent with the input of I(), result in the same value x is negligible in .

The Bitcoin backbone protocol is specified as Algorithm 4. Before describing it in detail we firstintroduce the protocols three supporting algorithms.Chain validation. The first algorithm, called validate performs a validation of the structuralproperties of a given chain C, cf. Algorithm 1. It is given as input the values q and D, as well as ahash function H(). It is parameterized by the content validation predicate V (). For each block ofthe chain, the algorithm checks that the proof of work is properly solved, that the counter ctr doesnot exceed q and that the hash of the previous block is properly included in the block. It furthercollects all the inputs from the chains blocks and assembles them into a vector xC . If all blocksverify and V (xC ) is true then the chain is valid; otherwise it is rejected. As mentioned we purposelyleave the predicate V () undetermined.Chain comparison. The objective of the second algorithm, called maxvalid, is to find the bestpossible chain when given a set of chains, cf. Algorithm 2. The algorithm is straightforwardand is parameterized by a max() function that applies some ordering in the space of chains. Themost important aspect is the chains length, in which case max(C1 , C2 ) will return the longest ofthe two. In case len(C1 ) = len(C2 ), some other characteristic can be used to break the tie. In

our case, max(, ) will always return the first operand11 ; alternatively, other options exist, such aslexicographic order or picking a chain at random. The analysis we will perform will essentially beindependent of the tie-breaking rule12 .Proof of work. The third algorithm, called pow, is the main workhorse of the backbone protocol,cf. Algorithm 3. It takes as input a chain and attempts to extend it via solving a proof of work.This algorithm is parameterized by two hash functions H(), G() (which in our analysis will bemodeled as random oracles),13 as well as two positive integers q, D; q represents the number oftimes the algorithm is going to attempt to brute-force the hash function inequality that determinesthe POW instance, and D determines the difficulty of the POW. The algorithm works as follows.Given a chain C and a value x to be inserted in the chain, it hashes these values to obtain h andinitializes a counter ctr. Subsequently, it increments ctr and checks to see whether H(ctr, h) < D;this is the only invocation of H() that is subject to the bound q. If a suitable ctr is found thenthe algorithm succeeds in solving the POW and extends chain C by one block inserting x as well asctr (which serves as the POW). If no suitable ctr is found, the algorithm simply returns the chainunaltered. (See Algorithm 3.)The backbone protocol. Given the three algorithms above, we are now ready to describe theBitcoin backbone protocol, cf. Algorithm 4. This is the protocol that is executed by the minersand which is assumed to run indefinitely (our security analysis will apply when the total runningtime is polynomial in ). It is parameterized by two functions, the input contribution function I()and the chain reading function R(), which is applied to the values stored in the chain. Each miner starts a round with a local chain C (we say that the miner has chain C at this round)and checks its communication tape Receive() to see whether a better chain has been receivedand in such case it adopts it resulting in chain C (we say that the miner adopts chain C at thisround). Choosing the chain C is done using the maxvalid function; note that it could be that C = C.

Then, the miner attempts to extend C by running the POW algorithm pow described above.

11 Note that the way we deploy maxvalid, amounts to parties always giving preference to their local chain as opposedto any incoming chain. This is consistent with current Bitcoin operation; however, some debate about alternate tie-breaking rules has ensued in Bitcoin forums, e.g., see [Cun13]. 12 It is worth to point out that the behavior of maxvalid() is associated with some stability aspects of the backboneprotocol and currently there are proposals to modify it (e.g., by randomizing it cf. [ES14]). It is an interestingquestion whether any improvement in our results can be achieved by randomizing the maxvalid operation. 13 In reality the same hash function (SHA-256) instantiates both G and H; however, it is notationally more conve-nient to consider them as distinct.

The value that the miner attempts to insert in the chain is determined by function I(). Theinput to I() is the state st, the current chain C, the contents of the miners input tape Input() (recallthat they can be written by the environment Z at the beginning of any round) and communicationtape Receive(), as well as the current round number round. The protocol expects two types ofentries in the input tape, Read and (Insert, value); other inputs are ignored. As mentioned, we purposely leave the functions I(), R() undetermined in the description ofthe backbone protocol, as their specifics will vary according to the application. When the input xis determined by I(), the protocol attempts to insert it into the chain C by invoking pow. In casethe local chain C is modified during the above steps, the protocol transmits (broadcasts) the newchain to the other parties. Finally, in case a Read symbol is present in the communication tape,the protocol applies function R() to its current chain and writes the result onto the output tapeOutput(). The round ends when the algorithm diffuses a message ( in case no message is to bediffused).

3.2 (Desired) Properties of the backbone protocol

We next define the two main properties of the backbone protocol that we will prove. The firstproperty is called the common prefix property and is parameterized by a value k N. It considersan arbitrary environment and adversary in the q-bounded setting, and it holds as long as any twohonest parties chains are different only in its most recent k blocks.

states that for any pair of honest players P1 , P2 maintaining the chains C1 , C2 in viewt,n ,A,Z , it holdsthat dk dk C1 C2 and C2 C1 . The second property, which we call the chain quality property, aims at expressing the numberof honest-player contributions that are contained in a sufficiently long and continuous part of anhonest players chain. Specifically, for parameters k N and (0, 1), the rate of adversarial inputcontributions in a continuous part of an honest partys chain is bounded by . This is intended tocapture that at any moment that an honest player looks at a sufficiently long part of its blockchain,that part will be of sufficient quality, i.e., the number of adversarial blocks present in that portionof the chain will be suitably bounded.Definition 4 (Chain Quality Property). The chain quality property Qcq with parameters Rand ` N states that for any honest party P with chain C in viewt,n ,A,Z , it holds that for any `consecutive blocks of C the ratio of adversarial blocks is at most . It is easy to see that any set of, say, h honest parties, obtain as many blocks as their proportionof the total hashing power, i.e., h/n. We say that a protocol satisfies ideal chain quality if this isthe case for adversarial parties as well, i.e., = t/n with respect to those parties. The ideal chainquality is not achieved by the Bitcoin backbone protocol, cf. Remark 6.Remark 2. Observe that in the description of the bitcoin backbone protocol, we have a parameter Dthat determines the difficulty of the proof of work. Our theorems regarding the properties abovewill hold provided that the values n (the number of parties), t (the bound on corruptions), q (thenumber of queries allowed per round per player) and D satisfy a certain condition. With foresightwe can state here that this condition will be that nt t is bounded from above by 1 (n t) Dq 2 .

17Remark 3. A number of additional and enhanced versions of the above properties were suggestedby follow up works to ours, see Section 7 for more details on these properties.

4 Analysis of the Bitcoin Backbone

We now proceed to the analysis of the protocol presented in the previous section. Let {0, 1} be therange of H(). Each party tries to provide a POW by issuing queries to H(), which succeed withprobability p = D/2 , where D is the difficulty level.14 We will assume that log D, as a functionof , is linearly related to . By the properties of the random oracle H(), any collection of querieswill be treated as a collection of independent Bernoulli trials with success probability p. We observethat this follows from the input entropy condition of the input contribution function I(). There isa simple way to enforce this: I() will add a sufficiently long random nonce as part of x that will beignored by the other functions V (), R() as it need not be useful in the blockchain application. Itis easy to see that if a -long nonce is used, the output will be unique except with probability lessthan qtot 2 2 where q tot is the total number of queries submitted to the random oracle throughoutthe execution. Our analysis would be conditioned on this event. Furthermore, there are two badevents in the executions that we consider: First, the event that the adversary guesses in advancethe output of a fresh hash query performed by an honest party, and second, the event that theadversary finds a collision on the hash function restricted on values smaller than D. We will assumethat both of these events will happen with negligible probability in the security parameters that weemploy in our theorems.

4.1 Definitions and preliminary lemmas

Recall that n is the number of parties, t of which can be corrupted by the adversary. We introducethe following parameters for notational convenience:

= pq(n t), = pqt, = 2 , f = + .

The first parameter, , reflects the hashing power of the honest parties. It is an upper bound onthe expected number of solutions that the honest parties compute in one round. Similarly, , isthe expected number of solutions that the corrupted parties compute in one round. Notice theasymmetry that while the honest parties will not compute more than one solution per round, acorrupted party may use all its q queries and potentially compute more than one solution. Theparameter will serve as a lower bound on the following two probabilities. The first one is that atleast one honest party computes a solution in a round:

1 (1 p)q(nt) 1 e ;

we will call such round a successful round. The second one is the probability that exactly one honestparty does so; we will call such round a uniquely successful round. We lower bound the probabilityof such a round by the probability that out of q(n t) coin tosses exactly one comes up heads.Thus, the probability is at least:

(n t)qp(1 p)q(nt)1 (1 + p) . The ratio / = (n t)/t will be of interest for the analysis. When is small (as it will be whenf is small), then and we will be justified to concentrate on the ratio /. To understand how 14 At the time of this writing, Bitcoin difficulty is about 265 which means that log D 191.

18well estimates the probability of a uniquely successful round, call it 0 , we observe the followingupper bound:

0 = (n t)(1 (1 p)q )(1 p)q(nt1) (n t)pqe+pq

3 (1 + pq + ( pq)2 /2) = 2 (1 1 nt ) + 2 (1 1 2 nt ) ,

where we use Facts 1 and 2 (see Appendix A). From this it follows that 0 2 + 3 /2 +O(1/(n t)). The following definition will be crucial in the analysis of the common-prefix property.

Definition 5 (Uniform rounds). We call a round uniform if, at that round, every honest partyinvokes the pow() algorithm with a chain of the same length (i.e., len(C) at line 7 of Algorithm 4is the same for all honest parties).

We will call a query of a party successful if it submits a pair (ctr, h) such that H(ctr, h) D.Without loss of generality, let P1 , . . . , Pt be the set of corrupted parties (knowledge of this set willnot be used in any argument). For each round i, j [q], and k [t], we define Boolean randomvariables Xi and Zijk {0, 1} as follows. If at round i an honest party obtains a POW, then Xi = 1,otherwise Xi = 0. Regarding the adversary, if at round i, the j-th query of the k-th corrupted partyis successful, then Zijk = 1, otherwise Zijk = 0. Further, if Xi = 1, we call i a successful round. If around is uniform (Def. 5) and uniquely successful, we say it is a uniquely successful uniform round. Next, we will prove two preliminary lemmas that will be helpful in our analysis. The first onestates that, at any round, the length of any honest partys chain will be at least as large as thenumber of successful rounds. As a consequence, the chain of honest parties will grow at least at therate of successful rounds. The second lemma is a simple application of Chernoff bounds and statesthat, with high probability, the honest parties will have, at any round, at least as many successfulrounds as the adversary has. The usefulness of this lemma will be in showing that honest partieswill be building a blockchain at a rate the adversary will find it hard to overcome.

Lemma 6. Suppose that at round r, an honest party has a chain of length `. Then, by round s r, Ps1every honest party has adopted a chain of length at least ` + i=r Xi .

Proof. By induction on s r 0. For the basis (s = r), observe that if at round r an honest partyhas a chain C of length `, then that party broadcast C at a round earlier than r. It follows thatevery honest party will receive C by round r. For the inductive step, note that Ps2 by the inductive hypothesis every honest party has received achain of length at least ` = ` + i=1 Xi by round s 1. When Xs1 = 0 the statement follows 0

Lemma 7. Assume (1 + ) for some (0, 1) and 1. The probability that during srounds the number of successful rounds exceeds by a factor (1+ 2 ) the number of solutions computed 2by the adversary is at least 1 e( s) . PsProof. Without Ps P loss of generality we assume the s rounds start at round 1. Let X = i=1 Xi andZ = i=1 j[q] k[t] Zijk . By an application of Chernoff bounds (Appendix A) we obtain P

2 s) 2 s) Pr[X (1 4 )s] e( and Pr[Z (1 + 5 )s] e( .

19It follows that the union of these events has a measure exponentially small in s. However, if noneof them hold, then

X > (1 4 )s (1 4 )(1 + )s > (1 + 2 )(1 + 5 )s > (1 + 2 )Z.

We are now ready for the treatment of the protocols properties outlined in Section 3.2. This property is established in Theorem 10, whose main argument is in turn given in Lemma 9.We start with a lemma leading to that argument. The lemma will be used to argue that uniformrounds favor the honest parties. Informally, the idea is that a uniquely successful uniform roundforces an adversary trying to make honest parties chains diverge to produce POWs. In thesecond lemma we take advantage of this, to show that if the adversary has appropriately boundedcomputational power, then there will be enough uniquely successful uniform rounds to prevent himfrom mounting a successful attack on the common-prefix property.

Lemma 8. Consider a uniquely successful uniform round where the honest parties have chains oflength ` 1. Then, in any subsequent round, there can be at most one chain C where the `-th blockwas contributed by an honest party or a collision in H() occurs.

Proof. Let r be a uniquely-successful uniform round and C, with len(C) = `, be the chain computedby the party that solves the proof of work and extends its local chain of length ` 1 to `. At roundr + 1 every honest party will receive C and will either adopt it or adopt another chain sent by theadversary. In any case, every honest party will have a chain of length at least `, and will neverquery the pow() function with a chain of length ` 1 again. The statement of the lemma follows,since if there is another chain C 0 with a different honest block in the `-th position, this would meanthat such block was copied. This implies a collision.

Note that in order for the common-prefix property to be violated at round r, at least two honest dk dkparties should have chains C1 and C2 such that C1 C2 or C2 C1 . Therefore, the existence ofmany blocks computed at uniform rounds forces the adversary to provide as many blocks of its own.We need to show that, with high probability the adversary will fail to collect as many solutions byround r. We say that two distinct chains diverge at a given round, if the last block of their common prefixwas computed before that round. Our main lemma below asserts the following. Suppose the protocol is halted at round r andtwo honest parties have distinct chains C1 and C2 . Then, for s large enough, the probability thatC1 and C2 diverge at round r s is negligible. The idea of the proof is to upper bound the numberof (valid) broadcasts that the adversary can perform during these last s rounds. Note that theyare in the order of s in expectation. The crucial observation here is that if at a given round theadversary is silent, then a uniform round follows. Therefore we expect about (1 )s uniformrounds, and consequently (1 )s uniquely-successful uniform rounds. Recalling Lemma 8, theadversary needs to collect (1 )s POWs. Thus, in the lemmas condition we choose the relationbetween and suitably so that the adversary is incapable of accomplishing this task, except withprobability exponentially decreasing in s.

Lemma 9. Assume f < 1 and (1 + ), for some real (0, 1) and 1 such that2 f 1 0. Suppose C1 is the chain of an honest party at round r and C2 some other chainof length at least len(C1 ) at round r. Then, for any s r, the probability that C1 and C2 diverge at 3round r s is at most e( s) .

20Proof. We define three bad events, A, B and C, which we show to hold with probability exponen-tially small in s. We conclude the proof by showing that if none of these bad events happens, thenthere cannot exist C1 and C2 diverging at round r s. The bad event A occurs if, at some round r0 r s, the adversary broadcasts a chain C withthe following properties. (1) C is returned by the function maxvalid of an honest party; (2) the blockhead(C) was computed by the adversary before round r (1 + 8 )s. We now give an upper bound on the probability that event A occurs. Let r r (1 + 8 )sbe the latest round at which a block of C was computed by an honest party (if none exists, thenr = 0), and let ` denote the length of the chain up to that block. If any other block computed byan honest party exists among the blocks from length ` up to len(C), then such block was computedin rounds r (1 + 8 )s up to r0 , and it follows that the probability that the adversarys block canextend it at round r0 is negligible in . Therefore, we infer that with overwhelming probability theadversary has computed all the blocks from length ` to len(C), and done so during the rounds r tor0 . Let Z denote the total number of solutions the adversary obtained in r0 r rounds. Let alsoX denote the total number of successful rounds for the honest parties in r0 r rounds. We have

Z len(C) ` X.

The first inequality was argued above and the second one follows from Lemma 6. Finally, note that,by Lemma 7, the event Z X has measure exponentially small in the number of rounds r0 r . 3Since that number satisfies r0 r s/8, we conclude that Pr[A] e( s) . The second bad event occurs if the adversary has obtained a large number of solutions during(1 + 8 )s rounds. Specifically, let Z denote the number of successful calls to the oracle by theadversary, for a total of (1 + 8 )s rounds. Define B to be the event Z (1 + 9 )(1 + 8 )s. Anapplication of Chernoff bounds gives 2 s) Pr[Z (1 + 9 )(1 + 8 )s] e( .

The third bad event occurs when the honest parties do not obtain enough solutions from theoracle during uniform rounds. Consider any number, say, s0 of rounds (not necessarily consecutive),and denote by X the number of them that were uniquely successful. We have 2 s0 ) Pr[X (1 4 )s0 ] e( .

From now on we assume that none of the events A, B and C occurs. It is easy to see that if at anyround the adversary does not broadcast a (new) POW, then the next round will be uniform. Usingthis observation for a given s consecutive rounds, we will calculate a lower bound on the number ofrounds that will be uniform. The adversary may prevent a round among the s consecutive roundsfrom being uniform by broadcasting a solution that was found during the s consecutive rounds aswell as in the past for an extended period of (1 + 8 )s rounds. Note that, since A does not occur, he 3may not use even older solutions with probability at least 1 e( s) . The negation of the second bad event bounds the number of solutions the adversary can obtain.This implies that at least

s0 = s (1 + 9 )(1 + 8 )s s (1 + 4 )s = (1 )s 4 s

rounds among the s rounds will be uniform.

Given the negation of the third bad event, there were X > (1 4 )s0 uniquely successful uniformrounds during the s rounds of the protocol. By Lemma 8, it is necessary for the adversary, in order

21to maintain the concurrent existence of C1 and C2 , to obtain at least X solutions. Thus, for theadversary to succeed, it should hold that Z X. Substituting in this inequality the bounds onZ (1 + 4 )s and X > (1 4 )s0 given by B and C, respectively, and rearranging we obtain

contradicting the choice of in the statement of the lemma. We conclude that if A B C doesnot occur, then C1 and C2 cannot diverge at round r s. Finally, an application of the union boundon A B C implies that the adversary can successfully maintain such C1 and C2 with probabilityat most exponentially small in s and the statement of the lemma follows.

The above lemma is almost what we need, except that it refers to number of rounds insteadof number of blocks. In order to obtain the common-prefix property we should use the propertiesof the blockchains of the parties themselves as the sole measure of divergence. The next theoremestablishes the connection.

Theorem 10. Assume f < 1 and (1 + ), for some real (0, 1) and 1 such that2 f 1 0. Let S be the set of the chains of the honest parties at a given round of the backboneprotocol. Then the probability that S does not satisfy the common-prefix property with parameter k 3is at most e( k) .

Remark 4. Observe that as f 0, 1. On the other hand, if f 1 then , where is thegolden ratio ( 2 ). 1+ 5

Proof. If there is only one chain in S then the property is satisfied trivially. Consider two chains C1and C2 in S and the least integer k such that dk dk C1 C2 and C2 C1 . (2)

We need to show that the event k k happens with probability exponentially small in k. Let r be the current round and let r s be the round at which the last common block of C1and C2 was computed. The length of the chains cannot be greater than the number of solutions Yobtained from the oracle in s rounds. By the Chernoff bound, 2 f s/3 Pr[Y (1 + )f s] e . 2It follows that, with probability 1 e f s/3 , s > k /((1 + )f ). Thus, if k k, we have a sequenceof s = (k) consecutive rounds with chains C1 and C2 diverging, and the theorem follows fromLemma 9.

Remark 5. Recall that in our analysis we are interested in the relationship between and . Inparticular, the ratio / = t/(n t) reflects the power of the adversary as a fraction of the powerof the honest parties. The case implies that the adversary can, with constant probability,preclude the honest parties that follow the protocol from doing anything useful. This is simplybecause such an adversary has enough power to build a chain that will often be longer than thechain the honest parties are building. Therefore, it is to be expected that the statements are

22Figure 3: The degradation of the adversarial bound of Theorem 10 as f ranges in (0, 1) in the x-axis(lower curve). When ties are broken following lexicographic order the analysis can be improved(upper curve).

meaningful only when / is bounded below 1 by a suitable constant. In case in practice thenetwork is highly synchronized (which would effectively mean that f 0), the value of gets veryclose to the value of = 2 , and hence our result is tight. In case of a larger f , our analysisshows that the upper bound on the adversarial hashing power devolves and in fact approaches 0as f 1; in other words, in a network were a POW becomes relatively easy compared to networksynchronization time, Theorem 10 provides no security guarantee whatsoever. In practice, this underscores the importance of calibrating the difficulty of the proof of work tomaintain a small value of f (such calibration takes place in the Bitcoin system every 2016 blocks). Itis an interesting question to further explore the behavior of the backbone protocol in desynchronizednetworks. We remark that with our analysis we can prove a much better behavior for f 1 for amodified backbone protocol that has a deterministic tie-breaking rule (e.g., chooses a chain that isthe lexicographically smallest from those received15 ). In this case we can prove, for example, thatour analysis enables the common prefix property to hold when f = 1 assuming the adversary controlsless than about 29% of the hashing power. In Figure 3 we show how the bound of Theorem 10degenerates when the parameter f ranges in the (0, 1) range as well as the improvement in theanalysis that can be achieved by lexicographic tie-breaking (we omit the details of this analysis).

4.2 The chain-quality property

We now turn to the chain-quality property (Definition 4), which the theorem below establishes fora suitable bound on the number of blocks introduced by the adversary.Theorem 11. Assume f < 1 and (1+) for some (0, 1). Suppose C belongs to an honestparty and consider any ` consecutive blocks of C. The probability that the adversary has contributed 2more than (1 3 ) 1 ` of these blocks is less than e( `) . From the above theorem, it follows immediately that the chain quality is satisfied with parameter = 1 for any segment length ` and probability that drops exponentially in `.

Proof. Let us denote by Bi the i-th block of the chain C of an honest party P at some round r sothat C = B1 . . . Blen(C) and consider some ` consecutive blocks Bu , . . . , Bv . 15 This has in fact been debated in an number of occasions; see, e.g., [Cun13].

23 Define L as the least number of consecutive blocks Bu0 , . . . , Bv0 that include the ` given ones(i.e., u0 u and v v 0 ) and have the properties (1) that the block Bu0 was computed by an honestparty or is B1 in case such block does not exist, and (2) that there exists a round at which an honestparty was trying to extend the chain ending at block Bv0 . Observe that number L is well definedsince Blen(C) is at the head of a chain that an honest party is trying to extend. Define also r1 as theround that Bu0 was created (r1 = 1 if Bu0 is the genesis block), r2 as the first round that an honestparty attempts to extend Bv0 , and let S = {r : r1 r r2 }. Now let x denote the number of blocks from honest parties that are included in the ` blocksand, towards a contradiction, assume that h 1i h 1i x 1 1 ` 1 1 L. 3 3 Let Z be the random variable that corresponds to the POWs obtained by the adversary duringthe rounds in S and X the successful rounds of the honest players in the same sequence of rounds. Suppose first that all the L blocks {Bj : u0 j v 0 } have been computed during the rounds inthe set S. Then 1 1 1 Z Lx 1 L 1 X X. 3 3 (1 + 2 )The first inequality comes from the fact that the adversary computed L x of the L blocks. Thesecond one comes from the postulated relation between x and L. The penultimate inequality followsfrom Lemma 6 and the properties (1) and (2) of the L blocks. Specifically, X L, because roundr1 is a round that an honest party has produced block Bu0 and thus all honest party at the nextround will have a chain of at least the length that Bu0 . Furthermore, at round r2 , an honest partyattempts to extend block Bv0 thus all honest parties should be at a chain of at least that length.Finally, the last inequality comes from a simple numerical calculation. To obtain the stated bound, note that if |S| < (1 )L, then since f is bounded away from 1by a constant, the Chernoff bound implies that in |S| rounds the total number of solutions is atleast L with probability at most e(L) = e(`) . Otherwise we have |S| (1 )L and the boundfollows from Lemma 7 since the series of inequalities implies that (1 + 2 )Z X. To finish the proof we need to consider the case in which these L blocks contain blocks thatthe adversary computed in rounds outside S. To manage this for a block it computed before roundr1 implies that it guessed the hash of a block in {Bj : u0 j v 0 }; this occurs with probabilitynegligible in . To inject among these blocks one it computed after round r2 implies a collision. Tosee this, suppose the adversary injects a block B (s , x , c ) among two existing blocs B = (s, x, c)and B 0 = (s0 , x0 , c0 ). Then, with g = G(s, x) and since both B and B 0 extend B, it should holdthat s = s0 = H(c, g) and we obtain the collision H(c , g) = H(c0 , g).

Remark 6. We are able to argue that Theorem 11 is tight under the simplification that ties betweenblockchains of equal length always favor the adversary. In particular, we assume that the functionmaxvalid at line 5 of Algorithm 4, in case of chains of equal length, will always return the suggestionof the adversary if there is one. This simplification is made without loss of generality in our modelsince the adversary is rushing and hence in case two chains are transmitted in a single round theadversary can always arrange it so that its own solution arrives first16 . Furthermore, if the numberof honest parties is large, when an honest party discovers a solution in a round, all other honest 16 In fact, this rushing capability was argued to be realistic in [ES14] through the dispersion of sybil nodes in theBitcoin peer-to-peer network that echo the adversarys messages.

24parties will prefer the one transmitted by the adversary and thus the effect of a single honest partyopting for its own block will be negligible. The attack below is a type of selfish mining attack (it is a variation of the one in [ES14] andappears to be folklore in bitcoin circles) that accomplishes the stated bound. The attack is asfollows. Initially, the adversary works on the same chain as every honest party. However, wheneverit finds a solution it keeps it private and keeps on extending a private chain. Whenever an honestparty finds a solution, the (rushing) adversary releases one block from the private chain; if theprivate chain is depleted the adversary returns to the public chain. We now argue that this strategyexploits the conditions stated above and maximizes the adversarial blocks in the blockchain up tothe upper bound of Theorem 11. Consider s rounds of the protocol. With high probability, the adversary will obtain more than(1 )s solutions for some small > 0. With each one of them it will try to block the blocksthat are broadcast by honest parties. At the end of the s rounds, there may be a few unusedblocks but these will be, with high probability, at most s. This is because during the rounds thatthe adversary acquired the blocks that it did not broadcast, none of the honest players obtained asolution; this is a low probability event. Now, the honest parties will havewith high probabilityat most (1 + )s successful rounds. It follows that, for a small constant , the quality of the chain is . Note that the Chernoff bound can be used to make the argument more formal and replace1 1the expression with high probability with 1 e(s) . From this it follows that in order to obtainbetter chain quality one should consider mechanisms that result in more favorable (for the honestparties) behavior in the function maxvalid.

5 Simple POW-based Byzantine Agreement Protocols

We now turn to applications of the Bitcoin backbone protocol, showing how it can be used as abasis to solve other problems. We start in this section by analyzing Nakamotos suggestion forsolving BA, observing that it falls short of satisfying Definition 2; we then present our simpleinstantiation which solves BA. This protocol, however, only tolerates an adversarial hashing powerless than 1/3, which takes us to the next section, where we present Bitcoins essential task, namely,distributively maintaining a public transaction ledger, as well as a more elaborate BA protocoltolerating an adversarial power strictly less than 1/2. An overview of our applications and the waytheir properties depend on those of the backbone protocol was already presented in Figure 1.

5.1 Nakamotos suggestion for Byzantine agreement

As our first illustration of how the Bitcoin backbone can be used we present Nakamotos suggestionfor solving BA, as presented in a forum post [Nak08b].17 We describe his solution (call it nak BA ) viathe backbone protocol by specifying the functions V (), I(), R() in a suitable way (see Figure 4).The content validation predicate V () will be defined to require that all valid chains contain thesame input value together with a nonce. The chain reading function R() simply returns this value(ignoring the nonce) in case the chain has length at least k (which is the security parameter);otherwise it is undefined. The input contribution function I() examines the contents of the currentchain C and the contents of the input tape Input(). In case C = the input contribution for thenext block is taken verbatim from the input tape; otherwise, the input contribution is determined asthe (unique) value that is already present in the C (and in this case the local input is ignored). Note 17 Note that Nakamotos description is quite informal. We make the most plausible interpretation of it in our formalframework.

25that we will only consider environments Z that provide an input symbol to all parties. Note thatthe nonce is added to ensure work independence: the parties need to introduce a fresh random-bit nonce at each block (cf. the beginning of Sec. 4). It follows that initially the protocol builds various chains all containing the same value. Theintuition is that Agreement will follow from the fact that the honest players will eventually agree ona single chain, as long as the majority of the hashing power lies with the honest parties. While thisis true, as we will demonstrate, the second necessary property does not hold: this protocol cannotprovide Validity (with high probability).

icate V () {0, 1}, 1 , . . . , n {0, 1} where xi = hvi , i i, or n = 0. Chain reading function If V (xC ) = True and len(C) k, the value of R(C) is the (unique) R() (parameterized by value v that is present in each block of C, while it is undefined if k) V (xC ) = False or len(C) < k. Input contribution func- If C = and (Insert, v) is in the input tape then tion I() I(st, C, round, Input()) is equal to hv, i where {0, 1} is a ran- dom value; otherwise (i.e., the case C 6= ), it is equal to hv, i where v is the unique v {0, 1} value that is present in C and {0, 1} is a random value. The state st always remains .

Figure 4: Expressing Nakamotos BA protocol nak

As we now show, Agreement follows easily from the common-prefix property. Indeed, as long asthere is a common prefix (irrespective of its length), it is ensured that when R() becomes definedand all honest parties will produce the same output.Lemma 12 (Agreement). Suppose f < 1 and (1 + ), for some real (0, 1) and 1such that 2 f 1 0. Protocol nak BA from Fig. 4 satisfies Agreement (cf. Definition 2) with ( 3 k)probability at least 1 e .Proof. Observe that chains contain unique values (ignoring the nonces), therefore a disagreementbetween honest parties implies that two parties have disjoint chains (essentially, this is equivalentto a fork that happens at the onset). It follows from the common prefix property (Theorem 10)that the event of any two chains of length at least k that are completely disjoint happens with 3probability at most e( k) .

On the other hand, it is easy to see that Validity cannot be guaranteed with overwhelmingprobability unless the hashing power of the adversary is negligible compared to the honest players,i.e., t/n is negligible. This is because in case the adversary finds a solution first, then every honestplayer will extend the adversarys solution and switch to the adversarial input hence abandoningthe original input. While one can still show that Validity can be ensured with non-zero probability(and thus the protocol fails gracefully assuming honest majority), nak BA falls short from providinga solution to BA. Interestingly, by appropriately modifying the way the backbone protocol is used,we show in the next section how a solution can be derived.

5.2 A Byzantine agreement protocol for (1/3)-bounded adversaries

We now show that the Bitcoin backbone can be directly used to satisfy BAs properties with anerror that decreases exponentially in the length of the chain, assuming however that the adversarys

26hashing power is less than 1/3. There are two important differences with respect to the approachin the previous section: (i) parties never abandon their original input but instead they do insistin inserting it into the blockchain, and (ii) when the chain becomes of length 2k, they output themajority of their local length-k prefix (note that here we consider binary BA). The protocol (i.e.,the specification of the functions V (), I(), R()) is presented in Figure 5.

Proof. In order for agreement to be violated, at least two honest players should have upon termina- dk dktion chains C1 and C2 such that C1 6= C2 . In particular, the set {C1 , C2 } should be a set of chainsthat belong to honest parties and does not satisfy the common-prefix property. Thus, the statementof the lemma follows directly from Theorem 9.

We now turn to the Validity property. In order to prove it we need to show that, upon termi-nation of the protocol, the chain of any honest party will contain among the first k inputs moreinputs from honest players than provided by the adversary. As we will see, this is a consequence ofthe chain-quality property. 1/3Lemma 14 (Validity). Suppose f < 1 and 2(1 + ), for some real (0, 1). Protocol BA 2satisfies Validity in O(k) rounds with probability at least 1 e( k) .

Proof. For the property to be satisfied we only need to ensure that in Cdk the majority of the inputs 1/3was computed by the honest parties. As in protocol BA we have len(Cdk ) = k, Theorem 11 with = 2 provides exactly what we want. 1/3 Note that BA solves BA only in case the adversarys hashing power is bounded by 1/3. Incase adversarial blocks win all head-to-head races within a round (as it is the case with a rushingadversary), the result is tight, as argued in Remark 6. In the next section we show a more elaborateconstruction based on a transaction ledger which tolerates can tolerate an adversary with hashingpower bounded by 1/2.Remark 7. As mentioned in Section 2, Strong Validity refers to the requirement that the outputvalue be one of the honest parties inputs, and the distinction is relevant in the case of non-binaryinputs, i.e., coming from an arbitrary set V , |V | > 2. It is easy to modify the above algorithm toalso satisfy this property by making the chain reading function the element with highest plurality inthe chain (ties broken favoring the lexicographically smallest element in V ), as opposed to majority,and by imposing a more stringent bound on the adversary, namely, that |V |(1 + ). This

27ensures that the expected number of blocks in the blockchain that are controlled by the adversaryis less than |V1 | , and maintains validity even in the worst case that the honest parties inputs areequally split among all possible values but one (i.e., there are |V | 1 inputs equally proportionedamong the honest parties). Agreement is ensured in the same way as before via the common-prefixproperty. The bound is in-line with the known bounds for the computational setting with trustedsetup, n > |V |t, cf. [FG03].

6 Public Transaction Ledgers

We now come to the application which the Bitcoin backbone was designed to solve: maintaining apublic transaction ledger. We first formally introduce this object a book where transactionsare recorded and its properties, and then we show how it can be used to implement the Bitcoinledger and BA in the honest majority setting by properly instantiating the notion of a transaction.

6.1 Robust public transaction ledgers

A public transaction ledger is defined with respect to a set of valid ledgers L and a set of validtransactions T , each one possessing an efficient membership test. A ledger x L is a vector ofsequences of transactions tx T . Each transaction tx may be associated with one or more accounts,denoted a1 , a2 , . . . etc. The backbone protocol parties, called miners in the context of this section, process sequences oftransactions of the form x = tx1 . . . txe that are supposed to be incorporated into their local chainC. The input inserted at each block of the chain C is the sequence x of transactions. Thus, a ledgeris a vector of transaction sequences hx1 , . . . , xm i, and a chain C of length m contains the ledgerxC = hx1 , . . . , xm i if the input of the j-th block in C is xj . The description and properties of the ledger protocol will be expressed relative to an oracle Txgenwhich will control a set of accounts by creating them and issuing transactions on their behalf. Inan execution of the backbone protocol, the environment Z as well as the miners will have accessto Txgen. Specifically, Txgen is a stateful oracle that responds to two types of queries (which wepurposely only describe at a high level): GenAccount(1 ): It generates an account a. It returns a transaction tx provided that tx IssueTrans(1 , tx): is some suitably formed string, or . We also consider a symmetric relation on T , denoted by C(, ), which indicates when two trans-actions tx1 , tx2 are conflicting. Valid ledgers x L can never contain two conflicting transactions.We call oracle Txgen unambiguous if it holds that for all PPT A, the probability that ATxgenproduces a transaction tx0 such that C(tx0 , tx) = 1, for tx issued by Txgen, is negligible in . Finally, a transaction tx is called neutral if C(tx, tx0 ) = 0 for any other transaction tx0 . Thepresence of neutral transactions in the ledger can be helpful for a variety of purposes, as we will seenext and in the BA protocol that we build on top of the ledger. For convenience we will assume thata single random nonce {0, 1} is also a valid transaction. Nonces will be neutral transactionsand may be included in the ledger for the sole purpose of ensuring independence between the POWinstances solved by the honest parties. Next, we determine the three functions V (), I(), R() that will turn the backbone protocol intoPL , a protocol realizing a public transaction ledger. See Figure 6. We now introduce two essential properties for a protocol maintaning a public transaction ledger:(i) Persistence and (ii) Liveness. In a nutshell, Persistence states that once an honest player reports

Figure 6: The public transaction ledger protocol PL , built on the Bitcoin backbone.

a transaction deep enough in the ledger, then all other honest players will report it indefinitelywhenever they are asked, and at exactly the same position in the ledger (essentially, this meansthat all honest players agree on all the transactions that took place and in what order). In a moreconcrete Bitcoin-like setting, Persistence is essential to ensure that credits are final and that theyhappened at a certain time in the systems timeline (which is implicitly defined by the ledgeritself). Note that Persistence is useful but not enough to ensure that the ledger makes progress, i.e.,that transactions are eventually inserted in a chain. This is captured by the Liveness property,which states that as long as a transaction comes from an honest account holder and is providedby the environment to all honest players, then it will be inserted into the honest players ledgers,assuming the environment keeps providing it as an input for a sufficient number of rounds.18 We define the two properties below.19

Definition 15. A protocol implements a robust public transaction ledger in the q-bounded syn-chronous setting if it organizes the ledger as a hashchain of blocks of transactions and it satisfiesthe following two properties: Persistence: Parameterized by k N (the depth parameter), if in a certain round an honest player reports a ledger that contains a transaction tx in a block more than k blocks away from the end of the ledger (such transaction will be called stable), then tx will always be reported as stable, in the same position in the ledger, by any honest player from the next round on. Liveness: Parameterized by u, k N (the wait time and depth parameters, resp.), provided that a transaction either (i) issued by Txgen, or (ii) is neutral, is given as input to all honest players continuously for u consecutive rounds, then there exists an honest party who will report this transaction at a block more than k blocks from the end of the ledger, i.e., the transaction will be reported as stable.

We prove the two properties separately, starting with Persistence. We note first that it is essential 18 Observe that here we take the view that new transactions are available to all honest players and the way theyare propagated is handled by the environment that feeds the backbone protocol. While this makes sense in thehonest/malicious cryptographic model, it has been challenged in a model where all players are rational [BDOZ12].Analysis of the backbone protocol in a setting where transaction propagation is governed by rational players is beyondthe scope of our paper. Still, it is straightforward to use our results to argue about liveness even when some playersdo not receive all transactions by applying the same reasoning as in Remark 1. 19 We note that we provide a slightly stronger definition for persistence compared to our original formulation[GKL15]. In particular we require that once some party reports a transaction as stable then from the next round on,all honest parties will report it as stable. In the original formulation the wording stated that parties may report it inthe same position which seemingly is logically equivalent to our present formulation under the assumption of chaingrowth (a property that follows easily from Lemma 6).

29to require that the stability of the transaction is reported from the next round on from the timethat an honest party reports it as stable. Indeed, it is not guaranteed that parties simultaneouslyreport a transaction as stable: the adversary may advance the chain of a certain player at a specificround and thus make the transaction appear as stable when the environment checks it; neverthelessat that round other honest parties may still have chains that have not advanced sufficiently enoughand thus report the transaction as not stable. This is akin to the lack of simultaneous terminationin early stopping consensus protocols, cf. [DRS90]. The proof is essentially based on the common prefix property of the backbone protocol (recallDefinition 3 and Theorem 10); in fact it relies on the stronger formulation of common prefix asexpressed in Lemma 9.

Proof. Let C1 be the chain of some honest player P1 at round r1 . We show that if a transaction dktx is included in C1 at round r1 , i.e., it is stable, then this transaction will be always included in 3every honest players chain with probability at least 1 e( k) and their chain will be at least aslong from the next round on, thus the transaction tx will be also stable for them. For every r2 > r1 , let B(r2 ) be the event that an honest party P2 has a chain C2 at round r2 , dksuch that C2 does not include tx. Suppose tx was inserted in C1 at round r < r1 . It follows thatC1 and C2 diverge at round r . If it holds that at round r2 player P1 possesses a continuation of chain C1 , then by Lemma 9 this 3 occurs with probability e( (r2 r )) . If not, then this means that P1 abandoned C1 at some roundfollowing r1 and prior to r2 for a chain not containing tx. It follows that C1 and this other chain 3 coexist at the round that P1 switches and by Lemma 9 this occurs with probability e( (r1 r )) . 3 So in either case we conclude that the probability of event B(r2 ) is e( (r1 r )) . The claim then follows by a union bound over all rounds r > r1 . Letting s = r1 r and bean appropriate constant, the probability that there is an r > r1 such that B(r) occurs (i.e., thatPersistence is violated at round r) is 3 0 3 X X Pr[r>r1 B(r)] Pr[B(r + s0 )] e s = e( s) . s0 s s0 s

Finally, as in the proof Theorem 10 we can argue that s = (k). The above suggest that all honestparties will report the transaction tx in the same position in their chains and thus because of the factthat from any round after r1 all chains will be at least as long as C1 , it follows that the transactiontx will be also stable.

We next prove Liveness, which is based on the chain-quality property (recall Definition 4 andTheorem 11) and the fact that the chain of honest parties grows at least as fast as the number ofblocks they produce proven in Lemma 6.

Proof. We prove that assuming all honest players receive as input the transaction tx for at leastu = 2k/[(1 )] rounds, there exists an honest party with chain C such that tx is included in C dk .

30 Indeed, after u rounds the Chernoff bound implies that the honest parties had at least 2k 2successful rounds with probability at least 1 e( k) . Invoking Lemma 6, we infer that thechains length of any honest party has increased by at least 2k blocks. Finally, the chain-qualityproperty (Theorem 11) implies that at least one of the blocks in the length-k suffix of C dk wascomputed by an honest party. Such a block would include tx since it is infeasible for adversarialZ, A to produce a conflicting transaction tx0 (which would be the only event making an honestplayer drop tx from the sequence of transactions x that it attempts to insert in the blockchain).Thus, the lemma follows.

6.2 Bitcoin-like transactions and ledger

Next, we show how to instantiate the public transaction ledger for Bitcoin, by defining the sets oftransactions and valid ledgers. Transactions and accounts are defined with respect to a digital signature scheme that is com-prised of three algorithms hKeyGen, Sign, Verifyi. An account will be a pair a = (vk, G(vk)) whereG() is a hash function and G(vk) is the address corresponding to the account. A transaction tx is of the form {a1 , a2 , . . . , ai } (, {(a01 , b01 ), . . . , (a0o , b0o )}), where a1 , . . . , aiare the accounts to be debited, a01 , . . . , a0o are the addresses of the accounts20 to be credited withfunds b01 , . . . , b0o , respectively, and is a vector h(vk1 , 1 ), . . . , (vki , i )i of verification keys anddigital signatures issued under them, on the same message {(a01 , b01 ), . . . , (a0o , b0o )}. (We note thatBitcoin transactions can be more expressive but the above description is sufficient for the purposeof our analysis). Next, we specify the Txgen oracle: GenAccount(1 ): It generates an account a by running KeyGen and computing the hash G() on the verification key. The account is the pair (vk, G(vk)), where G(vk) is the accounts address. The corresponding secret key, sk, is kept in the state of Txgen. It returns a transaction tx provided that tx IssueTrans(1 , tx): is a transaction that is only miss- ing the signatures by accounts that are maintained by Txgen. (Recall the format of transactions above.) Each account is only allowed a single transaction. Note that the above restriction on IssueTrans is without loss of generality, as in Bitcoin, entitiestypically maintain a number of accounts and are allowed (although not forced) to move their balancesforward to a new account as they make new transactions. The conflict relation C(, ) over T satisfiesthat C(tx1 , tx2 ) = 1 if and only if tx1 6= tx2 and tx1 , tx2 have an input account in common21 . Thus,we can easily prove the unambiguity of the Txgen oracle based on the unforgeability of the underlyingdigital signature.

In order to define the set of valid Bitcoin ledgers we first need to determine in what sense atransaction may be valid with respect to a ledger. Then we will define the set of valid ledgersrecursively as the maximal set of vectors of sequences of transactions that satisfy this condition. Sohere it goes. 20 In bitcoin terminology every account has an address that is used to uniquely identify it. Payments directed to anaccount require only this bitcoin address. The actual verification key corresponding to the account will be revealedonly when the account makes a payment. 21 The conflict relation is more permissive in the actual Bitcoin ledger. We adopt the more simplified version givenabove as it does not change the gist of the analysis.

31 A transaction tx is valid with Pi respect P to a Bitcoin ledger x = hx1 , . . . , xm i provided that all odigital signatures verify and j=1 bj j=1 bj , where bj is the balance that was credited to 0

account aj in the latest transaction involving aj in x. In case e = ij=1 bj oj=1 b0j > 0, then e P Pis a transaction fee that may be claimed separately in a special transaction of the form . . .,called a coinbase transaction. In more detail, a coinbase transaction has no inputs and its purposeis to enable miners to be rewarded P for maintaining the legder. The transaction is of the form {(a1 , b1 ), . . . , (ao , bo )}, and oj=1 bj is determined based on the other transactions that arebundled in the block as well as a flat reward fee, as explain below. A sequence of transactions x = h {(a1 , b1 ), . . . , (ao , bo )}, tx1 , . . . , txl i is said to be valid withrespect to a ledger x = hx1 , . . . , xm i, if each transaction txj is valid with respect to the ledger xextended by the transactions tx1 , . . . , txj1 . I.e., for all j = 1, . . . , l the transaction txj should bevalid with respect to ledger hx1 , . . . , xm , tx1 . . . txj1 i, Poand furthermore, the total P fee e = j=1 bj collected in the transaction {(a1 , b1 ), . . . , (ao , bo )}does not exceed rm + m j=1 ej , which includes all the individual fees corresponding to transactionstx1 , . . . , txe , plus a value rm that is the flat reward given for extending a ledger of length m to aledger of length m + 1.22 The set of valid ledgers L with respect to a reward progression {rj }jN contains (the emptyledger), and any ledger x which extends a ledger in L by a valid sequence of transactions. Notethat the first transaction sequence of any P ledger x L contains a single transaction of the form {(a1 , b1 ), . . . , (ao , bo )} that satisfies oj=1 bj = r0 , where r0 is the initial flat reward. This firsttransaction distributes an initial amount of money to the ledgers initiator(s).23 It is easy to seethat L has an efficient membership test. Given the existence of coinbase transactions in this application we can do away with randomnonces as standalone transactions and the description of the input contribution function I in Fig. 6,is modified to include their generation each time an input sequence of transactions is determinedto be inserted P in the ledger. Specifically, I() will form a coinbase transaction {(a, b)}, whereb = rlen(C) + m j=1 ej and ej is the fee corresponding to xs j-th transaction. Account a is afreshly created account that is obtained via running KeyGen. I() will append account a and thecorresponding (vk, sk) to its private state st. We will refer to the modified PL protocol by the moniker BTC . BTC inherits from PL theproperties of Persistence and Liveness which will ensure the following with overwhelming probabilityin k. Apart from its latest k blocks, the transaction ledger is fixed and immutable for all honest miners. If a majority of miners24 receive an honest transaction and attempt to insert it following the protocol for a sufficient number of rounds (equal to parameter u, the wait time), it will become a permanent entry in the ledger (no matter the adversarial strategy of the remaining miners). 22 Currently, the flat reward for extending the Bitcoin chain is 25BTC. The sequence r0 , r1 , . . . for Bitcoin followsa geometric progression with large constant intervals. 23 In the case of Bitcoin, it was supposedly Nakamoto himself who collected this first reward of 50BTC. 24 Recall that we assume a flat model w.r.t. hashing power; a majority of miners corresponds to a set of partiescontrolling the majority of the hashing power.

Figure 7: The transaction production protocol tx .

6.3 Byzantine agreement for honest majority

We now use the public transaction ledger formulation to achieve POW-based BA for an honestmajority by properly instantiating the notion of a transaction, thus improving on the simple BAprotocol tolerating a (1/3)-bounded adversary presented in Section 5. Here we consider a set of valid ledgers L that contain sequences of transactions of the formhnonce, v, ctri, and satisfy the predicate: (H1 (ctr, G(nonce, v)) < D) (ctr q), (3)where H1 (), G() are two hash functions as in the definition of the backbone protocol, and v {0, 1}is a partys input. (Recall that D is the difficulty level and q determines how many calls to H1 () aparty is allowed to make per round.) To distinguish the oracles, in this section we will use H0 () torefer to the oracle used in the backbone protocol. For the ledger we consider in this section, there will be no accounts and all transactions will beneutral i.e., the conflict predicate C(, ) will be false for all pairs of transactions. We first provide a high level description of the BA protocol assuming parties have q queries perround to each oracle H0 (), H1 (). We then show how to use a single oracle H() to achieve thecombined functionality of both of them while only using q queries per round. 1/2 At a high level, the protocol, BA , works as follows: Operation: In each round, parties run two protocols in parallel. The first protocol is protocol PL (Fig. 6), which maintains the transaction ledger and requires q queries to the oracle H0 (). The second process is a transaction production protocol tx (Fig. 7), which continuously generates transactions satisfying predicate (3). The protocol makes q queries to the H1 () oracle. Termination: When the ledger reaches 2k blocks, a party prunes the last k blocks, collects all the unique POW transactions that are present in the ledger and returns the majority bit from the bits occuring in these transactions (note that uniqueness takes also the nonce of each transaction into account).

33 1/2 As described, protocol BA does not conform to the q-bounded setting since parties requireq queries to oracle H0 () and q queries to oracle H1 () to perform the computation of a singleround (the setting imposes a bound of q queries to a single oracle for all parties). Note that anave simulation of H0 (), H1 () by a single oracle H() in the (2q)-bounded setting (e.g., by settingHb (x) = H(b, x)) would violate the restriction imposed on each oracle individually, since nothingwould prevent the adversary, for example, from querying H0 () 2q times. Next, we show how we cancombine the two protocols into a single protocol that utilizes at most q queries to a single randomoracle in a way that the adversary will remain q-bounded for each oracle. This transformation, 1/2explained below, completes the description of BA .2-for-1 POWs. We now tackle the problem of how to turn a protocol operation that uses twoseparate POW subprocedures involving two distinct and independent oracles H0 (), H1 () into aprotocol that utilizes a single oracle H() for a total number of q queries per round. Our transfor-mation is general and works for any pair of protocols that utilize H0 (), H1 (), provided that certain 1/2conditions are met (which are satisfied by protocol BA above). In more detail, we consider twoprotocols 0 , 1 that utilize a POW step as shown in Algorithm 6 in Figure 8.

Figure 8: The 2-for-1 POW transformation.

In order to achieve composition of the two protocols 0 , 1 in the q-bounded setting with accessto a single oracle H(), we will substitute steps 2-11 in both protocols with a call to a new function,double-pow, defined below. First, observe that in b , b {0, 1}, the POW steps 2-11 operate withinput wb and produce output in Bb if the POW succeeds. The probability of obtaining a solutionis D 2 . The modification consists in changing the structure of the POWs from pairs of the form (w, ctr)

34to triples of the form (w, ctr, label), where label is a -bit string that is neutral from the point ofview of the proof. This will further require the modification of the verification step for POWs inboth protocols 0 , 1 in the following manner. Any verification step in 0 of a POW hw0 , ctri which is of the form H(ctr, G(w0 )) < D, will now operate with a POW of the form hw0 , ctr, labeli and will verify the relation H(ctr, hG(w0 ), labeli) < D.

Any verification step in 1 of a POW hw1 , ctri which is of the form H(ctr, G(w1 )) < D, will now operate with a POW of the form hw1 , ctr, labeli and will verify the relation [H(ctr, hlabel, G(w1 )i)]R < D,

where [a]R denotes the reverse of the bitstring a.

This parallel composition strategy in the form of function double-pow is shown in Algorithm 7.Either or both the solutions it returns, B0 , B1 , may be empty if no solution is found. 1/2 Protocol BA will employ double-pow, which will substitute the individual POW operation ofthe two underlying protocols 0 , 1 as defined in lines 2-11 of Algorithm 6. The correctness of theabove composition strategy follows from the following simple observation.

Proof. It is easy to see that each event happens with probability D 2 . The conjunction of thetwo events involves the choice of an integer U which satisfies U < D and [U ]R < D. Observe thatbecause D = 2t , it follows that the conditioning on U < D leaves the t least significant bits of Uuniformly random while fixing the remaining t bits. It follows that the t most significant bitsof [U ]R are uniformly random in the conditional space U < D. The event [U ]R < D has probability(D/2t )/D = D2 and thus the two events are independent.

Proof. First observe that due to Lemma 19, the success probability for all parties to solve a proofof work of either kind in each round is q D2 and the events are independent with each other. Regarding Agreement, observe that it follows directly from Theorem 10 (common prefix) that 3all parties will return the majority of the same set with probability at least 1 e( k) . To show Validity, let C be the chain of an honest party upon termination of the protocol. Letr denote the greatest round on which a block of C dk was computed by an honest party. We arguethat the rest of the blocks in C dk , that must have been inserted by the adversary, were computedby round (1 + 2 )r. Assume the contrary and let r0 > (1 + 2 )r denote the least round on whichan honest player adopted the chain C (after round (1 + 2 )r). Let X denote the successful roundsfrom round r to round r0 and Z the number of POWs the adversary obtained in these rounds.Lemma 6 implies that the chain of every honest player advanced in length by X blocks at least. Bythe definition of r0 , the adversary inserted all the blocks of C computed in these s = r0 r rounds. 2It follows that Z X. By Lemma 7 this occurs with probability at most e( s) . To finish theproof, recall that each block contains the aggregation of all broadcast transactions up to the roundit was computed. Thus, C dk contains POWs computed by honest parties during r rounds and, with

35high probability, POWs computed by the adversary during at most (1 + 2 )r rounds. By Lemma 7, 2the honest parties have computed the majority of the blocks with probability at least 1 e( s)and Validity is satisfied. Since s > r/2, we need to argue that r = (k). To see this, note that in(1 + 2 )r rounds the parties created a chain of length len(C dk ) = k. An application of the Chernoffbound shows that r = (k) with probability at least 1 e(k) . Finally note that it is easy to inferfrom Lemma 6 that the length of chain of all honest parties will reach 2k blocks in O(k) roundswith probability 1 e(k) .

Remark 8. Regarding strong validity in the multivalued BA setting, i.e., where the input domain isV and has a constant cardinality strictly larger than 2 we can adapt the above protocol to return theplurality from the values stored in the transactions that are found in the ledger. In order to ensurestrong validity by this modification we restrict the hashing power of the adversary to (1 )/|V |since this will ensure that the adversarys number of transactions cannot overturn the pluralityvalue as defined by the honest parties inputs (even if those are evenly distributed amongst them).

7 Summary and Directions for Future Work

In this paper we presented a formal treatment of the Bitcoin backbone, the protocol used at the coreof Bitcoins transaction ledger. We expressed and proved two properties of the backbone protocol common prefix and chain quality and showed how they can be used as foundations fordesigning Byzantine agreement and robust public transaction ledger protocols. Our results showthat an honest majority among the (equally equipped) participants suffices, assuming the networksynchronizes much faster than the proof of work rate (f 0 in our notation) and the proper inputs(e.g., transactions) are available to the honest majority25 , while the bound on the adversary forhonest parties to reach agreement degenerates as f gets larger. While these are encouraging results, we have demonstrated deviations that are of concern forthe proper operation of Bitcoin. Importantly, we show that as the network ceases to synchronizefast enough compared to the proof-of-work rate (i.e., the worst-case time that takes honest playersto hear each other becomes substantial compared to the time it takes to solve a proof of work),the honest majority property ceases to hold and the bound offered by our analysis that is requiredto obtain a robust transaction ledger approaches 0 as f approaches 1. Note that the effects of badsynchronization is in the maintenance of the common prefix property, which is the critical propertyfor showing agreement. A second important concern is regarding the chain quality property, where our results show thatif an adversary controls a hashing power corresponding to then the ratio of the blocks it cancontribute to the blockchain is bounded but can be strictly bigger than . When gets close to1/2, our bounds show that the honest players contributions approach 0 in our security model. The above caveats in the two basic properties of the backbone have repercussions on the Per-sistence and Liveness properties of the Bitcoin ledger. Firstly, they illustrate that fast informationpropagation amongst honest players is essential for transaction persistence. Secondly, they showthat transaction liveness becomes more fragile as the adversarial power gets close to 1/2. Notethat we achieve Liveness for any adversarial bound less than 1/2 but we do not assume any upperbound on the number of transactions that may be inserted in a block26 ; it is obvious that the fewer 25 Our formalization is a way to formally express what perhaps was Nakamotos intuition when he wrote aboutBitcoin that it takes advantage of the nature of information being easy to spread but hard to stifle [Nak09]. 26 In the current Bitcoin implementation there is an upper bound of 1MB for blocks, hence the number transactionsper block is limited.

36blocks the honest miners get into the blockchain the harder may be for a transaction to get through.Furthermore, the fact that chain quality demonstrably fails to preserve a one-to-one correspondencebetween a partys hashing power and the ratio of its contributions to the ledger point to the factthat Bitcoins rewarding mechanism is not incentive compatible (cf. [ES14]). Assuming the hashingpower of the honest parties exceeds the adversarys hashing power by a factor , we showthat the adversarys contributions to the ledger are bounded by 1/ a result we show to betight in our rushing adversary model. In this way our results flesh out the incentive compatibilityproblems of the Bitcoin backbone, but (on a more positive note) they also point to the fact thathonest hashing-power majority is sufficient to maintain the public ledger (under favorable networkconditions), and hence suggest that the Bitcoin protocol can work as long as the majority of theminers want it to work (without taking into account the rationality of their decision). The above observations apply to the setting where the number of participants is fixed. In thedynamic setting (where the number of parties running the protocol may change from round toround), given the flat model that we consider, the difficulty D of the blockchain may be calibratedaccording to the number of players n that are active in the system. If D is set by an omniscienttrusted party then the analysis carries in a straightforward way but otherwise, if D is somehowcalculated by the parties themselves, the adversary can try to exploit its calculation. Note that inthis case the maxvalid function would need to take the difficultys variability into account and thuschoose the most difficult chain (as opposed to the longest). Comparing chains based on difficultyis simply done by computing the length of a chain by counting blocks proportionally to how difficultthey are (for example, a block whose difficulty is two times larger than a given difficulty value wouldcontribute twice as much in length). Interesting open questions include the security analysis of the Bitcoin backbone protocol in arational setting as opposed to honest/malicious, in the dynamic setting where the parties themselvesattempt to recalibrate the difficulty based on some metric (e.g., the time that has passed duringthe generation of a certain number of blocks), and in a concurrent/universal composition settingas opposed to standalone. Furthermore, the substitution of the random oracle assumption witha suitable computational assumption, as well as the development of backbone modifications thatimprove its characteristics in terms of common prefix and chain quality. In terms of the ledgerapplication, transaction processing times (i.e., reducing the wait time parameter u in the Livenessproperty) is also an interesting question with implications to practice (since real world paymentsystems benefit greatly from fast transaction confirmation and verification). In all these cases, ourwork offers a formal foundation that allows analyzing the security properties of tweaks on thebackbone protocol (such as the randomization rule of [ES14] or the GHOST rule in [SZ13] usedin Ethereum27 ) towards meeting the above goals. We remark that follow-up work to the present paper has examined additional backbone protocolproperties, protocols and model extensions. For instance, the chain growth property, introducedin [KP15], enables one to abstract the blockchain feature of being able to grow unhindered by theadversary. While this is a quite simple property to prove for the Bitcoin backbone (and thus itwas not given a special treatment in the present work), it becomes far more complex in alternativeblockchain protocols such as those using the GHOST rule [SZ13]; see [KP16] for an analysis of suchprotocols. In [PSS16], Pass et al. put forth a property called self-consistence, which refers to theinability of the adversary to make honest parties disagree with themselves as the protocol advances.Chain growth and self-consistence are useful if one wants to do a black-box reduction of Persistenceand Liveness of the ledger to the underlying properties of the blockchain. [PSS16] also studies therobustness of transaction ledger in the partially synchronous setting [DLS88], where messages may 27 https://www.ethereum.org/

37not be delivered at the end of a round, but there is still a certain bound within which all messagesare eventually delivered. Another set of interesting directions include the development of other applications that may bebuilt on top of the backbone protocol such as secure multiparty computation with properties suchas fairness and guaranteed output delivery (current works in this direction, e.g., [ADMM14, BK14a,BK14b], assume an idealized version of the Bitcoin system).