<<

Fast and secure global payments with Stellar

Marta Lokhava, Giuliano Losa*, David Mazières, Graydon Hoare, Nicolas Barry, Eli Gafni†, Jonathan Jove, Rafał Malinowsky, and Jed McCaleb Stellar Development Foundation Abstract Mexico, two neighboring countries. End users pay nearly $9 International payments are slow and expensive, in part be- for the average such transfer [32], and a bilateral agreement cause of multi-hop payment routing through heterogeneous brokered by the countries’ central banks could only reduce banking systems. Stellar is a new global payment network the underlying bank cost to $0.67 per item [2]. On top of fees, that can directly transfer digital money anywhere in the the latency of international payments is generally counted world in seconds. The key innovation is a secure transaction in days, making it impossible to get money abroad quickly in mechanism across untrusted intermediaries, using a new emergencies. In countries where the banking system doesn’t Byzantine agreement protocol called SCP. With SCP, each work or doesn’t serve all citizens, or where fees are intol- institution specifies other institutions with which to remain erable, people resort to sending payments by bus [38], by in agreement; through the global interconnectedness of the boat [19], and occasionally now by [55], all of which financial system, the whole network then agrees on atomic incur risk, latency, or inconvenience. transactions spanning arbitrary institutions, with no sol- While there will always be compliance costs, evidence sug- vency or exchange-rate risk from intermediary asset issuers gests a significant amount is lost to lack of competition21 [ ], or market makers. We present SCP’s model, protocol, and which is exacerbated by inefficient technology. Where people formal verification; describe the Stellar payment network; can innovate, prices and latencies go down. For instance, re- and finally evaluate Stellar empirically through benchmarks mittances from bank accounts in Q2 2019 cost an average of and our experience with several years of production use. 6.99%, while the figure for mobile money was only 4.88%[13]. An open, global payment network that attracts innovation CCS Concepts • Security and privacy → Distributed and competition from non-bank entities could drive down systems security; • Computer systems organization → costs and latencies at all layers, including compliance [83]. Peer-to-peer architectures; • Information systems → This paper presents Stellar, a -based payment Electronic funds transfer. network specifically designed to facilitate innovation and Keywords blockchain, BFT, quorums, payments competition in international payments. Stellar is the first system to meet all three of the following goals (under a ACM Reference Format: novel but empirically valid “Internet hypothesis”): Marta Lokhava, Giuliano Losa, David Mazières, Graydon Hoare, Nicolas Barry, Eli Gafni, Jonathan Jove, Rafał Malinowsky, Jed Mc- 1. Open membership – Anyone can issue -backed Caleb. 2019. Fast and secure global payments with Stellar. In SOSP digital tokens that can be exchanged among users. ’19: Symposium on Operating Systems Principles, October 27–30, 2. Issuer-enforced finality – A token’s issuer can prevent 2019, Huntsville, ON, Canada. ACM, New York, NY, USA, 17 pages. transactions in the token from being reversed or undone. https://doi.org/10.1145/3341301.3359636 3. Cross-issuer atomicity – Users can atomically exchange and trade tokens from multiple issuers. 1 Introduction Achieving the first two is easy. Any company can uni- International payments are notoriously slow and costly [32]. laterally offer a product such as Paypal, Venmo, WeChat Consider the impracticality of sending $0.50 from the U.S. to Pay, or Alipay and ensure the finality of payments in the *Galois, Inc. virtual they have created. Unfortunately, transact- † UCLA ing atomically across these currencies is impossible. In fact, Permission to make digital or hard copies of all or part of this work for despite Paypal having acquired Venmo’s parent company personal or classroom use is granted without fee provided that copies are not in 2013, it is still impossible for end users to send Venmo made or distributed for profit or commercial advantage and that copies bear dollars to Paypal users [78]. Only recently can merchants this notice and the full citation on the first page. Copyrights for components even accept both with a single integration. of this work owned by others than ACM must be honored. Abstracting with Goals 2 and 3 can be achieved in a closed system. In partic- credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request ular, a number of countries have efficient domestic payment permissions from [email protected]. networks, typically overseen by a universally trusted regula- SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada tory authority. However, membership is limited to a closed © 2019 Association for Computing Machinery. set of chartered banks and the networks are limited to the ACM ISBN 978-1-4503-6873-5/19/10...$15.00 reach of a country’s regulatory authority. https://doi.org/10.1145/3341301.3359636 SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada Lokhava et al.

Goals 1 and 3 have been achieved in mined , The next section discusses related work. Section 3 presents most notably in the form of ERC20 tokens on [3]. SCP. Section 4 describes our formal verification of SCP. Sec- The key idea of these blockchains is to create a new cryp- tion 5 describes Stellar’s payment layer. Section 6 relates tocurrency with which to reward people for making settled some of our deployment experience and lessons learned. transactions hard to revert. Unfortunately, this means to- Section 7 evaluates the system. Section 8 concludes. ken issuers do not control transaction finality. If software errors cause transactions history to be reorganized [26, 73], 2 Related work or when the spoils of defrauding people exceed the cost of reorganizing history [74, 97], issuers may be liable for tokens The system described in this paper is collectively our third they have already redeemed for real-world money. attempt to realize a decentralized payment network. The The Stellar blockchain has two distinguishing properties. first attempt, by one of the authors, resulted in the Ripple First, it natively supports efficient markets between tokens blockchain. While still in existence, we believe Ripple can- not realize the vision of a truly open payment network for from different issuers. Specifically, anyone can issue a token, the blockchain provides a built-in orderbook for trade be- both governance and technical reasons. The governance rea- tween any pair of tokens, and users can issue path payments sons derive from tension between shareholder interests and that atomically trade across several currency pairs while network users, but are beyond the scope of this paper. The guaranteeing an end-to-end limit price. technical issue is that Ripple’s Byzantine agreement proto- col [89] requires nearly closed membership [33], making it Second, Stellar introduces a new Byzantine agreement functionally similar to conventional Byzantine agreement. protocol, SCP (Stellar Consensus Protocol), through which token issuers designate specific validator servers to enforce The second attempt, a short-lived of the Ripple code stellard transaction finality. So long as no one compromises anis- base called , went live in July, 2014. We had planned to stellard suer’s validators (and the underlying digital signatures and develop SCP and slot it into when ready, but instead cryptographic hashes remain secure), the issuer knows ex- decided to build a new system from scratch around SCP, called stellar-core and described in this paper. stellar-core actly which transactions have occurred and avoids the risk was released along with a description and proof of SCP [68] of losses from blockchain history reorganization. SCP’s key idea is that most asset issuers benefit from in April, 2015, and entered production use 5 months later. liquid markets and want to facilitate atomic transactions An Internet draft [20] later described SCP for implementors. with other assets. Hence, validator administrators configure SCP’s motivation and structure are similar to asymmet- their servers to agree with other validators on the exact ric trust in multiparty computation [40], though that model requires nodes to have a global view of the adversary struc- history of all transactions on all assets. A validator v can be 1 ture. By introducing a notion of quorum slices, SCP enjoys configured to agree with v , or v can be configured to agree 2 2 discoverability and dynamic membership that are impor- with v1, or both may be configured to agree with each other; in all cases, neither will commit to a transaction history until tant to Stellar’s deployment. Personal Byzantine quorum it knows the other cannot commit to a different history. systems [47] and asymmetric distributed trust [29] general- By transitivity, if v cannot disagree with v and v can- ize SCP’s quorums and simplify comparison to traditional 1 2 2 systems. In a more restricted setting, Gotsman et al. [49] also not disagree with v (or vice versa), v cannot disagree with 3 1 study a generalization of Stellar’s quorums. v3, whether or not v3 represents assets v1 has even heard of. Under the hypothesis that these agreement relationships Several other blockchains have adopted SCP, including transitively connect the whole network, SCP guarantees MobileCoin [7] and NCNT. Ripple also more recently pro- global agreement, making it a global Byzantine agreement posed an open-membership Byzantine agreement protocol protocol with open membership. We call this new connect- called Cobalt [66]. SCP’s safety is optimal, so SCP is safe in any failure scenario where Cobalt is, while the converse is edness assumption the Internet hypothesis, and note that it unclear. However, Cobalt claims its safety condition is eas- holds of both “the Internet” (which everyone understands to mean the single largest transitively connected IP network) ier to understand and thus less prone to misconfiguration, and legacy international payments (which are hop-by-hop which will be interesting to evaluate if Cobalt gets deployed. non-atomic, but leverage a transitively connected, global network of financial institutions). 2.1 Systems without open membership Stellar has been in production use since September, 2015. Like many consensus protocols, SCP is based on voting [50, To keep the blockchain length manageable, the system runs 94] in a quorum system. Previous work on quorum sys- SCP at 5-second intervals—fast by blockchain standards, but tems [52, 67, 72], sometimes called “survivor sets” [57], stud- far slower than typical applications of Byzantine agreement. ies quorum systems that are static, i.e., fixed throughout Though the primary use has been payments, Stellar has also system execution, and uniform, i.e., where all nodes have the proven appealing for non-money fungible tokens that benefit same notion of what a quorum is. SCP’s setting is different in from immediate secondary markets (see Section 7.1). that different nodes accept different and evolving quorums. 2 Fast and secure global payments with Stellar SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada

Heterogeneous fast consensus [91] allows more nuanced amortized over an arbitrary-sized batch of transactions, con- notions of trust to be expressed via labels in a lattice and strained only by political issues and compatibility. Bitcoin- leverages this to optimize communication, but it assumes NG [45] uses to elect a leader who coordinates closed membership. a larger batch of transactions. Thunderella [84] can use proof- Other efforts to adapt Byzantine agreement protocols of-work as a fallback “slow path” and optimistically confirm to Blockchain-like settings, including HoneyBadger [70], transactions much faster using an asynchronous consensus SBFT [53], and HotStuff [99], have focused on scalability protocol when an accelerator node and 3/4 of an elected com- to many participants and performance over wide-area net- mittee are honest. Though SCP is faster than proof-of-work, works, retaining the traditional closed-membership model. it requires more messages than Thunderella’s fast path, but Blockchains targeting closed membership have leveraged could potentially be a useful Thunderella slow path. such protocols, including most recently Libra [11]. An alternative to proof of work is [59], in which miners obtain influence either directly or indi- rectly from asset ownership. In some cases, influence in- 2.2 Systems without issuer-enforced finality creases with the time assets have been held. Some schemes Bitcoin [71] was the first fungible digital asset without a encourage honesty by confiscating miners’ stake if they trusted authority to track balances. It simultaneously solved misbehave [27, 28, 41]. Delegated proof-of-stake [9, 61] has two problems: how to distribute a new asset so people believe nodes vote their stake to elect representatives for a conven- it has value, and how to provide irreversible transactions that tional Byzantine agreement protocol such as PBFT [31]. Algo- prevent double-spend attacks. Bitcoin creates assets through rand [51] uses verifiable random functions to elect represen- proof-of-work [43], which its author compares to gold min- tative nodes pseudorandomly, with probability proportional ers investing resources to increase the supply of gold. The to holdings. Snow White [39] formalizes the proved work depends on transaction history, which thwarts security properties required in proof of stake, accommodat- double-spend attacks because rolling back transactions re- ing “sleepy” nodes that go on and off line. quires work comparable to creating the original history. Though most proof-of-stake schemes cannot be brute- Attacks on proof-of-work blockchains become feasible forced with expensive computation, the cost to acquire stake once an attacker controls 1/3 of mining power [46, 48]. Proof- or bribe miners is still related to the value of the under- of-work is particularly risky for new or smaller blockchains [15, lying cryptocurrency and outside an asset issuer’s control. 23]; established miners have been known to divert mining Even in the absence of malicious miners, bugs can also cause power to smaller chains for profit10 [ , 54, 74, 97, 98] or just to blockchain reorganization [26, 73]. Hence, unlike with SCP, create problems [25, 37] (so-called “Goldfinger attacks”60 [ ]). issuers have no way to ensure blockchain finality before At times, miners have benevolently mounted such “51% at- redeeming on-chain tokens for a real-world wire transfer or tacks” to roll back the undesired effects of bugs95 [ ]. New cash withdrawal. blockchains can gain some protection from 51% attacks by leveraging more established blockchains with merged min- 3 Stellar consensus protocol ing [6] or proof of burn [79]. The Stellar consensus protocol (SCP) is a quorum-based As of this writing, a 51% attack is estimated to cost $823,000/ Byzantine agreement protocol with open membership. Quo- hour on Bitcoin, $93,000/hour on Ethereum, and under $20,000/ hour for all other tracked blockchains [12]. Ultimately, these rums emerge from the combined local configuration deci- costs depend on the value of the cryptocurrency incentiviz- sions of individual nodes. However, nodes only recognize ing the mining, which is independent of the value of issued quorums to which they belong themselves, and only after assets. By contrast, the cost of compromising Stellar valida- learning the local configurations of all other quorum mem- bers. One benefit of this approach is that SCP inherently tors is somewhat under the control of their administrators; tolerates heterogeneous views of what nodes exist. Hence, SCP is amenable to high-assurance implementations, such as using hardware security modules to prevent a validator from nodes can join and leave unilaterally with no need for a signing contradictory messages. As an additional benefit, “view change” protocol to coordinate membership. Stellar has no mining costs to recoup through transaction fees or seigniorage. 3.1 Federated Byzantine agreement Bitcoin’s massive energy consumption [76] has motivated The traditional Byzantine agreement problem consists of a more energy-efficient variations of proof of work suchas closed system of N nodes, some of which are faulty and may [16, 17, 44, 87], proof of storage [18, 56, 86, 90], behave arbitrarily. Nodes receive input values and exchange and proof of elapsed time [4]. messages to decide on an output value among the inputs. Proof of work can be slow, with blocks of transactions A Byzantine agreement protocol is safe when no two well- taking minutes to confirm and multiple blocks required for behaved nodes output different decisions and the unique stronger security. However, the work to mine a block can be decision was a valid input (for some definition of valid agreed 3 SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada Lokhava et al. upon beforehand). A protocol is live when it guarantees that slices it ever uses in the changing-slices case (see Theorem every honest node eventually outputs a decision. 13 in [68]). As explained in Section 4, liveness depends on Typically, protocols assume N = 3f + 1 for some integer well-behaved nodes eventually removing unreliable nodes f > 0, then guarantee safety and some form of liveness so from their slices. long as at most f nodes are faulty. At some stage in these Because different nodes have different agreement require- protocols, nodes vote on proposed values and a proposal ments, FBA precludes a global definition of safety. We say receiving 2f + 1 votes, called a quorum of votes, becomes non-faulty nodes v1 and v2 are intertwined when every the decision. With N = 3f + 1 nodes, any two quorums of quorum of v1 intersects every quorum of v2 in at least one size 2f + 1 overlap in at least f + 1 nodes; even if f of these non-faulty node. An FBA protocol can ensure agreement overlapping nodes are faulty, the two quorums share at least only between intertwined nodes; since SCP does so, its fault one non-faulty node, preventing contradictory decisions. tolerance for safety is optimal. The Internet hypothesis, However, this approach only works if all nodes agree on underlying Stellar’s design, states that the nodes people care what constitutes a quorum, which is impossible in SCP where about will be intertwined. two nodes may not even know of each other’s existence. We say a set of nodes I is intact if I is a uniformly non- With SCP, each node v unilaterally declares sets of nodes, faulty quorum such that every two members of I are inter- called its quorum slices, such that (a) v believes that if all twined even if every node outside of I is faulty. Intuitively, members of a slice agree about the state of the system, then then, I should remain impervious to the actions of non-intact they are right, and (b) v believes that at least one of its slices nodes. SCP guarantees both non-blocking liveness [93] and will be available to provide timely information about the safety to intact sets, though nodes themselves do not need state of the system. We call the resulting system, consisting to know (and may not be able to know) which sets are intact. of nodes and their slices, a Federated Byzantine Agreement Furthermore, the union of two intact sets that intersect is (FBA) system. As we will see next, a quorum system emerges an intact set. Therefore, intact sets define a partition of the from nodes’ slices. well-behaved nodes, where each partition is safe and live Informally, an FBA node’s slices express with whom the (under some conditions), but different partitions may output node requires agreement. E.g., a node may require agree- divergent decisions. ment with 4 specific organizations, each running 3 nodes; to accommodate downtime, it may set its slices to be all sets consisting of 2 nodes from each organization. If this “requires 3.1.1 Safety vs. Liveness considerations in FBA agreement with” relation transitively relates any two nodes, With limited exceptions [64], most closed Byzantine agree- we get global agreement. Otherwise, we can get divergence, ment protocols are tuned to the equilibrium point at which but only between organizations neither of which requires safety and liveness have the same fault tolerance. In FBA, agreement with the other. Given the topology of today’s that means configurations in which, regardless of failures, all financial system, we hypothesize that widespread conver- intertwined sets are also intact. Given that FBA determines gence will keep producing a singe history people call quorums in a decentralized way, it is unlikely that individ- “the Stellar network,” much as we speak of the Internet. ual slice choices will lead to this equilibrium. Moreover, at Quorums arise from slices as follows. Every node specifies least in Stellar, equilibrium is not desirable: the consequences its quorum slices in every message it sends. Let S be the of a safety failure (namely double-spent digital money) are set of nodes from which a set of messages originated. A far worse than those of a liveness failure (namely delays node considers the set of messages to have reached quorum in payments that anyway took days before Stellar). People threshold when every member of S has a slice included in S. therefore should and do select large quorum slices such that By construction, such a set S, if unanimous, satisfies the their nodes are more likely to remain intertwined than intact. agreement requirements of each of its members. Further tipping the scales, it is easier to recover from A faulty peer may advertise slices crafted to change what typical liveness failures in an FBA system than in a tradi- well-behaved nodes consider quorums. For the sake of proto- tional closed one. In closed systems, all messages must be col analysis, we define a quorum in FBA to be a non-empty interpreted with respect to the same set of quorums. Hence, set S of nodes encompassing at least one quorum slice of adding and removing nodes to recover from failure requires each non-faulty member. This abstraction is sound, as any set reaching consensus on a reconfiguration event, which is diffi- of messages purporting to represent a unanimous quorum cult once consensus is no longer live. By contrast, with FBA, actually does (even if it contains messages from faulty nodes), any node can unilaterally adjust its quorum slices at any and it is precise when S contains only well-behaved nodes. In time. In response to an outage at a systemically important this section, we also assume that nodes’ slices do not change. organization, node administrators can adjust their slices to Nevertheless, our results transfer to the changing-slice case work around the problem, a bit like coordinating responses because a system in which slices change is no less safe than to BGP catastrophes [63] (though without the constraints of a fixed-slice system in which a node’s slices consist of allthe routing over physical network links). 4 Fast and secure global payments with Stellar SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada

3.1.2 The cascade theorem intact set, Q is a quorum of any member of I, and S is any SCP follows the template of the basic round model [42]; superset of Q, then either S ⊇ I or there is a member v ∈ I nodes progress through a series of numbered ballots, each such that v < S and I ∩ S is v-blocking. Intuitively, were this attempting three tasks: (1) identify a “safe” value not con- not the case, the complement of S would contain a quorum tradicted by any decision in a previous ballot (often termed that intersects I but not Q, violating quorum intersection. preparing the ballot), (2) agree on the safe value, and (3) de- Note that if we start with S = Q and repeatedly expand S to tect that agreement was successful. However, FBA’s open include all nodes it blocks, we obtain a cascading effect until, membership stymies several common techniques, making it eventually, S encompasses all of I. impossible to “port” traditional closed protocols to the FBA 3.2 Protocol description model by simply changing the definition of quorum. One technique employed by many protocols is rotating SCP is a partially synchronous consensus protocol [42] con- through leader nodes in round-robin fashion following time- sisting of a series of attempts to reach consensus called outs. In a closed system, round-robin leader selection ensures ballots. Ballots employ timeouts of increasing duration. A that eventually a unique honest leader ends up coordinat- ballot-synchronization protocol ensures that nodes stay on ing agreement on a single value. Unfortunately, round-robin the same ballot for increasing periods of time until the ballots cannot work in an FBA system with unknown membership. are effectively synchronous. Termination is not guaranteed Another common technique that fails with FBA is assum- until ballots are synchronous, but two synchronous ballots ing a particular quorum can convince all nodes. For instance, in which faulty members of well-behaved nodes’ slices do if everyone recognizes any 2f + 1 nodes as a quorum, then not interfere are sufficient for SCP to terminate. 2f + 1 signatures suffice to prove protocol state to all nodes. A balloting protocol specifies the actions taken during each Similarly, if a node receives a quorum of identical messages ballot. A ballot begins with a prepare phase, in which nodes through reliable broadcast [24], the node can assume all non- try to determine a value to propose that does not contradict faulty nodes will also see a quorum. In FBA, by contrast, a any previous decision. Then, in a commit phase, nodes try quorum means nothing to nodes outside the quorum. to make a decision on the prepared value. Finally, non-federated systems often employ “backwards” Balloting employs an agreement sub-protocol called fed- reasoning about safety: if f + 1 nodes are faulty, all safety erated voting, in which nodes vote on abstract statements guarantees are lost. Hence, if node v hears f + 1 nodes all that may eventually be confirmed or get stuck. Some state- state some fact F, v can assume at least one is telling the ments might be designated contradictory, and the safety truth (and hence that F is true) with no loss of safety. Such guarantee of federated voting is that no two members of an reasoning fails in FBA because safety is a property of pairs intertwined set confirm contradictory statements. Confirma- of nodes, so a node that has lost safety to some peers can tion of a statement is not guaranteed except for an intact always lose safety to more nodes by assuming bad facts. set whose members all vote the same way. However, if a FBA can, however, reason backwards about liveness. De- member of an intact set does confirm a statement, federated fine a v-blocking set as a set of nodes that intersects every voting guarantees that all members of the intact set eventu- slice of v. If a v-blocking set B is unanimously faulty, B ally confirm that statement. Hence, taking irreversible steps can deny node v a quorum and cost it liveness. Hence, if in response to confirming statements preserves liveness for B unanimously states fact F, then v knows that either F is intact nodes. true or v is not intact. However, v still needs to see a full Nodes initially propose values obtained from a nomination quorum to know that intertwined nodes won’t contradict F, protocol that increases the chances of all members of an intact which leads to a final round of communication in SCP and set proposing the same value, and that eventually converges other FBA protocols [47] that is not required in analogous (though with no way to determine convergence is complete). closed-membership protocols. The result is that we have Nomination combines federated voting with leader selection. three possible levels of confidence in potential facts: indeter- Because round-robin is impossible in FBA, nomination uses minate, safe to assume among intact nodes (which we will a probabilistic leader-selection scheme. term accepted facts), and safe to assume among intertwined The cascade theorem plays a crucial role both in ballot nodes (which we will term confirmed facts). synchronization and in avoiding blocked states from which Node v can efficiently determine whether aset B is v- termination is no longer possible. blocking by checking whether B intersects all its slices. In- 3.2.1 Balloting terestingly, if nodes always announce the statements they accept and a full quorum accepts a statement, it sets off a cas- SCP nodes proceed through a series of numbered ballots, em- cading process by which statements propagate throughout ploying federated voting to agree on statements about which intact sets. We call the key fact underlying this propagation values are or are not decided in which ballots. If asynchrony the cascade theorem, which sates the following: If I is an or faulty behavior prevents reaching a decision in ballot n, nodes time out and try again in ballot n + 1. 5 SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada Lokhava et al.

Recall federated voting might not terminate. Hence, some vote-or-accept a accept a from quorum statements about ballots can get stuck in a permanently from quorum indeterminate state where nodes can never determine if they a is valid are still in progress or stuck. Because nodes cannot rule out voted a accepted a confirmed a the possibility of indeterminate statements later proving true, uncommitted accept a from they must never attempt federated voting on new statements blocking set contradicting indeterminate ones. voted ¬a In each ballot n, nodes use federated voting on two types of statement: Figure 1. Stages of federated voting • prepare ⟨n, x⟩ – states that no value other than x was or will ever be decided in any ballot ≤ n. • commit ⟨n, x⟩ – states x is decided in ballot n. allows members of an intact set to confirm one another’s nominated values while still withholding new votes. Importantly, note that prepare ⟨n, x⟩ contradicts commit The (evolving) result of nomination is a deterministic com- ⟨n′, x ′⟩ when n ≥ n′ and x x ′. , bination of all values in confirmed nominate statements. If A node starts ballot n by attempting federated voting on a x represents a set of transactions, nodes can take the union statement prepare ⟨n, x⟩. If any previous prepare statement of sets, the largest set, or the one with the highest hash, so was successfully confirmed through federated voting, the long as all nodes do the same. Because nodes withhold new node chooses x from the confirmed prepare of the high- votes after confirming one nominate statement, the set of est ballot. Otherwise, the node sets x to the output of the confirmed statements can contain only finitely many values. nomination protocol described in the next subsection. The fact that confirmed statements reliably spread through If and only if a node successfully confirms prepare ⟨n, x⟩ intact sets means intact nodes eventually converge on the in ballot n, it attempts federated voting on commit ⟨n, x⟩. If same set of nominated values and hence nomination result, that succeeds, it means SCP has decided, so the node outputs though at an unknown point arbitrarily late in the protocol. the value from the confirmed commit statement. Nodes employ federated leader selection to reduce the Consider an intertwined set S. Since at most one value number of different values in nominate statements. Only can be confirmed prepared by members of S in a given bal- a leader who has not already voted for a nominate state- lot, no two different values may be confirmed committed by ment may introduce a new x. Other nodes wait to hear from members of S in a given ballot. Moreover, if commit ⟨n, x⟩ leaders and just copy their leaders’ (valid) nominate votes. is confirmed, then prepare ⟨n, x⟩ was confirmed too; since To accommodate failure, the set of leaders keeps growing as prepare ⟨n, x⟩ contradicts any earlier commit for a differ- timeouts occur, though in practice only a few nodes intro- ent value, by the agreement guarantees of federated voting duce new values of x. we get that no different value may be decided in an earlier ballot by members of S. By induction on ballot numbers, we 3.2.3 Federated voting therefore get that SCP is safe. Federated voting employs a three-phase protocol shown in For liveness, consider an intact set I and a long enough Figure 1. Nodes try to agree on abstract statements by first synchronous ballot n. If faulty nodes appearing in the slices voting, then accepting, and finally confirming statements. of well-behaved nodes do not interfere in n, then by ballot A node v may vote for any valid statement a that does not n + 1 all members of I have confirmed the same set P of pre- contradict its other outstanding votes and accepted state- pare statements. If P = ∅ and ballot n was long enough, the ments. It does so by broadcasting a signed vote message. nomination protocol will have converged on some value x. v then accepts a if a is consistent with other accepted state- Otherwise, let x be the value from the prepare with the high- ments and either (case 1) v is a member of a quorum in which est ballot in P. Either way, I will uniformly attempt federated each node either votes for a or accepts a, or (case 2) even if v voting on prepare ⟨n + 1, x⟩ in the next ballot. Therefore, if didn’t vote for a, a v-blocking set accepts a. In case 2, v may n + 1 is also synchronous, a decision for x inevitably follows. have previously cast votes contradicting a, which have now 3.2.2 Nomination been overruled. v is allowed to forget about overruled votes and pretend it never cast them because if v is intact, it knows Nomination entails federated voting on statements: overruled votes cannot complete a quorum through case 1. • nominate x – states x is a valid decision candidate. v broadcasts that it accepts a, then confirms a when it is in Nodes may vote to nominate multiple values—different a quorum that unanimously accepts a. Figure 2 shows the nominate statements are not contradictory. However, once effect of v-blocking sets and the cascade theorem during a node confirms any nominate statement, it stops voting to federated voting. nominate new values. Federated voting still allows a node to Two intertwined nodes cannot confirm contradictory state- confirm new nominate statements it didn’t vote for, which ments, as the two required quorums would have to share a 6 Fast and secure global payments with Stellar SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada

Vote Accept Accept Vote X Accept X X X X

3 3 3 3 3 Vote Vote Vote Accept Accept Accept Vote Accept X X X X X X X X

4 2 4 2 4 2 4 2 4 2

Vote Accept Accept Accept 1 1 1 X 1 X 1 X X

Vote Vote Accept Accept 5 Y 5 Y 5 X 5 X 5 Vote Y Vote Vote Vote Vote Vote Vote Accept Accept Y Y Y Y Y Y X X

6 7 6 7 6 7 6 7 6 7

(a) (b) (c) (d) (e)

Figure 2. Cascade effect in federated voting. Each node has one quorum slice indicated by arrows to members of theslice. (a) Contradictory statements X and Y are introduced. (b) Nodes vote for valid statements. (c) Node 1 accepts X after its quorum {1, 2, 3, 4} unanimously votes for X. (d) Nodes 1, 2, 3, and 4 all accept X; set {1} is 5-blocking, so node 5 accepts X, overruling its previous vote for Y. (e) Set {5} is 6- and 7-blocking, so 6 and 7 both accept X.

non-faulty node that could not accept contradictory state- For instance, Stellar uses Hi (m) = SHA256(i∥b∥r ∥m), where ments. Confirmation of a statement is not guaranteed: in b is the overall SCP instance (block or ledger number), r is 256 case of a split vote, both statements may be permanently the leader selection round number, and hmax = 2 . Within stuck waiting for a quorum in the voting phase. However, if a round, we define the priority of node v as: a node in an intact set I confirms a statement, the cascade priority(v) = H (v) theorem and accept case 2 ensure that all of I will eventually 1 confirm that statement. One strawman would be for each node to choose as leader the node v with the highest priority(v). This approach works 3.2.4 Ballot synchronization well with nearly identical quorum slices, but doesn’t properly If nodes are unable to confirm a commit statement for the capture the importance of nodes in imbalanced configura- current ballot, they give up after a timeout. The timeout gets tions. For instance, if Europe and China each contribute 3 longer with each ballot so as to adjust to arbitrary bounds nodes to every quorum, but China runs 1,000 nodes and Eu- on network delay. rope 4, then China will have the highest-priority node 99.6% However, timeouts alone are not sufficient to synchro- of the time. nize ballots of nodes that did not start at the same time or We therefore introduce a notion of slice weight, where got desynchronized for other reasons. To achieve synchro- weight(u,v) ∈ [0, 1] is the fraction of node u’s quorum slices nization, nodes start the timer only once they are part of a containing node v. When node u is selecting a new leader, it quorum that is all at the current (or a later) ballot n. This only considers neighbors, defined as follows: slows down nodes that started early and ensures that no neighbors(u) = { v | H (v) < h · weight(u,v)} member of an intact set stays too far ahead of the group. 0 max Moreover, if a node v ever notices a v-blocking set at a later A node u then starts with an empty set of leaders, and at each ballot, it immediately skips to the lowest ballot such that this round adds to it the node v in neighbors(u) with the highest is no longer the case, regardless of any timers. The cascade priority(v). If the neighbors set is empty in any round, u in- theorem then ensures that all stragglers catch up. The result stead adds the nodev with lowest value of H0(v)/weight(u,v). is that ballots are roughly synchronized throughout an intact set once the system becomes synchronous. 4 Formal verification of SCP 3.2.5 Federated leader selection To eliminate design errors, we formally verified SCP’s safety Leader selection allows each node to pick leaders in such a and liveness properties (see [65]). Specifically, we verified way that nodes generally only choose one or a small number that intertwined nodes never disagree and that, under condi- of leaders. To accommodate leader failure, leader selection tions discussed below, every member of an intact set even- proceeds through rounds. If leaders of the current round tually decides. Interestingly, verification revealed that the appear not to be fulfilling their responsibilities, then after a conditions under which SCP guarantees liveness are subtle, certain timeout period nodes proceed to the next round to and stronger than initially thought [68]: as discussed below, expand the set of leaders that they follow. malicious nodes that manipulate timing without otherwise Each round employs two unique cryptographic hash func- deviating from the protocol may need to be manually evicted tions, H0 and H1, that output integers in the range [0, hmax). from quorum slices. 7 SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada Lokhava et al.

To ensure that the properties proved hold in all possible set of ledger entries of four distinct types: accounts, trustlines, FBA configurations and executions, we consider an arbitrary offers, and account data. number of nodes with arbitrary local configurations. This Accounts are the principals that own and issue assets. Each includes scenarios with disjoint intact sets, as well as poten- account is named by a public key. By default, the corre- tially infinitely long executions. The drawback is that we sponding private key can sign transactions for the account. face the challenging problem of verifying a parameterized However, accounts can be reconfigured to add other sign- infinite-state system. ers and deauthorize the key that names the account, with a To keep verification tractable, we modeled SCP in first- “multisig” option to require multiple signers. Each account order logic (FOL) using Ivy [69] and the methodology of [82]. also contains: a sequence number (included in transactions The verification process consists of manually providing in- to prevent replay), some flags, and a balance in a “native” ductive conjectures that are then automatically checked by pre-mined cryptocurrency called XLM, intended to mitigate Ivy. The FOL model of SCP abstracts over some aspects of some denial-of-service attacks and facilitate market making FBA systems that are difficult to handle in FOL (e.g., the as a neutral currency. cascade theorem is taken as an axiom), so we verify the Trustlines track the ownership of issued assets, which are soundness of the abstraction using Isabelle/HOL [75]. named by a pair consisting of the issuing account and a short After expressing the verification problem in FOL, we ver- asset code (e.g., “USD” or “EUR”). Each trustline specifies ify safety by providing an inductive invariant. The inductive an account, an asset, the account’s balance in that asset, a invariant consists of a dozen one-line conjectures for about limit above which the balance cannot rise, and some flags. 150 lines of protocol specification. We then specify SCP’s live- An account must explicitly consent to holding an asset by ness properties in Ivy’s Linear Temporal Logic and use the creating a trustline, preventing spammers from saddling liveness to safety reduction of [80, 81] to reduce the liveness accounts with unwanted assets. verification problem to the problem of finding an inductive Know-your-customer (KYC) regulations require many fi- invariant. While SCP’s safety is relatively straightforward to nancial institutions to know whose deposits they are holding, prove, SCP’s liveness argument is much more intricate and for instance by checking photo ID. To comply, issuers can set consists of around 150 single-line invariants. an optional auth_reqired flag on their accounts, restrict- Proving liveness required a precise formalization of the ing ownership of the assets they issue to authorized accounts. assumptions under which SCP ensures termination. We ini- To grant such authorization, the issuer sets an authorized tially thought an intact set I would always terminate if all flag on customers’ trustlines. members removed faulty nodes from their slices [68]. How- Offers correspond to an account’s willingness to trade up ever, this turned out to be insufficient: a well-behaved (but to a certain amount of a particular asset for another at a given not intact) node in a quorum of a member of I can, under the price on the order book; they are automatically matched and influence of faulty nodes, prevent termination by completing filled when buy/sell prices cross. Finally, account data con- a quorum just before the end of a ballot, thereby causing sists of account, key, value triples, allowing account holders members of I to chose different values of x in the next ballot. to publish small metadata values. We must therefore additionally assume that, informally, To prevent ledger spam, there is a minimum XLM balance, each node in a quorum of a member of I eventually either called the reserve. An account’s reserve increases with each becomes timely or doesn’t send messages at all for a suf- associated ledger entry and decreases when the ledger entry ficient period. In practice, this means members of I may disappears (e.g., when an order is filled or canceled, or when a need to adjust their slices until the condition holds. This trustline is deleted). Currently the reserve grows by 0.5 XLM issue is not inherent to FBA systems: Losa et al. [47] present (∼$0.03) per ledger entry. Regardless of the reserve, it is a protocol whose liveness depends on the strictly weaker possible to reclaim the entire value of an account by deleting assumptions of just eventual synchrony and eventual leader- it with an AccountMerge operation. election, without the need to remove faulty nodes from slices. A ledger header, shown in Figure 3, stores global attributes: a ledger number, parameters such as the reserve balance per ledger entry, a hash of the previous ledger header (actually 5 Payment network several hashes forming a skiplist), the SCP output including This section describes Stellar’s payment network, imple- a hash of new transactions applied at this ledger, a hash of mented as a replicated state machine [88] on top of SCP. the results of those transactions (e.g., success or failure for each), and a snapshot hash of all ledger entries. Because the snapshot hash includes all ledger contents, 5.1 Ledger model validators need not retain history to validate transactions. Stellar’s ledger is designed around an account abstraction (in However, to scale to hundreds of millions of anticipated contrast to the more coin-centric unspent transaction output accounts, we cannot rehash all ledger entry tables on every or UTXO model of Bitcoin). The ledger contents consists of a ledger close. Moreover, it is not practical to transfer a ledger 8 Fast and secure global payments with Stellar SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada

ledger # = 4 ledger # = 5 weight for some operations (such as SetOptions) and lower for others (such as AllowTrust). H(prev hdr) H(prev hdr) Transactions are atomic—if any operation fails, none of SCP output SCP output ... them execute. This simplifies multi-way deals. Suppose an H ∗(results) H ∗(results) issuer creates an asset to represent land deeds, and user A wants to exchange a small land parcel plus $10,000 for a H ∗(snapshot) H ∗(snapshot) . . bigger land parcel owned by B. The two users can both sign . . a single transaction containing three operations: two land header header payments and one dollar payment. A transaction’s main validity criterion is its sequence num- Figure 3. Ledger contents. H is SHA-256, while H ∗ repre- ber, which must be one greater than that of the transaction’s sents hierarchical or recursive application of H. SCP output source account ledger entry. Executing a valid transaction also depends the previous header hash. (successfully or not) increments the sequence number, pre- venting replay. Initial sequence numbers contain the ledger CreateAccount Create and fund new account ledger entry number in the high bits to prevent replay even after deleting AccountMerge Delete account ledger entry and re-creating an account. SetOptions Change account flags and signers The other validity criterion is an optional limit on when Payment Pay specific quantity of asset to dest. acct. a transaction can execute. Returning to the land and dollar PathPayment Like Payment, but pay in different asset (up swap above, if A signs the transaction before B, A may not to limit); specify up to 5 intermediary assets want B to sit on the transaction for a year before submitting ManageOffer Create/delete/change offer ledger entry, it, and so could place a time limit invalidating the transaction -PassiveOffer with passive variant to allow zero spread after a few days. Multisig accounts can also be configured ManageData Create/delete/change acct. data ledger entry to give signing weight to the revelation of a hash pre-image, ChangeTrust Create/delete/change trustline AllowTrust Set or clear authorized flag on trustline which, combined with time bounds, permits atomic cross- BumpSequence Increase seq. number on account chain trading [1]. A transaction’s source account pays a trivial fee in XLM, −5 Figure 4. Principal ledger operations 10 XLM unless there is congestion. Under congestion, the cost of operations is set by Dutch auction. Validators are not compensated by fees because validators are analogous of that size every time a node has been disconnected from to Bitcoin full nodes, not miners. Rather than destroy XLM, the network for too long. The snapshot hash is therefore fees are recycled and distributed proportionally by vote of designed to optimize both hashing and state reconciliation. existing XLM holders, which in retrospect might or might Specifically, the snapshot stratifies ledger entries bytime not have been worth the complexity. of last modification in a set of exponentially-sized containers called buckets. The collection of buckets is called the bucket 5.3 Consensus values list, and bears some similarity to log-structured merge-trees For each ledger, Stellar uses SCP to agree on a data structure (LSM-trees) [77]. The bucket list is not read during trans- with three fields: a transaction set hash (including ahash action processing (see Section 5.4). Hence, certain design of the previous ledger header), a close time, and upgrades. aspects of LSM-trees can be relaxed. In particular, random When multiple values are confirmed nominated, Stellar takes access by key is not required, and buckets are only ever read the transaction set with the most operations (breaking ties sequentially as part of merging levels. Hashing the bucket by total fees, then transaction set hash), the union of all list is done by hashing each bucket as it is merged and calcu- upgrades, and the highest close time. A close time is only lating a new cumulative hash of the bucket hashes (a small, valid if it is between the last ledger’s close time and the fixed index of reference hashes) at each ledger close. Reconcil- present, so nodes do not nominate invalid times. ing the bucket list after disconnection requires downloading Upgrades adjust global parameters such as the reserve bal- only buckets that differ. ance, minimum operation fee, and protocol version. When combined during nomination, higher fees and protocol ver- 5.2 Transaction model sion numbers supersede lower ones. Upgrades effect gover- A transaction consists of a source account, validity criteria, a nance through a federated-voting tussle space [34], neither memo, and a list of one or more operations. Figure 4 lists avail- egalitarian nor centralized. Each validator is configured as able operations. Each operation has a source account, which either governing or non-governing (the default), according defaults to that of the overall transaction. A transaction must to whether its operator wants to participate in governance. be signed by keys corresponding to every source account in Governing validators consider three kinds of upgrade: an operation. Multisig accounts can require higher signing desired, valid, and invalid (anything the validator does not 9 SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada Lokhava et al.

other validators stellar-core’s SQL database, minimizing the risk of horizon destabilizing stellar-core. Features such as payment path find- ing are implemented entirely in horizon and can be upgraded submit core horizon client unilaterally without coordinating with other validators. Several optional higher-layer daemons are clients to hori- client zon, rounding out the ecosystem. A bridge server facilitates FS DB DB integration of Stellar with existing systems, e.g., posting no- tifications of all payments received by a specific account. A validator compliance server provides hooks for financial institutions to exchange and approve of sender and beneficiary information Figure 5. Stellar validator architecture on payments, for compliance with sanctions lists. Finally, a federation server implements a human-readable naming system for accounts. know how to implement). Desired upgrades are configured to trigger at a specific time, intended to be coordinated among operators. Governing nodes always vote to nominate desired 6 Deployment experience upgrades, accept but do not vote to nominate valid upgrades Stellar grew for several years into a state with a moderate (i.e., go along with a blocking quorum), and never vote for number of reasonably-reliable full node operators. However, or accept invalid upgrades. Non-governing validators echo nodes’ configurations were such that liveness (though not any vote they see for a valid upgrade, essentially delegating safety) depended on us, the Stellar Development Foundation the decision on what upgrades are desired to those who opt (SDF); had SDF suddenly disappeared, other node operators for a governance role. would have needed to intervene and manually remove us from quorum slices for the network to continue. 5.4 Implementation While we and many others want to reduce SDF’s sys- Figure 5 shows Stellar’s validator architecture. A daemon temic importance, this goal received increasing priority after called stellar-core (∼92k lines of C++, not counting third- researchers [58] quantified and publicized the network’s cen- party libraries) implements the SCP protocol and the repli- tralization without differentiating the risks to safety and cated state machine. Producing values for SCP requires reduc- liveness. A number of operators reacted with active config- ing large numbers of ledger entries to small cryptographic uration adjustments, primarily increasing the size of their hashes. By contrast, transaction validation and execution quorum slices in an effort to dilute SDF’s importance; ironi- requires looking up account state and order matching at cally this only increased the risk to liveness. the best price. To serve both functions efficiently, stellar-core Two problems exacerbated the situation. First, a popular keeps two representations of the ledger: an external represen- third-party Stellar monitoring tool [5] was systematically tation containing the bucket list, stored as binary files that overestimating validator uptime by not actually verifying can be efficiently updated and incrementally rehashed, and that stellar-core was running; this lead people to include an internal representation in a SQL database (PostgreSQL unreliable nodes in their quorum slices. Second, a bug in for production nodes). stellar-core meant once a validator moved to the next ledger, Stellar-core creates a write-only history archive containing it didn’t adequately help remaining nodes complete the pre- each transaction set that was confirmed and snapshots of vious ledger in the event of lost messages. As a result, the buckets. The archive lets new nodes bootstrap themselves network experienced 67 minutes of downtime and required when joining the network. It also provides a record of ledger manual coordination by validator administrators to restart. history—there needs to be some place one can look up a Worse, while attempting to restart the network, simulta- transaction from two years ago. Since history is append-only neous rushed reconfigurations on multiple nodes resulted and accessed infrequently, it can be kept in cheap places in a collective misconfiguration that allowed some nodes to such as Amazon Glacier or any service allowing one to store diverge, requiring a manual shutdown of those nodes and and retrieve flat files. Validator hosts typically do nothost resubmission of the transactions accepted during the diver- their own archives so as to avoid any impact on validation gence. Luckily, this divergence was caught and corrected performance from serving history. quickly and contained no conflicting transactions, but the To keep stellar-core simple, it is not intended to be used risk of the network failing to enjoy quorum intersection— directly by applications and exposes only a very narrow in- splitting while continuing to accept potentially conflicting terface for the submission of new transactions. To support transactions, simply due to misconfiguration—was made clients, most validators run a daemon called horizon (∼18k very concrete by this incident. lines of Go) that provides an HTTP interface for submitting Reviewing these experiences led to two major conclusions and learning of transactions. horizon has read-only access to and corresponding corrective actions. 10 Fast and secure global payments with Stellar SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada

Critical, 100% more serious failure mode than halting—the network needs to be able to detect misconfiguration immediately so that op- 51% ... 51% erators can revert it before any divergence actually hapens.

High, 67% To address this need, we built a mechanism into the val- idator software that continuously gathers the collective con- 51% ... 51% figuration state of all the peers in the node’s transitive clo- sure and detects the potential for divergence—i.e., disjoint Medium, 67% quorums—within that collective configuration. 51% ... 51%

Low, 67% 6.2.1 Checking quorum intersection 51% ... 51% While gathering quorum slices is easy, finding disjoint quo- rums among them is co-NP-hard [62]. However, we adopted Figure 6. Validator quality hierarchy. Highest quality nodes a set of algorithmic heuristics and case-elimination rules require the highest threshold of 100%, whereas lower quali- proposed by Lachowski [62] that check typical instances ties are configured to 67% threshold. Nodes within a single of the problem several orders of magnitude faster than the organization require a simple 51% majority. worst-case cost. Practically speaking, the current network’s quorum slice transitive closures are on the order of 20–30 nodes and, with Lachowski’s optimizations, typically check 6.1 Configuration complexity and fragility in a matter of seconds on a single CPU. Should the need arise Stellar expresses quorum slices as nested quorum sets consist- to enhance performance, we may parallelize the search. ing of n entries and a threshold k where any set of k entries constitutes a quorum slice. Each of the n entries then is either 6.2.2 Checking risky configurations a validator public key or, recursively, another quorum set. Detecting that the network admits disjoint quorums is a step While flexible and compact, we realized nested quorum in the right direction, but flags the danger uncomfortably late sets simultaneously afforded node operators too much flexi- for such a critical issue. Ideally, we want node operators to re- bility and too little guidance: it was easy to write unsafe (or ceive warnings when the network’s collective configuration even nonsensical) configurations. The criteria for grouping is merely approaching a risky state. nodes into sets, for organizing subsets into a hierarchy, and We therefore extended the quorum-intersection checker for choosing thresholds were all insufficiently clear and con- to detect a condition we call criticality: when the current tributed to operational failures. It wasn’t clear whether to collective configuration is one misconfiguration away from treat a “level” in the nested-set hierarchy as a level of trust, a state that admits disjoint quorums. To detect criticality, or an organization, or both; many configurations in the field the checker repeatedly replaces each organization’s configu- mixed these concepts, in addition to specifying dangerous ration with a simulated worst-case misconfiguration, then or meaningless thresholds. re-runs the inner quorum intersection checker on the result. We therefore added a simpler configuration mechanism If any such critical misconfiguration exists one step away that separates two aspects of nested quorum sets: grouping from the current state, the software issues a warning and organization nodes together by , and labeling each organiza- reports the organization posing a misconfiguration risk. tion with a simple trust classificationlow ( , medium, high, or These changes give the community of operators two layers critical). Organizations at and above high are required to of notice and guidance to insulate against the worst forms publish history archives. The new system synthesizes nested- of collective misconfiguration. quorum sets in which each organization is represented as a 51% threshold set, and organizations are grouped into sets with 67% or 100% thresholds (depending on group quality). 7 Evaluation Each group is a single entry in the next (higher quality) group, To understand Stellar’s suitablity as a global payment and as illustrated in Figure 6. This simplified model reduces the trading network, we evaluated the state of the public network likelihood of misconfiguration, both in terms of the structure and ran controlled experiments on a private experimental of the synthesized nested sets and the thresholds chosen for network. We focused on the following questions: each set. • What does the production network topology look like? 6.2 Proactive detection of misconfiguration How many messages are broadcast on average, and Second, we realized that detecting collective misconfigura- how does SCP experience timeouts? tion by waiting to observe its negative effects is too late. Espe- • Do consensus and ledger update latencies remain in- cially with respect to misconfigurations that can diverge—a dependent of the number of accounts? 11 SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada Lokhava et al.

• How are latencies affected by increasing (a) transac- tions per second (and, consequently, transactions per ledger), and (b) the number of validator nodes? • What is the cost of running a node in terms of CPU, memory, and network bandwidth? Payment networks have low transaction rates compared to other types of distributed system. The leading blockchains, Bitcoin and Ethereum, confirm up to 15 transactions/second, less than Stellar. Moreover, these systems take minutes to an hour to confirm a transaction securely, because proof-of- work requires waiting for several blocks to be mined. The non-blockchain SWIFT network averaged only 420 transac- tions per second on its peak day [14]. We therefore chose to compare our measurements against the 5-second target ledger interval, a more aggressive target. Our results show that latencies are comfortably below this limit even with Figure 7. Quorum slice map several unimplemented optimizations still in the pipeline. obligations), it would have been difficult to recruit 5 tier one 7.1 Anchors organizations from the start, however. This suggests quorum The top traded assets by volume include currency (e.g., 3 USD slices play a useful role in network bootstraping: anyone can anchors, 2 CNY), a Bitcoin anchor, a real-estate-backed se- join with the goal of becoming an important player because curity token [92], and an in-app currency [8]. Different an- there are no gatekeepers to pairwise agreement. chors have different policies. For instance, one USD anchor, There are currently over 3.3M accounts in the ledger. Over Stronghold, sets auth_reqired and requires a know-your- a recent 24-hour period, Stellar averaged 4.5 transactions and customer (KYC) process for every account that holds their 15.7 operations per second. Reviewing recent ledgers, most assets. Another, AnchorUSD, let’s anyone receive and trade transactions seem to have a single operation, while every few their USD (making it literally possible to send $0.50 to Mexico ledgers we see transactions containing many operations that in 5 seconds with a fee of $0.000001). However, AnchorUSD appear to come from market makers managing offers. The does require KYC and fees to purchase or redeem their USD mean times to achieve consensus and update the ledger were with conventional wire transfers. In the Philippines, where 1061 ms and 46 ms, respectively. The 99th percentiles were bank regulations are laxer for incoming payments, coins.ph 2252 ms and 142 ms (the former reflecting a 1-second timeout supports cashing out PHP at any ATM machine [36]. In ad- in nomination leader selection). Note SCP’s performance is dition to the aforementioned security token and in-app cur- mostly independent of transactions per second, since SCP rency, there’s a range of non-currency tokens ranging from agrees on a hash of arbitrarily many transactions. Bottle- commercial bonds [22] and carbon credits [85, 96] to more necks are more likely to arise from propagating candidate esoteric assets such as a token incentivizing collaborative transactions during nomination, executing and validating car repossession [35]. transactions, and merging buckets. We have not yet needed to parallelize stellar-core’s transaction processing over multi- 7.2 Public network ple CPU cores or disk drives. As of this writing, there are 126 active full nodes, 66 of which We also evaluated the number of SCP messages broadcast participate in consensus by signing vote messages. Figure 7 on the production network. In the normal case with a single (generated by [5]) visualizes the network, with a line between leader elected to nominate a value, we expect seven logical two nodes if one appears in the other’s quorum slices and a messages to be broadcast: two messages to vote and accept darker blue line to show bi-directional dependence. At the a nominate statement, two messages to accept and confirm center is a cluster of 17 de facto “tier-one validators” run by a prepare statement, two message to accept and confirm SDF, SatoshiPay, LOBSTR, COINQVEST, and Keybase. a commit statement, and finally, an externalize message Four months ago, before the events of Section 6, there (sent after committing a new ledger to disk to help stragglers were 15 systemically important nodes: 3 from seemingly catch up). The implementation combines confirm commit tier-one organizations and several random singletons. The and externalize messages as an optimization, since it is graph also looked much less regular. Hence, the new config- safe to externalize a value after it is committed. We then ana- uration mechanism and/or better operator decisions seem lyze metrics gathered on a production Stellar validator. Over to be contributing to a healthier network topology. Without the course of 68 hours, 1.3 messages/second were emitted, great financial resources (and corresponding shareholder averaging to 6-7 messages per ledger. We note that the total 12 Fast and secure global payments with Stellar SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada

Number of Timeouts 2,000 Percentile Nomination Balloting Ledger update 75% 0 0 1,500 Balloting Nomination 99% 1 0 Max 4 1 1,000

Figure 8. Timeouts per ledger over 68 hours Latency [ms] 500

0 count of messages broadcast by validators is larger, since in 105 106 107 addition to federated voting messages, nodes also broadcast Accounts any transactions they learn about. Figure 8 shows the timeouts experienced by a production Figure 9. Latency as number of accounts increases validator over a period of 68 hours. Nomination timeouts are a measure of the (in)effectiveness of the leader election func- variance is due to scheduling limitations of the load genera- tion, while ballot timeouts depend heavily on the network . We observed that the number of transactions per ledger and potential message delays. The timeouts are consistent was consistent with our load generation rate, given ledger with the number of messages emitted: six messages in the closing every 5 seconds. Nomination, balloting, and ledger best case scenario, and at least seven messages if an addi- update showed mean latencies of 82.53 ms, 95.96 ms, and tional nomination round is needed. 174.08 ms, respectively. We observed that nomination latency 99th percentile is consistently under 61ms, with occasional 7.3 Controlled experiments spikes of roughly 1 second, corresponding to the first step We ran controlled experiments in containers packed onto in the timeout function of leader selection. Amazon EC2 c5d.9xlarge instances with 72 GiB of RAM, Given the baseline performance, we looked at the effects 900 GB of NVMe SSD, and 36 vCPUs. Each instance was in of varying each of the test setup parameters. the same EC2 region and had a fixed bandwidth of 10 Gbps. We used SQLite as a store. (Stellar also supports PostgreSQL, Accounts The data in Figure 9 suggests that Stellar scales but that has asynchronous tasks that inject noise into mea- well as the number of accounts increases. Generation of test surements.) accounts became a lengthy process, as bucket creation and Stellar provides a built-in runtime query, generateload, merging prevented us from simply populating the database that allows generating synthetic load at a specific target with accounts directly via SQL. Therefore, we conducted our transaction/second rate. Although Stellar supports various experiments for up to 50,000,000 accounts. While there is trading features, such as order book and cross-asset path minimal impact on consensus and ledger update latencies, payments, we focused on simple payments. we note that increasing accounts creates an overhead of Confirming transactions consists of multiple steps, sowe merging buckets, which get larger. recorded the measurements for each of the following: Transaction rate Transaction rate impacts the amount of • Nomination: time from nomination to first prepare traffic multicast among validators, the number of transac- • Balloting: time from first prepare to confirming a tions included in each ledger, and the size of the top level ballot committed buckets. To understand the effects of increasing transaction • Ledger update: time to apply consensus value load, we ran an experiment with 100,000 accounts and 4 val- • Transaction count: confirmed transactions per ledger idators. Each of our experiments was defined by three parameters: Figure 10 shows slow growth in the consensus latency, the number of account entries in the ledger, the amount of while the majority of time was spent updating the ledger. load (in the form of XLM payments) submitted per second, Not surprisingly, as the transaction set increases in size, it and the number of validators. We configured every validator takes longer to commit it to the database. We also note that to know about every other validator (a worst-case scenario ledger update latency is heavily implementation-dependent, for SCP), with quorum slices set to any simple majority of and is affected by the choice of the database. nodes (so as to maximize the number of different quorums). Validator nodes To see how increasing the number of tier- Baseline Our baseline experiment measured Stellar with one validators impacts performance, we ran experiments 100,000 accounts, four validators, and the load generation with 100,000 accounts, 100 transactions/second, and a vary- rate of 100 transactions/second. We observed 507 transac- ing number of validators from 4 to 43. All validators appeared tions per ledger on average, with standard deviation of 49 in all validators’ quorum slices; smaller quorum slices would (9.7%). Note that no transactions were dropped; the slight have a lesser impact on performance. 13 SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada Lokhava et al.

2,000 around 7% of CPU and 300 MiB of memory. In terms of net- Ledger update work traffic, with 28 connections to peers and a quorum size 1,500 Balloting Nomination of 34, the incoming and outgoing rates were 2.78 Mbit/s and 2.56 Mbit/s, respectively. Hardware required to run such a 1,000 process is inexpensive. In our case, the cost is $0.054/hour or about $40/month. Latency [ms] 500 7.5 Future work 0 100 150 200 250 300 350 These experiments suggest Stellar can easily scale 1–2 orders Load [transactions/second] of magnitude beyond today’s network usage. Because the performance demands have been so modest to date, Stellar Figure 10. Latency as transaction load increases leaves room for many straight-forward optimizations using well-known techniques. For example, transactions and SCP 2,000 messages are broadcast by validators using a naïve flooding Ledger update protocol, but should ideally use more efficient, structured 1,500 Balloting peer-to-peer multicast [30]. Additionally, database-heavy Nomination ledger update time can be improved through standard batch- 1,000 ing and prefetching techniques. Latency [ms] 500 8 Conclusion 0 International payments are expensive and take days. Fund 10 20 30 40 custody passes through multiple financial institutions in- Validators cluding correspondent banks and money transfer services. Because each hop must be fully trusted, it is difficult for new Figure 11. Latency as number of nodes increases entrants to gain market share and compete. Stellar shows how to send money around the world cheaply in seconds. The Changing the number of validating nodes on the network key innovation is a new open-membership Byzantine agree- impacts the number of SCP messages exchanged as well as ment protocol, SCP, that leverages the peer-to-peer structure the number of potential values during nomination. Figure 11 of the financial network to achieve global consensus under a shows nomination time growing at a relatively small rate. novel Internet hypothesis. SCP lets Stellar atomically commit While the data suggests that balloting is the bottleneck, we irreversible transactions across arbitrary participants who believe many scaling issues can be addressed by improving don’t know about or trust each other. That in turn guaran- Stellar’s overlay network to optimize network traffic. As tees new entrants access to the same markets as established expected, ledger update latency remained independent of players, makes it secure to get the best available exchange the number of nodes. rates even from untrusted market makers, and dramatically reduces payment latency. Close rate Lastly, we wanted to measure Stellar’s end-to- end performance by measuring how often ledgers are con- firmed and whether Stellar meets its 5-second target without Acknowledgments dropping any transactions. We observed average ledger close Stellar would not be where it is today without the early times of 5.03 s, 5.10 s, and 5.15 s as we increased account leadership of Joyce Kim or the tremendous contributions of entries, transaction rate, and number of nodes, respectively. Scott Fleckenstein and Bartek Nowotarski in building and The results suggest that Stellar can consistently close ledgers maintaining horizon, the Stellar SDK, and other key pieces under high load. of the Stellar ecosystem. We also thank Kolten Bergeron, Henry Corrigan-Gibbs, Candace Kelly, Kapil K. Jain, Boris 7.4 Running a validator Reznikov, Jeremy Rubin, Christian Rudder, Eric Saunders, One of the important features of Stellar is the low cost of Torsten Stüber, Tomer Weller, the anonymous reviewers, and running a validator, as anchors should run (or contract with) our shepherd Justine Sherry for their helpful comments on validators to enforce finality. SDF runs 3 production valida- earlier drafts. tors, all on c5.large AWS instances, which have two cores, 4 GiB of RAM and (R) Xeon(R) Platinum 8124M CPU Disclaimer Professor Mazières’s contribution to this pub- @ 3.00GHz processors. Inspecting resource usage on one lication was as a paid consultant, and was not part of his of these machines, we observed the Stellar process using Stanford University duties or responsibilities. 14 Fast and secure global payments with Stellar SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada

References [24] Gabriel Bracha. 1987. Asynchronous Byzantine Agreement Protocols. [1] [n.d.]. Atomic cross-chain trading. Information and Computation 75 (1987), 130–143. https://en.bitcoin.it/wiki/Atomic_cross-chain_trading. [25] Danny Bradbury. 2013. Feathercoin hit by massive attack. [2] [n.d.]. Directo a México Frequently Asked Questions. http://www.coindesk.com/feathercoin-hit-by-massive-attack/. https://www.frbservices.org/assets/resources/financial- [26] . 2013. Shaken by Blockchain Fork. services/directomexicofaq.pdf. (March 2013). https://bitcoinmagazine.com/articles/bitcoin-network- [3] [n.d.]. ERC20 Token Standard. shaken-by-blockchain-fork-1363144448/. https://theethereum.wiki/w/index.php/ERC20_Token_Standard. [27] Vitalik Buterin. 2014. Slasher: A Punitive Proof-of-Stake Algorithm. [4] [n.d.]. PoET 1.0 Specification. https://sawtooth.hyperledger.org/docs/ https://blog.ethereum.org/2014/01/15/slasher-a-punitive-proof-of- core/releases/latest/architecture/poet.html. stake-algorithm/. [5] [n.d.]. Stellar network visibility. https://stellarbeat.io. [28] Vitalik Buterin and Virgil Griffith. 2017. Casper the Friendly Finality [6] 2015. Merged mining specification. Gadget. arXiv:1710.09437. http://arxiv.org/abs/1710.09437. https://en.bitcoin.it/wiki/Merged_mining_specification. [29] Christian Cachin and Björn Tackmann. 2019. Asymmetric Distributed [7] 2017. MobileCoin. https://www.mobilecoin.com/whitepaper-en.pdf. Trust. arXiv:arXiv:1906.09314 https://arxiv.org/abs/1906.09314. [8] 2017. Mobius: A Universal Protocol Suite for the Blockchain [30] Miguel Castro, Peter Druschel, Anne-Marie Kermarrec, Animesh Ecosystem and Real World Data. https://crushcrypto.com/wp- Nandi, Antony Rowstron, and Atul Singh. 2003. SplitStream: content//2017/11/MOBI-Whitepaper.pdf. High-bandwidth Multicast in Cooperative Environments. In [9] 2018. The BitShares Blockchain. Proceedings of the 19th Symposium on Operating Systems Principles. https://github.com/bitshares-foundation/bitshares.foundation/blob/ 298–313. master/download/articles/BitSharesBlockchain.pdf. [31] Miguel Castro and Barbara Liskov. 2002. Practical Byzantine Fault [10] 2018. ZenCash Statement On Double Spend Attack. https: Tolerance and Proactive Recovery. ACM Transactions on Computer //.zencash.com/zencash-statement-on-double-spend-attack/. Systems 20, 4 (Nov. 2002), 398–461. [11] 2019. An Introduction to Libra. https://libra.org/en-US/white-paper/. [32] Stephen Cecchetti and Kim Schoenholtz. 2018. The stubbornly high [12] 2019. PoW 51% Attack Cost. https://www.crypto51.app (retrieved cost of remittances. Aug. 29, 2019). https://voxeu.org/article/stubbornly-high-cost-remittances. [13] 2019. Remittance Prices Worldwide. Issue 30. https://remittanceprices. [33] Brad Chase and Ethan MacBrough. 2018. Analysis of the XRP Ledger worldbank.org/sites/default/files/rpw_report_june_2019.pdf. Consensus Protocol. arXiv:1802.07242. [14] 2019. SWIFT in Figures July 2019. https://www.swift.com/about- https://arxiv.org/abs/1802.07242v1. us/swift-fin-traffic-figures/monthly-figures. [34] David D. Clark, John Wroclawski, Karen R. Sollins, and Robert [15] Hussam Abboud. 2018. The Realistic Lucrative Case of Ethereum Braden. 2005. Tussle in Cyberspace: Defining Tomorrow’s Internet. Classic attack—Today. (May 2018). IEEE/ACM Transactions on Networking 13, 3 (June 2005), 462–475. https://medium.com/@HusamABBOUD/the-realistic-lucrative- [35] REPO Coin. [n.d.]. Bringing the $1 billion auto repossession industry case-of-ethereum-classic-attack-with-1mm-today-8fa0430a7c25. onto the blockchain. [16] Hamza Abusalah, Joël Alwen, , Danylo Khilko, Krzysztof https://www.repocoin.io/docs/Repo%20Coin-WhitePaper.pdf. Pietrzak, and Leonid Reyzin. 2017. Beyond Hellman’s Time-Memory [36] coins.ph. 2019. Cardless ATM Instant Cash Out. Trade-Offs with Applications to Proofs of Space. Cryptology ePrint https://coins.ph/atm-cash-pickup/ (retrieved Aug. 29, 2019). Archive, Report 2017/893. https://eprint.iacr.org/2017/893. [37] crazyearner. 2013. TERRACOIN ATTACK OVER 1.2TH ATTACK [17] Giuseppe Ateniese, Ilario Bonacina, Antonio Faonio, and Nicola CONFIRMD [sic]. https://bitcointalk.org/index.php?topic=261986.0. Galesi. 2014. Proofs of Space: When Space Is of the Essence. In [38] Jan Cronje. 2017. High bank charges force immigrants to send money Security and for Networks, Michel Abdalla and Roberto home “hand-to-hand”. https://www.groundup.org.za/article/high- De Prisco (Eds.). 538–557. bank-charges-force-immigrants-send-money-home-hand-hand/. [18] Giuseppe Ateniese, Randal Burns, Reza Curtmola, Joseph Herring, [39] Phil Daian, Rafael Pass, and Elaine Shi. 2016. Snow White: Provably Lea Kissner, Zachary Peterson, and Dawn Song. 2007. Provable Data Secure Proofs of Stake. Cryptology ePrint Archive, Report 2016/919. Possession at Untrusted Stores. In Proceedings of the 14th ACM https://eprint.iacr.org/2016/919. Conference on Computer and Communications Security (CCS ’07). [40] Ivan Damgård, Yvo Desmedt, Matthias Fitzi, and Jesper Buus Nielsen. 598–609. https://doi.org/10.1145/1315245.1315318 2007. Secure Protocols with Asymmetric Trust. In Advances in [19] Rachel Banning-Lover. 2015. Boatfuls of cash: how do you get money Cryptology – ASIACRYPT 2007, Kaoru Kurosawa (Ed.). Springer Berlin into fragile states? http://www.theguardian.com/global- Heidelberg, Berlin, Heidelberg, 357–375. development-professionals-network/2015/feb/19/boatfuls-of-cash- [41] Kourosh Davarpanah, Dan Kaufman, and Ophelie Pubellier. 2015. how-do-you-get-money-into-fragile-states. NeuCoin: the First Secure, Cost-efficient and Decentralized [20] Nicolas Barry, Giuliano Losa, David Mazieres, Jed McCaleb, and Cryptocurrency. http://www.neucoin.org/en/whitepaper/download. Stanislas Polu. 2018. The Stellar Consensus Protocol (SCP). [42] Cynthia Dwork, Nancy Lynch, and Larry Stockmeyer. 1988. Internet-Draft draft-mazieres-dinrg-scp-05. IETF Secretariat. Consensus in the Presence of Partial Synchrony. Journal of the ACM http://www.ietf.org/internet-drafts/draft-mazieres-dinrg-scp-05.txt 35, 2 (April 1988), 288–323. http://www.ietf.org/internet-drafts/draft-mazieres-dinrg-scp-05.txt. [43] Cynthia Dwork and Moni Naor. 1992. Pricing via Processing or [21] Thorsten Beck and María Soledad Martínez Peria. 2011. What Combatting Junk Mail. In Proceedings of the 12th Annual International Explains the Cost of Remittances? An Examination across 119 Cryptology Conference on Advances in Cryptology. 139–147. Country Corridors. The World Bank Economic Review 25, 1 (2011), [44] Stefan Dziembowski, Sebastian Faust, Vladimir Kolmogorov, and 105–131. Krzysztof Pietrzak. 2013. Proofs of Space. Cryptology ePrint Archive, [22] Bitbond. 2019. Securities Prospectus. https://www.bitbondsto.com/. Report 2013/796. https://eprint.iacr.org/2013/796. [23] Joseph Bonneau. 2018. Hostile blockchain takeovers. In Proceedings of [45] Ittay Eyal, Adem Efe Gencer, Emin Gün Sirer, and Robbert Van the 5th Workshop on Bitcoin and Blockchain Research. Renesse. 2016. Bitcoin-NG: A Scalable Blockchain Protocol. In http://www.jbonneau.com/doc/B18a-BITCOIN- Proceedings of the 13th USENIX Symposium on Networked Systems why_buy_when_you_can_rent.pdf Design and Implementation. Santa Clara, CA, 45–59. 15 SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada Lokhava et al.

[46] Ittay Eyal and Emin Gün Sirer. 2013. Majority is not Enough: Bitcoin [64] Jinyuan Li and David Mazières. 2007. Beyond One-third Faulty Mining is Vulnerable. http://arxiv.org/abs/1311.0243. Replicas in Byzantine Fault Tolerant Systems. In Proceedings of the 4th [47] Eli Gafni, Giuliano Losa, and David Mazières. 2019. Stellar Consensus Symposium on Networked Systems Design and Implementation. By Instantiation. In 33nd International Symposium on Distributed 131–144. Computing (DISC 2019). Schloss Dagstuhl-Leibniz-Zentrum fuer [65] Giuliano Losa. 2019. Formal Verification of SCP. Informatik. https://github.com/stellar/scp-proofs. [48] Juan Garay, Aggelos Kiayias, and Nikos Leonardos. 2015. The Bitcoin [66] Ethan MacBrough. 2018. Cobalt: BFT Governance in Open Networks. Backbone Protocol: Analysis and Applications. In Advances in arXiv:1802.07240v1. https://arxiv.org/abs/1802.07240v1. Cryptology - EUROCRYPT 2015. 281–310. [67] Dahlia Malkhi and Michael Reiter. 1998. Byzantine quorum systems. [49] Álvaro García-Pérez and Alexey Gotsman. 2018. Federated Byzantine 11, 4 (01 Oct 1998), 203–213. Quorum Systems. In 22nd International Conference on Principles of https://doi.org/10.1007/s004460050050 Distributed Systems (OPODIS 2018). Schloss [68] David Mazières. 2016. The Stellar Consensus Protocol: A Federated Dagstuhl-Leibniz-Zentrum fuer Informatik. Model for Internet-level Consensus. (February 2016). [50] David K. Gifford. 1979. Weighted Voting for Replicated Data. In https://www.stellar.org/papers/stellar-consensus-protocol.pdf. Proceedings of the Seventh ACM Symposium on Operating Systems [69] Kenneth L. McMillan and Oded Padon. 2018. Deductive Verification Principles (SOSP ’79). 150–162. https://doi.org/10.1145/800215.806583 in Decidable Fragments with Ivy. In International Static Analysis [51] Yossi Gilad, Rotem Hemo, Silvio Micali, Georgios Vlachos, and Symposium. Springer, 43–55. Nickolai Zeldovich. 2017. Algorand: Scaling Byzantine Agreements [70] Andrew Miller, Yu Xia, Kyle Croman, Elaine Shi, and Dawn Song. for . In Proceedings of the 26th Symposium on 2016. The Honey Badger of BFT Protocols. In Proceedings of the 2016 Operating Systems Principles (SOSP ’17). 51–68. ACM SIGSAC Conference on Computer and Communications Security https://doi.org/10.1145/3132747.3132757 (CCS ’16). 31–42. https://doi.org/10.1145/2976749.2978399 [52] Rachid Guerraoui and Marko Vukolić. 2010. Refined quorum systems. [71] . 2008. Bitcoin: A peer-to-peer electronic cash Distributed Computing 23, 1 (2010), 1–42. system. http://bitcoin.org/bitcoin.pdf. [53] Guy Golan Gueta, Ittai Abraham, Shelly Grossman, Dahlia Malkhi, [72] Moni Naor and Avishai Wool. 1998. The Load, Capacity, and Benny Pinkas, Michael K. Reiter, Dragos-Adrian Seredinschi, Orr Availability of Quorum Systems. SIAM J. Comput. 27, 2 (April 1998), Tamir, and Alin Tomescu. 2018. SBFT: a Scalable Decentralized Trust 423–447. https://doi.org/10.1137/S0097539795281232 Infrastructure for Blockchains. arXiv:1804.01626v1. [73] Arvind Narayanan. 2015. Analyzing the 2013 Bitcoin fork: centralized https://arxiv.org/abs/1804.01626v1. decision-making saved the day. (July 2015). [54] Dave Gutteridge. 2018. Japanese Cryptocurrency Monacoin Hit by https://freedom-to-tinker.com/2015/07/28/analyzing-the-2013- Selfish Mining Attack. CCN (May 2018). bitcoin-fork-centralized-decision-making-saved-the-day/. https://www.ccn.com/japanese-cryptocurrency-monacoin-hit-by- [74] Mark Nesbitt. 2019. Deep Chain Reorganization Detected on Ethereum selfish-mining-attack/. Classic (ETC). Technical Report. The Block. [55] Carlos Hernández. 2019. Bitcoin Has Saved My Family. The New York https://blog.coinbase.com/ethereum-classic-etc-is-currently-being- Times (February 23 2019). 51-attacked-33be13ce32de. https://www.nytimes.com/2019/02/23/opinion/sunday/venezuela- [75] Tobias Nipkow, Lawrence C. Paulson, and Markus Wenzel. 2002. bitcoin-inflation-cryptocurrencies.html. Isabelle/HOL: A Proof Assistant for Higher-Order Logic. Vol. 2283. [56] Ari Juels and Burton S. Kaliski, Jr. 2007. Pors: Proofs of Retrievability Springer Science & Business Media. for Large Files. In Proceedings of the 14th ACM Conference on [76] Karl J. O’Dwyer and David Malone. 2014. Bitcoin Mining and its Computer and Communications Security (CCS ’07). 584–597. Energy Footprint. In Irish Signals and Systems Conference. 280–285. https://doi.org/10.1145/1315245.1315317 [77] Patrick O’Neil, Edward Cheng, Dieter Gawlick, and Elizabeth O’Neil. [57] Flavio P. Junqueira, Keith Marzullo, Maurice Herlihy, and 1996. The log-structured merge-tree (LSM-tree). Acta Informatica 33, Lucia Draque Penso. 2010. Threshold protocols in survivor set 4 (June 1996), 351–385. systems. Distributed Computing 23, 2 (01 Oct 2010), 135–149. [78] Oregon11. 2018. Re: Venmo to Paypal payments. https://doi.org/10.1007/s00446-010-0107-3 https://www.paypal-community.com/t5/PayPal-Basics/Venmo-to- [58] Minjeong Kim, Yujin Kwon, and Yongdae Kim. 2019. Is Stellar As Paypal-payments/m-p/1520181#M15025. Secure As You Think?. In Proceedings of the IEEE Security & Privacy on [79] P4Titan. 2017. Slimcoin: A Peer-to-Peer Crypto-Currency with the Blockchain. Proof-of-Burn. https://github.com/slimcoin-project/slimcoin- [59] Sunny King and Scott Nadal. 2012. PPCoin: Peer-to-Peer project.github.io/raw/master/whitepaperSLM.pdf. Crypto-Currency with Proof-of-Stake. [80] Oded Padon, Jochen Hoenicke, Giuliano Losa, Andreas Podelski, http://peercoin.net/assets/paper/peercoin-paper.pdf. Mooly Sagiv, and Sharon Shoham. 2018. Reducing Liveness to Safety [60] Joshua A Kroll, Ian C Davey, and Edward W Felten. 2013. The in First-Order Logic. In 45th ACM SIGPLAN Symposium on Principles economics of Bitcoin mining, or Bitcoin in the presence of of Programming Languages (POPL 2018). Los Angeles. adversaries. In Proceedings of the Workshop on th eEconomics of [81] Oded Padon, Jochen Hoenicke, Kenneth L. McMillan, Andreas Information Security (WEIS). Podelski, Mooly Sagiv, and Sharon Shoham. 2018. Temporal Prophecy [61] Jae Kwon. 2014. Tendermint: Consensus without Mining. for Proving Temporal Properties of Infinite-State Systems. In 2018 http://tendermint.com/docs/tendermint.pdf. Formal Methods in Computer Aided Design (FMCAD). IEEE, 1–11. [62] Łukasz Lachowski. 2019. Complexity of the Quorum Intersection [82] Oded Padon, Giuliano Losa, Mooly Sagiv, and Sharon Shoham. 2017. Property of the Federated Byzantine Agreement System. Paxos Made EPR: Decidable Reasoning About Distributed Protocols. https://arxiv.org/abs/1902.06493. Proc. ACM Program. Lang. 1, OOPSLA (Oct. 2017), 108:1–108:31. [63] Khin Thida Latt, Yasuhiro Ohara, Satoshi Uda, and Yoichi Shinoda. [83] José Parra Moyano and Omri Ross. 2017. KYC Optimization Using 2010. Analysis of IP Prefix Hijacking and Traffic Interception. Technology. Business & Information Systems International Journal of Computer Science and Network Security 10, 7 Engineering 59, 6 (01 Dec 2017), 411–423. (July 2010), 22–31. [84] Rafael Pass and Elaine Shi. 2017. Thunderella: Blockchains with Optimistic Instant Confirmation. Technical Report 2017/913.

16 Fast and secure global payments with Stellar SOSP ’19, October 27–30, 2019, Huntsville, ON, Canada

Cryptography ePrint Archive. https://eprint.iacr.org/2017/913.pdf. [92] Smartlands. [n.d.]. https://rise.smartlands.io/. [85] Poseidon. 2019. Climate Rescue: Empowering People to Save the [93] Yee Jiun Song, Robbert van Renesse, Fred B. Schneider, and Danny Planet with Every Purachase. https: Dolev. 2008. The Building Blocks of Consensus. In Distributed //poseidon.eco/assets/documents/Poseidon-Climate-Rescue.pdf. Computing and Networking, Shrisha Rao, Mainak Chatterjee, Prasad [86] Protocol Labs. 2017. Proof of Replication. Jayanti, C. Siva Ram Murthy, and Sanjoy Kumar Saha (Eds.). 54–72. https://filecoin.io/proof-of-replication.pdf. [94] Robert H. Thomas. 1979. A Majority Consensus Approach to [87] Ling Ren and Srinivas Devadas. 2016. Proof of Space from Stacked Concurrency Control for Multiple Copy Databases. ACM Transactions Expanders. In Proceedings, Part I, of the 14th International Conference on Database Systems 4, 2 (June 1979), 180–209. on Theory of Cryptography – Volume 9985. 262–285. https://doi.org/10.1145/320071.320076 https://doi.org/10.1007/978-3-662-53641-4_11 [95] Greg Thomson. 2019. Coinbase Sides with (BCH) Miners [88] Fred B. Schneider. 1990. Implementing Fault-tolerant Services Using on 51% Attack Smack. CCN. https://www.ccn.com/coinbase-bitcoin- the State Machine Approach: A Tutorial. ACM Comput. Surv. 22, 4 cash-bch-miners-51-attack-smack/. (Dec. 1990), 299–319. https://doi.org/10.1145/98163.98167 [96] Veridium Labs. [n.d.]. https://www.veridium.io/. [89] David Schwartz, Noah Youngs, and Arthur Britto. 2014. The Ripple [97] Josiah Wilmoth. 2018. Hit by Double Spend Attack, Protocol Consensus Algorithm. Exchanges Lose Millions. CCN (May 2018). https://ripple.com/files/ripple_consensus_whitepaper.pdf. https://www.ccn.com/bitcoin-gold-hit-by-double-spend-attack- [90] Hovav Shacham and Brent Waters. 2008. Compact Proofs of exchanges-lose-millions/. Retrievability. In Proceedings of the 14th International Conference on [98] Josiah Wilmoth. 2018. Privacy Coin Succumbs to 51% Attack the Theory and Application of Cryptology and Information Security: [Again]. CCN (May 2018). https://www.ccn.com/privacy-coin-verge- Advances in Cryptology (ASIACRYPT ’08). 90–107. succumbs-to-51-attack-again/. https://doi.org/10.1007/978-3-540-89255-7_7 [99] Maofan Yin, Dahlia Malkhi, Michael K. Reiter, Guy Golan Gueta, and [91] Isaac C. Sheff, Robbert van Renesse, and Andrew C. Myers. 2014. Ittai Abraham. 2018. HotStuff: BFT Consensus in the Lens of Distributed Protocols and Heterogeneous Trust: Technical Report. Blockchain. arXiv:1803.05069. https://arxiv.org/abs/1803.05069. arXiv:1412.3136. https://arxiv.org/abs/1412.3136.

17