Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Protocol for Interledger Payments

tarcieri
September 22, 2016

A Protocol for Interledger Payments

tarcieri

September 22, 2016
Tweet

More Decks by tarcieri

Other Decks in Programming

Transcript

  1. “A highly intercommunicating decentralized structure shows far more resilience and

    likelihood of survival” — Nicholas Negroponte, “Being Digital”
  2. X

  3. The Bitcoin Lightning Network: Scalable O↵-Chain Instant Payments Joseph Poon

    [email protected] Thaddeus Dryja [email protected] January 14, 2016 DRAFT Version 0.5.9.2 Abstract The bitcoin protocol can encompass the global financial transac- tion volume in all electronic payment systems today, without a single custodial third party holding funds or requiring participants to have anything more than a computer using a broadband connection. A decentralized system is proposed whereby transactions are sent over a network of micropayment channels (a.k.a. payment channels or transaction channels) whose transfer of value occurs o↵-blockchain. If Bitcoin transactions can be signed with a new sighash type that addresses malleability, these transfers may occur between untrusted parties along the transfer route by contracts which, in the event of un- cooperative or hostile participants, are enforceable via broadcast over the bitcoin blockchain in the event of uncooperative or hostile partici- pants, through a series of decrementing timelocks. 1 The Bitcoin Blockchain Scalability Problem The Bitcoin[1] blockchain holds great promise for distributed ledgers, but the blockchain as a payment platform, by itself, cannot cover the world’s commerce anytime in the near future. The blockchain is a gossip protocol whereby all state modifications to the ledger are broadcast to all partic- ipants. It is through this “gossip protocol” that consensus of the state, everyone’s balances, is agreed upon. If each node in the bitcoin network must know about every single transaction that occurs globally, that may 1
  4. Figure 14: A fully revoked Commitment Transaction and terminated HTLC.

    If either party broadcasts Commitment 2, they will lose all their money to the counterparty. Other commitments (e.g. if Commitment 3 is the current Commitment) are not displayed for brevity. 39 ???
  5. A Protocol for Interledger Payments Stefan Thomas & Evan Schwartz

    { stefan,evan } @ripple.com Abstract We present a protocol for payments across payment sys- tems. It enables secure transfers between ledgers and allows anyone with accounts on two ledgers to cre- ate a connection between them. Ledger-provided es- crow removes the need to trust these connectors. Con- nections can be composed to enable payments between any ledgers, creating a global graph of liquidity or Interledger. Unlike previous approaches, this protocol requires no global coordinating system or blockchain. Transfers are escrowed in series from the sender to the recipient and executed using one of two modes. In the Atomic mode, transfers are coordinated using an ad-hoc group of notaries selected by the participants. In the Univer- sal mode, there is no external coordination. Instead, bounded execution windows, participant incentives and a “reverse” execution order enable secure payments be- tween parties without shared trust in any system or insti- tution. 1 Introduction Sending money today within any single payment system is relatively simple, fast and inexpensive. However, mov- ing money between systems is cumbersome, slow and costly, if it is possible at all. Digital payment systems use ledgers to track accounts and balances and to enable local transfers between their users. Today, there are few connectors facilitating pay- ments between these ledgers and there are high barriers to entry for creating new connections. Connectors are not standardized and they must be trusted not to steal the sender’s money. In this paper, we present a protocol for interledger pay- ments that enables anyone with accounts on two ledgers to create connections between them. It uses ledger- provided escrow—conditional locking of funds—to al- low secure payments through untrusted connectors. Any ledger can integrate this protocol simply by enabling escrowed transfers. Unlike previous approaches, our pro- tocol does not rely on any global coordinating system or ledger for processing payments—centralized [10] or de- centralized [15, 17, 19]. Our protocol lowers the barriers to facilitating interledger payments. Connectors compete to provide the best rates and speed. The protocol can scale to handle unlimited payment volume, simply by adding more connectors and ledgers. Composing connectors into chains enables pay- ments between any ledgers and give small or new pay- ment systems the same network effects as the most es- tablished systems. This can make every item of value spendable anywhere—from currencies to commodities, computing resources and social credit. Our protocol provides: • Secure payments through any connector using ledger-provided escrow. • The sender of a payment is guaranteed a crypto- graphically signed receipt from the recipient, if the payment succeeds, or else the return of their es- crowed funds. • Two modes of executing payments: In the Atomic mode, transfers are coordinated by an ad-hoc group of notaries selected by the participants to ensure all transfers either execute or abort. The Univer- sal mode instead uses bounded execution windows and incentives to remove the need for any mutually trusted system or institution.
  6. Lightning vs Interledger Lightning Network Interledger Pages in Paper 59

    25 Main Content 55 9 Flow Diagrams 14 2 Formal Specifications 0 14
  7. Connectors Client Balance Alice -10.01 USD Connector +10.01 USD Client

    Balance Bob +10 USD Connector' -10 USD Banana Bank CHEESEBANK
  8. The following sections describe our protocol in greater depth. Section

    2 introduces the core concepts of the protocol, including the actors involved and the need for ledger-provided escrow. Section 3 presents the Atomic mode. Section 4 presents the Universal mode. Sequence diagrams and the formal protocol specifications can be found in the Appendix. 2 Interledger Payments A ledger may be used to track anything of value—from currency or stocks to physical goods and titles—and may be centralized or decentralized [17]. As illustrated in Figure 1, payments between accounts in the same sys- tem are accomplished with a simple book transfer. Figure 1: Book transfer A connector is a system that facilitates interledger payments by coordinating book transfers on multiple ledgers. Connectors can also translate between different protocols used by these ledgers. As illustrated in Figure the payment correctly. This severely stitutions that can act as connectors, uncompetitive and disconnected glo Ledger-provided escrow guarantees funds will only be transferred to the ledger receives proof that the recipie crow also assures the connector that sender’s funds once they complete th ment. Figure 3: Funds are escrowed by the tor on their respective ledgers Ledgers
  9. Figure 1: Book transfer A connector is a system that

    facilitates interledger payments by coordinating book transfers on multiple ledgers. Connectors can also translate between different protocols used by these ledgers. As illustrated in Figure 2, connector Chloe accepts a transfer into her account on one ledger in exchange for a transfer out of her account on another ledger. Figure 2: Connector controls accounts on two ledgers The problem with existing payment protocols is that the sender must trust the connector to follow through on pay- ing the intended recipient. Nothing technically prevents Figure 3: Funds are escrowed by th tor on their respective ledgers Figure 4: The transfers to the conne either executed or aborted together The simple arrangement illustrated into arbitrarily long chains of con payments between any sender and brings the small-world network effe as the “six degrees of separation”) and creates a global graph of liquid 2.1 Byzantine and Rationa A truly open protocol for payments trusted actors for security. It must participation through built-in prote tially faulty, self-interested, or malic participants. Connectors
  10. ons describe our protocol in greater ntroduces the core concepts

    of the he actors involved and the need for ow. Section 3 presents the Atomic sents the Universal mode. Sequence rmal protocol specifications can be ix. Payments ed to track anything of value—from physical goods and titles—and may centralized [17]. As illustrated in between accounts in the same sys- d with a simple book transfer. the payment correctly. This severely limits the set of in- stitutions that can act as connectors, resulting in a highly uncompetitive and disconnected global payment system. Ledger-provided escrow guarantees the sender that their funds will only be transferred to the connector once the ledger receives proof that the recipient has been paid. Es- crow also assures the connector that they will receive the sender’s funds once they complete their end of the agree- ment. Figure 3: Funds are escrowed by the sender and connec- tor on their respective ledgers Escrow (Holds)
  11. centralized [17]. As illustrated in between accounts in the same

    sys- d with a simple book transfer. re 1: Book transfer system that facilitates interledger nating book transfers on multiple can also translate between different ese ledgers. As illustrated in Figure ccepts a transfer into her account on ge for a transfer out of her account Figure 3: Funds are escrowed by the sender and connec- tor on their respective ledgers Figure 4: The transfers to the connector and recipient are either executed or aborted together The simple arrangement illustrated here can be extended into arbitrarily long chains of connectors to facilitate payments between any sender and any recipient. This brings the small-world network effect (commonly known as the “six degrees of separation”) [3, 21] to payments and creates a global graph of liquidity or Interledger. 2.1 Byzantine and Rational Actors Transfers
  12. Trust Model n two ledgers cols is that the hrough

    on pay- ically prevents y, so they must ts to complete The simple arrangement illustrated here can be extended into arbitrarily long chains of connectors to facilitate payments between any sender and any recipient. This brings the small-world network effect (commonly known as the “six degrees of separation”) [3, 21] to payments and creates a global graph of liquidity or Interledger. 2.1 Byzantine and Rational Actors A truly open protocol for payments cannot rely on highly trusted actors for security. It must lower the barriers to participation through built-in protections against poten- tially faulty, self-interested, or malicious behavior by the participants. We use the Byzantine, Altruistic, Rational (BAR) model introduced by [2] for categorizing participants. Byzan- 2
  13. Trust Your Ledger(s) vide security even when participants are bound

    only by the algorithm itself. We assume that, as Rational actors, ledgers and connec- tors may require some fee to incentivize their participa- tion in a payment. These fees may be paid in the flow of the payment, or out of band. In this paper, we will only discuss the details of fees necessary to mitigate risks and attacks specific to interledger payments. While ledgers may be Byzantine, we do not attempt to introduce fault-tolerance—protection against accidental or malicious errors—for participants who hold accounts with such a ledger. Ledgers themselves can be made Byzantine fault-tolerant [15, 17, 19], and participants can choose the ledgers with which they hold accounts. We only seek to isolate participants who hold accounts on non-faulty ledgers from risk. We assume that connectors will agree to participate in a payment only if they face negligible or manageable risk for doing so, and that they will charge fees accord- ingly. Connectors will only deliver money on a destina- tion ledger if doing so benefits them directly. Any of the participants in a payment may attempt to over- load or defraud any of the other actors involved. Thus, escrow is needed to make secure interledger payments. or hash. The ledger when it is presented been met. Fig Figure 5 illustrates fer is proposed to made to the ledger. authorized the trans available and that a satisfied. The ledge transfer is prepared filled, the transfer is if an abort condition and the escrowed fu 3 Atomic Inte
  14. Cryptographic Escrow otocol for any reason, deliberate attempts to e

    the protocol. Altru- actly. Rational actors or deviate from the d long-term benefits. nt are either Rational n highly trusted actors tic—or bound by fac- ming the actors to be s the protocol to pro- ts are bound only by , ledgers and connec- tivize their participa- be paid in the flow of s paper, we will only y to mitigate risks and ents. we do not attempt to on against accidental ts who hold accounts acknowledgement that the recipient has received their payment. The recipient is assured by their ledger that they will be paid when they provide such an acknowl- edgement. Connectors also use their ledgers’ escrow to protect themselves from risk. Cryptographic signatures are a simple way for ledgers to securely validate the outcome of the external conditions upon which a transfer is escrowed. Any one-way func- tion can be used [18]. Using asymmetric cryptography, the ledger escrows funds pending the presentation of a valid signature for a pre-defined public key and message or hash. The ledger can then easily validate the signature when it is presented and determine if the condition has been met. Figure 5: Transfer states
  15. Transfer States low the protocol exactly. Rational actors sted and

    will follow or deviate from the ximize their short and long-term benefits. actors in the payment are either Rational Protocols that rely on highly trusted actors ume all to be Altruistic—or bound by fac- o the protocol. Assuming the actors to be or malicious requires the protocol to pro- ven when participants are bound only by tself. at, as Rational actors, ledgers and connec- re some fee to incentivize their participa- ent. These fees may be paid in the flow of r out of band. In this paper, we will only ails of fees necessary to mitigate risks and c to interledger payments. may be Byzantine, we do not attempt to -tolerance—protection against accidental rrors—for participants who hold accounts dger. Ledgers themselves can be made t-tolerant [15, 17, 19], and participants can gers with which they hold accounts. We solate participants who hold accounts on gers from risk. at connectors will agree to participate in y if they face negligible or manageable so, and that they will charge fees accord- ors will only deliver money on a destina- oing so benefits them directly. icipants in a payment may attempt to over- d any of the other actors involved. Thus, ed to make secure interledger payments. edgement. Connectors also use their ledgers’ escrow to protect themselves from risk. Cryptographic signatures are a simple way for ledgers to securely validate the outcome of the external conditions upon which a transfer is escrowed. Any one-way func- tion can be used [18]. Using asymmetric cryptography, the ledger escrows funds pending the presentation of a valid signature for a pre-defined public key and message or hash. The ledger can then easily validate the signature when it is presented and determine if the condition has been met. Figure 5: Transfer states Figure 5 illustrates the states of a transfer. First, a trans- fer is proposed to the participants, but no changes are made to the ledger. Once affected account holders have authorized the transfer, the ledger checks that funds are available and that all of its rules and policies have been satisfied. The ledger places the funds in escrow and the transfer is prepared. If the execution condition e is ful- filled, the transfer is executed. If any of the checks fail, or if an abort condition e0 is fulfilled, the transfer is aborted and the escrowed funds are returned to their originator. 3 Atomic Interledger Payments Interledger payments consist of transfers on different
  16. Payment Chain Client Balance Alice -1.02 USD Connector1 +1.02 USD

    Client Balance Connector2' +1.01 USD Connector1' -1.01 USD Client Balance Connector2' -4,042 DOGE Bob +4,042 DOGE TEH DOGES!!!!! Banana Bank CHEESEBANK
  17. Payment Chain Figure 6: Payment chain manager with a group

    of coordinators that use a consen- sus algorithm to agree on the outcome of the payment [14]. The Atomic execution mode uses a Byzantine fault- tolerant agreement algorithm amongst an ad-hoc group Notaries N must only agree on the D Execute or D Abort messages if they have received a signed receipt, the R ReceiptSignature, from the recipient pn before a time- out t. The recipient’s signature provides non-repudiable proof that they have been paid. The recipient pn signs the receipt once the transfer into their account is L Prepared
  18. Payment Chain Figure 6: Payment chain manager with a group

    of coordinators that use a consen- sus algorithm to agree on the outcome of the payment [14]. The Atomic execution mode uses a Byzantine fault- tolerant agreement algorithm amongst an ad-hoc group Notaries N must only agree on the D Execute or D Abort messages if they have received a signed receipt, the R ReceiptSignature, from the recipient pn before a time- out t. The recipient’s signature provides non-repudiable proof that they have been paid. The recipient pn signs the receipt once the transfer into their account is L Prepared
  19. Payment Chain Figure 6: Payment chain manager with a group

    of coordinators that use a consen- sus algorithm to agree on the outcome of the payment [14]. The Atomic execution mode uses a Byzantine fault- tolerant agreement algorithm amongst an ad-hoc group Notaries N must only agree on the D Execute or D Abort messages if they have received a signed receipt, the R ReceiptSignature, from the recipient pn before a time- out t. The recipient’s signature provides non-repudiable proof that they have been paid. The recipient pn signs the receipt once the transfer into their account is L Prepared
  20. Payment Chain Figure 6: Payment chain manager with a group

    of coordinators that use a consen- sus algorithm to agree on the outcome of the payment [14]. The Atomic execution mode uses a Byzantine fault- tolerant agreement algorithm amongst an ad-hoc group Notaries N must only agree on the D Execute or D Abort messages if they have received a signed receipt, the R ReceiptSignature, from the recipient pn before a time- out t. The recipient’s signature provides non-repudiable proof that they have been paid. The recipient pn signs the receipt once the transfer into their account is L Prepared
  21. Payment Chain Figure 6: Payment chain manager with a group

    of coordinators that use a consen- sus algorithm to agree on the outcome of the payment [14]. The Atomic execution mode uses a Byzantine fault- tolerant agreement algorithm amongst an ad-hoc group Notaries N must only agree on the D Execute or D Abort messages if they have received a signed receipt, the R ReceiptSignature, from the recipient pn before a time- out t. The recipient’s signature provides non-repudiable proof that they have been paid. The recipient pn signs the receipt once the transfer into their account is L Prepared
  22. Consensus Protocol Figure 6: Payment chain manager with a group

    of coordinators that use a consen- sus algorithm to agree on the outcome of the payment [14]. The Atomic execution mode uses a Byzantine fault- tolerant agreement algorithm amongst an ad-hoc group of coordinators or notaries to synchronize the execution of the component transfers. Additionally, it guarantees that the sender receive a cryptographically signed pay- ment receipt from the recipient if funds are transferred. Figure 6 shows a payment through a chain of participants P and ledgers L. There are n participants in P, such that |P| = n. The sender is the first participant p 1 and the recipient is the last participant pn. The connectors C are participants p 2 through pn 1, such that {pi 2 C | C ⇢ P ^ i 2 Z+ ^ 1 < i < n}. The payment consists of n 1 book transfers B on n 1 ledgers, such that |B| = |L| = n 1. The first participant, the sender p 1, has an account Notaries N m messages if R ReceiptSig out t. The re proof that the receipt once and escrowed To ensure al ically, all of on the D Ex R ReceiptSig 8e 2 E : The abort co
  23. Notaries n 1. The first participant, the sender p 1,

    has an account on ledger `1. The last participant, the recipient pn, has an account on ledger `n 1. Each connector pi 2 C has accounts on ledgers `i 1 and `i and facilitates payments between them. 3.1 Notaries In the Atomic mode, transfers are coordinated by a group of notaries N that serve as the source of truth regarding the success or failure of the payment. They take the place of the transaction manager in a basic Two-Phase Com- mit. Importantly, notaries are organized in ad-hoc groups for each payment and our protocol does not require one globally trusted set of notaries. All of the escrow conditions for the book transfers B comprising the payment must depend on the notaries ei- ther sending a D Execute or D Abort message. If the es- crow conditions were based solely on a message from N, however, faulty notaries could cause the transfers to execute before the final transfer to the recipient is L Prepared. [11]. pendent only on a message fulfil Z+ ^ i < n} cau sition the L Pro L Aborted state 3.2 Fault T The Atomic mo taries N act hon sume notaries ar actors can be inc Byzantine notar and D Abort me ledgers and caus to be aborted. I set a fault-tolera come of the agr as there are no m
  24. TLA+ A.3 Formal Specification: Atomic mode module Atomic Formal Specification

    in TLA+ of the Interledger Protocol Atomic ( ILP /A) Modeled after the excellent Raft specification by Diego Ongaro. Available at https://github.com/ongardie/raft.tla Copyright 2014 Diego Ongaro. This work is licensed under the Creative Commons Attribution-4.0 International License https://creativecommons.org/licenses/by/4.0/ extends Naturals, Sequences, Bags, TLC The set of ledger IDs constants Ledger The set of participant IDs constants Participant The notary constants Notary Sender states constants S Ready, S Waiting, S Done Notary states constants N Waiting, N Committed, N Aborted Ledger states constants L Proposed, L Prepared, L Executed, L Aborted Message types constants PrepareRequest, ExecuteRequest, AbortRequest, PrepareNotify, ExecuteNotify, AbortNotify, SubmitReceiptRequest Receipt signature constants R ReceiptSignature Global variables A bag of records representing requests and responses sent from one process to another variable messages Sender variables State of the sender ( S Ready , S Waiting , S Done ) variable senderState All sender variables senderVars = hsenderStatei The following variables are all per ledger (functions with domain Ledger ) The ledger state ( L Proposed , L Prepared , L Executed or L Aborted ) variable ledgerState 12 A.4 Formal Specification: Universal mode module Universal Formal Specification in TLA+ of the Interledger Protocol Universal ( ILP / U ) Modeled after the excellent Raft specification by Diego Ongaro. Available at https://github.com/ongardie/raft.tla Copyright 2014 Diego Ongaro. This work is licensed under the Creative Commons Attribution-4.0 International License https://creativecommons.org/licenses/by/4.0/ extends Naturals, Sequences, FiniteSets, Bags, TLC The set of ledger IDs constants Ledger The set of participant IDs constants Participant Sender states constants S Ready, S ProposalWaiting, S Waiting, S Done Connector states constants C Ready, C Proposed Ledger states constants L Proposed, L Prepared, L Executed, L Aborted Message types constants PrepareRequest, ExecuteRequest, AbortRequest, PrepareNotify, ExecuteNotify, AbortNotify, SubpaymentProposalRequest, SubpaymentProposalResponse Receipt signature constants R ReceiptSignature Global variables Under synchrony we are allowed to have a global clock variable clock A bag of records representing requests and responses sent from one process to another variable messages Sender variables State of the sender ( S Ready , S Waiting , S Done ) variable senderState Whether the sender has received a response from a given connector variable senderProposalResponses All sender variables senderVars = hsenderState, senderProposalResponsesi Connector variables 19