Slide 1

Slide 1 text

A Protocol for Interledger Payments Tony Arcieri Papers We Love Too September 22nd, 2016

Slide 2

Slide 2 text

This is a talk about payment networks

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

“decentralized”

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

“A highly intercommunicating decentralized structure shows far more resilience and likelihood of survival” — Nicholas Negroponte, “Being Digital”

Slide 10

Slide 10 text

https://www.whitehouse.gov/sites/default/files/microsites/ostp/PCAST/10.40%20D%20Grant.pdf

Slide 11

Slide 11 text

https://twitter.com/blkchninstitute/status/776561813148270592

Slide 12

Slide 12 text

https://blog.maidsafe.net/2015/12/04/evolving-terminology/

Slide 13

Slide 13 text

? ? Network Topology

Slide 14

Slide 14 text

Network Topology Blockchain

Slide 15

Slide 15 text

Centralized?

Slide 16

Slide 16 text

Bitcoin Payment Network Winning Miner " Sender Recipient 0.1 BTC 0.1 BTC 10 minutes 10 minutes

Slide 17

Slide 17 text

Blockchains are shared ledgers

Slide 18

Slide 18 text

1MB every 10 minutes

Slide 19

Slide 19 text

https://en.wikipedia.org/wiki/File:Fax_modem_antigo.jpg

Slide 20

Slide 20 text

X

Slide 21

Slide 21 text

Can we move certain transactions off the blockchain?

Slide 22

Slide 22 text

“Decentralized”

Slide 23

Slide 23 text

Lightning Network

Slide 24

Slide 24 text

BLOCKCHAIN

Slide 25

Slide 25 text

Lightning & Thunder https://blog.blockchain.com/2016/05/16/announcing-the-thunder-network-alpha-release/

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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 ???

Slide 28

Slide 28 text

Payment Channels Alice 0.1 BTC Bob 0.1 BTC 0.1 BTC

Slide 29

Slide 29 text

Payment Channels Alice 0.1 BTC Bob 0.1 BTC 0.1 BTC Carol 0.1 BTC

Slide 30

Slide 30 text

Payment Channels Alice 0.1 BTC Bob 0.1 BTC 0.1 BTC Carol 0.1 BTC

Slide 31

Slide 31 text

Payment Channels Alice 0.1 BTC Bob 0.1 BTC 0.1 BTC Carol 0.1 BTC

Slide 32

Slide 32 text

Distributed

Slide 33

Slide 33 text

Routes

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

We’re never going to agree on a single ledger

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

$ £ € ¥

Slide 40

Slide 40 text

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.

Slide 41

Slide 41 text

Lightning vs Interledger Lightning Network Interledger Pages in Paper 59 25 Main Content 55 9 Flow Diagrams 14 2 Formal Specifications 0 14

Slide 42

Slide 42 text

Very coin. Such wow. Payment Graphs Banana Bank CHEESEBANK ARROW BANK

Slide 43

Slide 43 text

Routes (“Chains”) Banana Bank CHEESEBANK Very coin. Such wow.

Slide 44

Slide 44 text

Connectors Client Balance Alice -10.01 USD Connector +10.01 USD Client Balance Bob +10 USD Connector' -10 USD Banana Bank CHEESEBANK

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

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

Slide 47

Slide 47 text

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)

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

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

Slide 50

Slide 50 text

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

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

“Crypto-Conditions” “X paid Y to Z” —Ledger A https://interledger.org/five-bells-condition/spec.html

Slide 53

Slide 53 text

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

Slide 54

Slide 54 text

Universal Mode

Slide 55

Slide 55 text

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

Slide 56

Slide 56 text

A.2 Universal Mode Sequence Diagram Figure 8: Phases of a payment in the Universal mode

Slide 57

Slide 57 text

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

Slide 58

Slide 58 text

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

Slide 59

Slide 59 text

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

Slide 60

Slide 60 text

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

Slide 61

Slide 61 text

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

Slide 62

Slide 62 text

Atomic Mode

Slide 63

Slide 63 text

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

Slide 64

Slide 64 text

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

Slide 65

Slide 65 text

A Appendix A.1 Atomic Mode Sequence Diagram Figure 7: Phases of a payment in the Atomic mode

Slide 66

Slide 66 text

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

Slide 67

Slide 67 text

OSI-Like Layered Model

Slide 68

Slide 68 text

Open Questions • Routing protocol (Source routing? Ledger-assisted?) • Identity • Regional laws (AML/KYC) • Dispute resolution

Slide 69

Slide 69 text

ILP goes live October 1st

Slide 70

Slide 70 text

That’s it!

Slide 71

Slide 71 text

Thanks! • Twitter: @bascule • Blog: https://tonyarcieri.com