Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ripple Developer Conference 2013 at Money2020

8,094 views

Published on

These slides were presented at Ripple Labs' first developer confernece on Oct 10, 2013 at Money2020 in Las Vegas, NV. The agenda was as follows:

1. Welcome and Introduction, Chris Larsen
CEO Chris Larsen provided an overview of Ripple and shared the latest news.

2. Ripple Technical Overview, Evan Schwartz
Engineer Evan Schwartz upacked Ripple from a technical perspective, and offered examples of what developers could build and have built on the Ripple Network.

3. Integrating with Ripple for Merchants and Gateways, Bob Way, Denis Kiselev and Brian Keller-Heikkila
Integration Engineer Bob Way explained how merchant and gateway integration works. Bob interviewed Denis Kiselev, founder and CEO of SnapSwap, about his team’s experience building the first U.S. Ripple Gateway. Brian Keller-Heikkila, CTO of ZipZap, joined Bob and Denis on stage to share special news.

4. Ripple Architecture and Advanced Uses, David Schwartz
Chief Cryptographer David Schwartz discussed Ripple’s architecture, including a deep-dive on consensus, and interesting, advanced applications to consider.

5. Future Focus for Our Engineering Team, Stefan Thomas
CTO Stefan Thomas offered a sneak peak of our roadmap.

Published in: Technology, Economy & Finance

Ripple Developer Conference 2013 at Money2020

  1. 1. Agenda 8:30-9:30am – Registration 9:30-9:50am – Welcome and Introduction, Chris Larsen, CEO, Ripple Labs 9:50-10:20am – Ripple Technical Overview, Evan Schwartz, Software Engineer, Ripple Labs 10:20-11:10am – Integrating with Ripple for Merchants and Gateways, Bob Way, Integration Engineer, Ripple Labs; Denis Kiselev, CEO, SnapSwap; and Brian KellerHeikkila, CTO, ZipZap 11:10-11:20am – Break 11:20am-12:10pm – Ripple Architecture and Advanced Uses, David Schwartz, Chief Cryptographer, Ripple Labs 12:10-12:30pm – Future Focus for Our Engineering Team, Stefan Thomas, CTO, Ripple Labs 12:30 onward – Networking
  2. 2. Summary Ripple and Ripple Labs • a distributed payments protocol • venture backed company that • a new currency - ripples (XRP) contributes code and promotes the • the world‟s first distributed currency Ripple protocol exchange Chris Larsen, CEO, Ripple Labs
  3. 3. Math Based Currency Movement • Focus: Erosion of trust political currencies • Solution: Trust in math relationship of servers in a distributed network - No central authority to debase money supply. - Fixed amount that can‟t increase AU BTC/XRP/LTC Chris Larsen, CEO, Ripple Labs
  4. 4. Virtual Currency is Just the Beginning Chris Larsen, CEO, Ripple Labs
  5. 5. The World Needs a Transaction Web Protocol Information Exchange Value Exchange “world is flat” “world is curved” Chris Larsen, CEO, Ripple Labs
  6. 6. Confirmation in a Decentralized System Mining Method (Bitcoin) • Reward first „miner‟ to solve a math problem that is a confirmation. • Need extremely powerful computers, energy intensive. Consensus Method (Ripple) • Current state of global ledger. • Transactions that are valid to majority of servers are updated to ledger. • 5-10 second confirmations. • Average 10 minute confirmations Chris Larsen, CEO, Ripple Labs
  7. 7. Benefits as a Payment Protocol Any Currency Global No Chargebacks Fast Free Chris Larsen, CEO, Ripple Labs
  8. 8. Peer-to-Peer Architecture Chris Larsen, CEO, Ripple Labs
  9. 9. A Common Ledger Chris Larsen, CEO, Ripple Labs
  10. 10. Ripple is a Protocol Like SMTP, a Protocol for Moving Money • Ripple is a set of standards • “Server Calls” to Send, Receive, etc. • Transact without Intermediaries • Decentralized System • Open to Developers • No Network Operator Chris Larsen, CEO, Ripple Labs
  11. 11. Gateways Cash in, Cash Out • Gateways take deposits and issue local currency balances on Ripple • Balances can be transferred across the ledger without intermediaries • Gateways earn fees as they wish Chris Larsen, CEO, Ripple Labs
  12. 12. Distributed Exchange • Can create bid/ask offers for any currency pair from any issuer • Participants can profit from forex spreads • Ripple routes transactions through a path finding algorithm to find the lowest cost execution • Supports algorithm-driven trading Chris Larsen, CEO, Ripple Labs
  13. 13. The Role of XRP in Ripple 1. protects network from: - DDOS attacks - ledger spam 2. universal medium of exchange - no counterparty - every node trusts Chris Larsen, CEO, Ripple Labs
  14. 14. Pre-Mining Ripple doesn‟t need to incent transaction validators with XRP, so mining is optional. Instead we chose to use XRP to support: The Network – Build and incent an amazing team (Ripple Labs) Utility – Give away XRP to as many consumers as possible Liquidity – Incent market makers with long-term forgivable XRP loans Chris Larsen, CEO, Ripple Labs
  15. 15. What, How, Who Cares? (in 20 minutes) Evan Schwartz
  16. 16. What is Ripple? Evan Schwartz
  17. 17. Open Source Payment Network Evan Schwartz
  18. 18. Four Types of Users Basic Users Merchants Market Makers Gateways Evan Schwartz
  19. 19. Basic User Experience Evan Schwartz
  20. 20. Basic User Experience What could you do with that? Evan Schwartz
  21. 21. Merchant Experience Evan Schwartz
  22. 22. Basic User Experience What could you do with that? Evan Schwartz
  23. 23. Market Maker Experience Evan Schwartz
  24. 24. Market Maker Experience Evan Schwartz
  25. 25. Basic User Experience Interesting… Evan Schwartz
  26. 26. Gateway Experience Evan Schwartz
  27. 27. Gateway Experience Evan Schwartz
  28. 28. Transactions in any currency? Evan Schwartz
  29. 29. Too many pairs of currencies Evan Schwartz
  30. 30. XRP connects people Evan Schwartz
  31. 31. XRP connects currencies Evan Schwartz
  32. 32. Basic User Experience Evan Schwartz
  33. 33. Basic User Experience Did you really need a caption? Evan Schwartz
  34. 34. Evan Schwartz
  35. 35. Business Integration Bob Way, Integration Engineer
  36. 36. Ripple Integration Three Steps 1. Set-up your Ripple account and trust lines. 2. Install a local rippled server 3. Automate your business processes Bob Way, Integration Engineer
  37. 37. Step 1 The Ripple Ledger Bob Way, Integration Engineer
  38. 38. NewGate A gateway in 10 minutes NewGate Bob Way, Integration Engineer
  39. 39. NewGate user trust NewGate Alice Bob Way, Integration Engineer
  40. 40. NewGate user trust NewGate Alice Bob Way, Integration Engineer
  41. 41. NewGate deposit NewGate $5 Alice Bob Way, Integration Engineer
  42. 42. NewGate second user trust NewGate $5 Alice Bob Bob Way, Integration Engineer
  43. 43. NewGate payment NewGate $5 Alice Bob Bob Way, Integration Engineer
  44. 44. NewGate payment NewGate $5 Alice Bob Bob Way, Integration Engineer
  45. 45. NewGate withdrawal NewGate $1 $4 Alice Bob Bob Way, Integration Engineer
  46. 46. NewGate make it real! LAME! NewGate $4 Alice Bob Bob Way, Integration Engineer
  47. 47. NewGate making it real! SnapSwap Offers Bitstamp Outbound Bridge Bitcoin NewGate $4 Alice Bob Bob Way, Integration Engineer
  48. 48. NewGate liquidity SnapSwap Bitstamp Offers $10 Outbound Bridge Bitcoin $10 Mark NewGate $4 Alice Bob Bob Way, Integration Engineer
  49. 49. NewGate inter-gateway payment SnapSwap Bitstamp Offers $10 Outbound Bridge Bitcoin $8 Mark $2 NewGate $2 Alice Bob Bob Way, Integration Engineer
  50. 50. NewGate pay anyone SnapSwap Bitstamp Offers $10 Outbound Bridge Bitcoin $8 Mark $2 NewGate $2 Alice Bob Bob Way, Integration Engineer
  51. 51. Denis Denis Kiselev SnapSwap $2 SnapSwap Bitstamp Offers $8 Outbound Bridge Bitcoin $8 Mark $4 NewGate Alice Bob Bob Way, Integration Engineer
  52. 52. Denis Kiselev CEO SnapSwap
  53. 53. NewGate automation NewGate Bob Way, Integration Engineer
  54. 54. NewGate web application Code NewGate Bob Way, Integration Engineer
  55. 55. NewGate user interface Code NewGate Bob Way, Integration Engineer
  56. 56. NewGate funds interface Code NewGate Bob Way, Integration Engineer
  57. 57. NewGate rippled interface Code NewGate Bob Way, Integration Engineer
  58. 58. Step 2 Install rippled Bob Way, Integration Engineer
  59. 59. NewGate JSON messages over websockets or RPC Code NewGate Bob Way, Integration Engineer
  60. 60. Step 3 Using the rippled API Bob Way, Integration Engineer
  61. 61. Two Core Tasks 1) receive incoming payments Monitor for incoming payments Code Bob Way, Integration Engineer
  62. 62. Monitoring your Ripple address websocket account_info - websocket command { "command":"account_info", "account":"rUPotLj5CNKaP4bQANcecEuT8hai3VpxfB", } Bob Way, Integration Engineer
  63. 63. Monitoring your Ripple address rpc account_info - RPC Call curl -X POST -d '{ "method": "account_ingo", "params": [ { "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", } ] }' http://s1.ripple.com:51234 Bob Way, Integration Engineer
  64. 64. { "result":{ "account_data":{ "Account":"rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "Balance":"114459798", "EmailHash":"DF1352F23CD32812F4850B878AE4944C", "Flags":0, "LedgerEntryType":"AccountRoot", "OwnerCount":0, "PreviousTxnID":"0FA9B61C5EED265BAAA3...", "PreviousTxnLgrSeq":2169731, "Sequence":26510, "TransferRate":4294967295, "index":"2B6AC232AA4C4BE41BF49D245...", "urlgravatar":"http://www.gravatar.com/avatar/df1352f23cd32812f4850b878ae4944c"} "ledger_current_index":2671768, status":"success"} account_info response } Bob Way, Integration Engineer
  65. 65. Monitoring your Ripple address api calls account_info account_lines account_tx account_offers Bob Way, Integration Engineer
  66. 66. Two Core Tasks 2) send outgoing payments Code Send outgoing payments Bob Way, Integration Engineer
  67. 67. Sending Payments api calls ripple_path_find path_find format “payment” transaction sign submit Bob Way, Integration Engineer
  68. 68. Tools Woot! Understanding the Ledger • ripple.com/graph • ripple.com/tools/info Learning the JSON API • ripple.com/wiki/RPC_API • ripple.com/tools/api/ For Your ripple.txt File • ripple.com/tools/txt/ Bob Way, Integration Engineer
  69. 69. Brian Keller-Keikkila CTO ZipZap Bob Way, Integration Engineer
  70. 70. integration Pay with CASH. Bob Way, Integration Engineer
  71. 71. ZipZap integration Alice $ Payment Center $ Bob ZipZap Merchants Bob Way, Integration Engineer
  72. 72. ZipZap integration SnapSwap Bitstamp $ ZipZap Bob Way, Integration Engineer
  73. 73. ZipZap integration SnapSwap Bitstamp $ Bob Way, Integration Engineer
  74. 74. ZipZap integration SnapSwap Bitstamp $ ZipZap Bob Way, Integration Engineer
  75. 75. ZipZap integration SnapSwap Bitstamp $ $ ZipZap Bob Way, Integration Engineer
  76. 76. ZipZap integration Alice SnapSwap Bitstamp $ $ Payment Center $ $ ZipZap Bob Way, Integration Engineer
  77. 77. ZipZap integration Alice $ SnapSwap Bitstamp $ $ Payment Center $ ZipZap Bob Way, Integration Engineer
  78. 78. integration Bob Way, Integration Engineer
  79. 79. integration What‟s Next? THE WORLD. Bob Way, Integration Engineer
  80. 80. 10 Minute Break
  81. 81. About Me David Schwartz I‟m the Chief Cryptographer at Ripple Labs. I‟m also known as JoelKatz on the Bitcoin forums and am told that I am a leading voice in the crypto-currency community. Before that, I developed secure messaging and storage systems used by companies such as CNN and government agencies including the NSA. David Schwartz, Chief Cryptographer
  82. 82. A platform for issuing, holding, transferring, and trading arbitrary assets. Key Features • Open source, ISC license. • Public ledger, public transactions, public history. • Equal access, peer-to-peer, no central authority. • Ledger modified by cryptographically signed transactions. • Fast transactions with reliable confirmation. • Sophisticated cross-currency and cross-issuer payments. David Schwartz, Chief Cryptographer
  83. 83. Ledger The ledger is public. Key Features • Every server can keep a full copy of the current ledger. • Ledger contains all balances and offers. • Previous ledgers and previous transactions are not needed. • The ledger is organized as a chain of hash trees. - A single 256-bit number identifies a ledger by hash - Once you know a ledger‟s hash, you can walk the hash tree to see the ledger‟s contents. - You can walk the hash tree to prior ledgers efficiently. David Schwartz, Chief Cryptographer
  84. 84. Ledger Contents A new ledger built every 5 to 30 seconds. Ledger Contents • Header • State Tree • Transaction Tree David Schwartz, Chief Cryptographer
  85. 85. Ledger Contents Ledger Header • Ledger sequence number • Total XRP in existence • Hash of the previous ledger • Hash of the account tree and the transaction tree • Close time of this ledger and the previous ledger David Schwartz, Chief Cryptographer
  86. 86. Ledger Contents Hash Tree • Organized as a Merkle tree of radix nodes. - Inner nodes hold indexed links to hashes of other nodes. - Leaf nodes hold data. • Each node has a 256-bit index and a 256-bit hash. • Leaf nodes can easily be looked up by index. • Provides fast search and traverse by index. • Efficient synchronization and comparison. David Schwartz, Chief Cryptographer
  87. 87. Ledger Contents State Tree • Holds the state of the Ripple network. • Structured as an indexed hash tree. • Contains accounts, balances, pathways, offers, and other persistent data. • Contains some structural information and indexes. • Represents the state after transactions are applied. • Holds entries in a binary format that can be converted to and from JSON. David Schwartz, Chief Cryptographer
  88. 88. Ledger Contents State Tree Key Entry Types • Account root • Ripple state • Offer • Directory • Fee settings • Features • Ledger Hashes David Schwartz, Chief Cryptographer
  89. 89. Ledger Contents State Tree Sample Entry { "Account" : "rKu4m1UDLGxR6fjhdNEVWrF4gCDhpocWAQ", "Balance" : "199999990", "Flags" : 0, "LedgerEntryType" : "AccountRoot", "OwnerCount" : 0, "PreviousTxnID" : "922345F7771870688116ABD484960D5A566F38C...", "PreviousTxnLgrSeq" : 339000, "Sequence" : 2, "index" : "00118F9DC4F5767D6927A98FF749C..." } David Schwartz, Chief Cryptographer
  90. 90. Ledger Contents Transaction Tree • Also structured as an indexed hash tree. • Contains all transactions applied in this ledger. • Includes metadata for each transaction. • Metadata justifies changes to state tree entries. David Schwartz, Chief Cryptographer
  91. 91. Transactions Cryptographically signed authorizations to modify ledger state Basic Structure • Account • Public Key • Signature • Fee • Type • Sequence • Type-specific information David Schwartz, Chief Cryptographer
  92. 92. Transactions This real transaction was randomly selected. Sample Transaction { "Account" : "rMWUykAmNQDaM9poSes8VLDZDDKEbmo7MX", "Fee" : "10", "Flags" : 0, "OfferSequence" : 62462, "Sequence" : 582232, "SigningPubKey" : "0256C64F0378DCCCB4E0224B36F7ED1…", "TransactionType" : "OfferCancel", "TxnSignature" : "3044022000ED14…", "hash" : "FC6F9BC14A7DA643…“ } David Schwartz, Chief Cryptographer
  93. 93. Transactions Metadata justifies ledger changes Metadata { "ModifiedNode" : { "LedgerEntryType" : "AccountRoot", "LedgerIndex" : "56091AD066271ED03B106812AD376D48F12680…", "PreviousFields" : { "Balance" : "1994177177", "Sequence" : 582232 }, "FinalFields" : { "Account" : "rMWUykAmNQDaM9poSes8VLDZDDKEbmo7MX", "Balance" : "1994177167", "Flags" : 0, "OwnerCount" : 71, "Sequence" : 582233 }, "PreviousTxnID" : "A4BEFDE98429C0C3C310C6FF548ECD73C6E22…", "PreviousTxnLgrSeq" : 2438196 } David Schwartz, Chief Cryptographer
  94. 94. Consensus Consensus establishes transaction ordering Key Points • Ripple‟s method of solving the double spend problem • Validators agree on a group of transactions to be applied in a given ledger • Validators sign each ledger they build • Analogous to a room full of people trying to agree • All honest servers place a high value on agreement, second only to correctness David Schwartz, Chief Cryptographer
  95. 95. Consensus Consensus establishes transaction ordering Why is transaction ordering important? • Other aspects of the double spend problem are easily solved with deterministic rules • We have a public ledger • Ripple has deterministic rules for - Transaction validity - Transaction execution - Transaction ordering within a ledger • If one transaction must come before the other, then we can easily see that the second one must fail David Schwartz, Chief Cryptographer
  96. 96. Consensus Consensus establishes transaction ordering What do validators do? • Agree on the last closed ledger • Propose sets of transactions to include in the next ledger • Avalanche to consensus • Apply agreed transactions according to deterministic rules • Publish a signed validation of the new last closed ledger David Schwartz, Chief Cryptographer
  97. 97. Consensus Consensus establishes transaction ordering Why is consensus robust? • If a transaction has no reason not to be included, all honest validators will vote to include it. • If a transaction has some reason not to be included, it is okay if it is not included • Valid transactions that do not get into the consensus set will be voted into the next set by all honest validators • Algorithm is biased to exclude transactions to reduce overlap required David Schwartz, Chief Cryptographer
  98. 98. Consensus Consensus establishes transaction ordering Why is consensus robust? • Every honest participant values agreement over everything but correctness • Validations act as a safety. • Network splits can be detected as they happen • Validation performance can be monitored, treachery can be proven David Schwartz, Chief Cryptographer
  99. 99. Payments Pathfinding makes sophisticated payments possible Characteristics of Ripple payments • Payments succeed or fail atomically. • Payments are fully confirmed at a well-defined point. • You cannot give someone an asset they have not agreed to hold. • A “maximum amount to send” field handles slippage. David Schwartz, Chief Cryptographer
  100. 100. Payments All payments except simple XRP payments require a path - Alice pays Bob through Gateway. - Alice‟s balance with Gateway goes down. - Bob‟s balance with Gateway goes up. - Gateway sees no net balance change, or an increase if they charge a transaction fee. - Bob must already have agreed to accept USD from the Gateway or this path is unusable. David Schwartz, Chief Cryptographer
  101. 101. Payments Cross-currency path - Alice sees her USD balance drop. Bob sees his BTC balance increase. - Those who placed offers see their USD balances increase and their BTC balances decrease. - Gateways do not have to deal with any cross-currency aspects. - Order books link gateways. David Schwartz, Chief Cryptographer
  102. 102. Payments Two types of path links Account to Account Link Order Book Link An account to account link uses a pathway to move funds from one account to another. Order book links can change currencies. Path specifies the order book, not specific orders. It is helpful to think of funds as being transferred by their issuers. Order book links appear with account links for their issuers. An intermediary account in a payment path with two account-to-account links will see one balance increase and the other decrease. Account links cannot change currencies, only issuers. David Schwartz, Chief Cryptographer
  103. 103. Payments Division of labor Pathfinding Execution Only one server needs to do the pathfinding work for a given payment. Every validator executes the transaction. Path set is already known. Pathfinding generates a set of paths for the transaction and gives an estimate of the cost. Degrees of separation tend to be short. Order books are indexed to make execution efficient. Paths are taken incrementally and more than one path can be used to get the best rate. Current Ripple servers use a table driven pathfinding engine. Payments succeed or fail atomically. There is room for innovation in path finding. Must be completely deterministic. David Schwartz, Chief Cryptographer
  104. 104. Trading Ripple supports order books between all asset pairs. Market Making Arbitrage Marking making is offering to buy and sell the same asset over a period of time. Arbitrage is buying and selling the same asset at approximately the same time to profit from a difference in price. Market making in Ripple makes large payments possible and improves rates. Market makers link cash-in networks with cash-out networks, making remittance efficient. Internal arbitrage involves only transactions inside the Ripple network. While there will be internal arbitrage opportunity in the Ripple network, everyone will be competing for the same opportunities. External arbitrage involves matching transactions inside the Ripple network with transactions outside the Ripple network. David Schwartz, Chief Cryptographer
  105. 105. Invisible Ripple Ripple can be the back end that makes a payment work Inbound payments using Ripple • Customer selects product they want to buy. • Merchant presents customer with payment options. • Customer selects a payment network they are familiar with. • Merchant directs the customer to a Ripple gateway, specifies their Ripple account and payment amount. • Customer makes payment to gateway using conventional payment network. • Gateway makes Ripple payment to merchant. • Merchant credits customer for payment. David Schwartz, Chief Cryptographer
  106. 106. Invisible Ripple Ripple can be the back end that makes a payment work Advantages • Customer uses conventional payment network they already know. • Merchant is paid in local currency at a local financial institution. • Payment has access to all the liquidity in the Ripple network. • Similar model works for outbound payments. • Each participant does one thing. David Schwartz, Chief Cryptographer
  107. 107. XRP What is it for? Characteristics: • XRP can be transferred between any two accounts, no transfer fee. • XRP is a unique asset in the Ripple system: - No issuer, no counterparty. - Needed for transaction fees, account creation, and reserves. • The easiest way to make an asset liquid is probably to make it liquid to and from XRP: - Other assets have multiple issuers. - Other assets are likely to be regional. - XRP is a bridge. • If assets are liquid to XRP, you can hold XRP if you do not know what asset you will need: - Assuming price is reasonably stable. David Schwartz, Chief Cryptographer
  108. 108. Conclusion The Internet works. Shipping works. Payments are broken. Ripple completes commerce • Do what you do best. • Everything works together. - Currencies don‟t matter. - Locations don‟t matter. - Institutions don‟t matter. David Schwartz, Chief Cryptographer
  109. 109. Conclusion What does Ripple offer? • Backed by Ripple Labs. • Fully open source, ISC license. • For everyone. • Nearly instantaneous, nearly free transactions. • Receive, pay, and hold the currency of your choice. • Direct access to market makers • Irreversible payments. David Schwartz, Chief Cryptographer
  110. 110. Any questions? David Schwartz, Chief Cryptographer
  111. 111. Contracts
  112. 112. About Me Stefan Thomas CTO, Ripple Labs Previous:
  113. 113. Bitcoin Scripts A simple stack machine. Outputs and inputs connect
  114. 114. Bitcoin Scripts A simple stack machine. Outputs and inputs connect • Transaction outputs verify the state of the stack • Transaction inputs need to set it up • If it returns true, the input is valid. • Surprisingly powerful!
  115. 115. Bitcoin Scripts A simple stack machine. Limitations • Limited set of opcodes • No ability to reference external data • No concept of accounts
  116. 116. Contracts A distributed Turing machine. Consensus for your own apps • Contracts use arbitrary x86 code • Ledger is a generic key/value store
  117. 117. Escrow Basic example. Two parties transacting with mediator Mediator should only be able to send funds to one of the parties, but not to herself.
  118. 118. Escrow A basic example. 2 of 3 multisig in Bitcoin 2 <K1> <K2> <K3> 3 CHECKMULTISIGVERIFY
  119. 119. Escrow A basic example. 2 of 3 multisig in Ripple if (check_multisig(2, 3, payload[“sigs”], local[“keys”])) send_funds(payload[“dest”]);
  120. 120. Escrow A basic example. Someone has to actually implement check_multisig… function check_multisig(int n, int m, Object sigs, Object keys) { int valid_sigs = 0; for (int i = 0; i < m; i++) if (verify_ecdsa_sig(sigs[i], keys[i])) valid_sigs++; return valid_sigs >= n; } It‟s a contract!
  121. 121. Escrow A basic example. Code duplication? function check_multisig(int n, int m, Object sigs, Object keys) function check_multisig(int n, int m, Object sigs, Object keys) function check_multisig(int n, int m, Object sigs, Object keys) function check_multisig(int n, int m, Object sigs, Object keys) • Contracts can link to other contracts as libraries
  122. 122. Escrow Basic example. What about verify_ecdsa_sig? • Compiled as a contract – and so is OpenSSL. • “It‟s contracts all the way down.” • All pure processing functions are fully sandboxed  Minimal trusted code base (TCB)
  123. 123. Escrow Basic example. And what about send_funds? • A contract generates a static piece of data called the “agenda”. SEND_CONTRACT_FUNDS_ALL [destination_account] • Think of it like an SQL query. BEGIN TRANSACTION; UPDATE accounts SET balance = balance + (SELECT balance FROM contract_accounts WHERE contract_id = ?) WHERE account = ?; UPDATE contract_accounts SET balance = 0 WHERE contract_id = ?; COMMIT;
  124. 124. Details We skipped a lot of stuff. Some more notes on how it all works • Contracts can hold funds • For KYC and other purposes contracts will have an “owner” account • Contracts can delete themselves • Contracts can write to hashtables based on their namespace • Contracts can read any entry in the ledger
  125. 125. Subscriptions This is a bit more interesting. Let‟s ramp things up a bit! • I want to have a contract that says: “You can take up to 10 USD/Bitstamp out of my account per month.”
  126. 126. Microgateways Ok, now we‟re starting to talk craziness. Goal: Can we get PayPal support without… PayPal support? *rolls up sleeves*
  127. 127. Microgateways Ok, now we‟re starting to talk craziness. Contracts managing peer-to-peer transactions • Hypothetical IOU worth 1 USD: USD/M • I can now trade this IOU with full Ripple functionality: – Buy them on PayPal after going through KYC – Redeem them on PayPal with a 120 day escrow – All managed by Ripple contracts and SSL session proofs
  128. 128. Microgateways Ok, now we‟re starting to talk craziness. SSL proofs 1. Do an SSL session through a proxy – Proxy witnesses data stream (does not have access to contents) – PayPal‟s certificate shows up in initial handshake 2. Submit SSL log and witness signature to contract 3. Profit?
  129. 129. Microgateways Ok, now we‟re starting to talk crazy. Problem: How are these IOUs issued? • Only requirement: It must cost at least 1 USD to create 1 USD/M • “To issue 1 USD/M, you must send 1.05 USD to one of these charities.” Disclaimer: • SSL proofs are a bit weak for this: They‟re worst of (counterparty, witness) • There might be a better way to provably destroy dollars! Ideally: Only need to trust Fed. • But: Good enough.
  130. 130. Microgateways Ok, now we‟re starting to talk crazy. Bigger problem: How are these IOUs redeemed?! • We want the value of the asset to track USD as much as possible. • If there are too few USD/M, no problem, people can issue. • But what if there are too many?
  131. 131. Microgateways Ok, now we‟re starting to talk crazy. IOU inflation • Two main options: – If underlying asset is inflationary: Do nothing – If underlying asset is deflationary: Add demurrage to IOUs
  132. 132. Microgateways Ok, now we‟re starting to talk crazy. Let‟s recap • The price of 10 USD/M will be between: 0 USD (if there is no one wanting to deposit funds) 10 USD + whatever the real transaction costs of depositing are • Good enough to get money in+out • But you‟d probably rather hold XRP or BTC
  133. 133. Autonomous Agents He‟s lost it. If code can own money… • Agents need somewhere to run. – – Hosted autonomous agents (hosting risk) – • Physical autonomous agents (e.g. self-driving cars) Distributed autonomous agents (first time possible with Ripple) And they need to hold funds.
  134. 134. Autonomous Agents He‟s lost it. … fun things happen. • Evolutionary model: – Agents can outsource improvements. – Hire somebody with a reputation for making better agents – Child agents start with a birth loan – Agents are “mindless capital”
  135. 135. Capital contracts Putting it all together. An alternative to the evolutionary model • Developers write agents and publish them • Investors fund them • Can be as flexible or rigid as needed
  136. 136. Any questions?
  137. 137. Thanks For Joining Us!
  138. 138. We’re Hiring! ripple.com/jobs - Inquire with jobs@ripple.com Business Development Product • VP of Financial Services • Integration Engineer • VP of Emerging Markets • Product Manager of Platform Software Development • Technical Writer • Sr. Javascript Engineer • UX Product Designer • Lead Android Developer • Data Analyst

×