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.
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Ripple Developer Conference 2013 at Money2020
1.
2. 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
3. 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
4. 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
6. The World Needs a
Transaction Web Protocol
Information Exchange
Value Exchange
“world is flat”
“world is curved”
Chris Larsen, CEO, Ripple Labs
7. 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
8. Benefits as a Payment Protocol
Any Currency
Global
No Chargebacks
Fast
Free
Chris Larsen, CEO, Ripple Labs
11. 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
12. 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
13. 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
14. 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
15. 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
39. 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
75. 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
89. 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
90. 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
91. 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
92. Ledger Contents
A new ledger built every 5 to 30 seconds.
Ledger Contents
• Header
• State Tree
• Transaction Tree
David Schwartz, Chief Cryptographer
93. 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
94. 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
95. 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
96. Ledger Contents
State Tree
Key Entry Types
• Account root
• Ripple state
• Offer
• Directory
• Fee settings
• Features
• Ledger Hashes
David Schwartz, Chief Cryptographer
98. 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
99. Transactions
Cryptographically signed authorizations to modify ledger state
Basic Structure
• Account
• Public Key
• Signature
• Fee
• Type
• Sequence
• Type-specific information
David Schwartz, Chief Cryptographer
102. 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
103. 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
104. 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
105. 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
106. 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
107. 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
108. 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
109. 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
110. 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
111. 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
112. 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
113. 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
114. 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
115. 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
116. 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
117. 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
123. 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!
124. Bitcoin Scripts
A simple stack machine.
Limitations
•
Limited set of opcodes
•
No ability to reference external data
•
No concept of accounts
125. Contracts
A distributed Turing machine.
Consensus for your own apps
•
Contracts use arbitrary x86 code
•
Ledger is a generic key/value store
126. 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.
128. Escrow
A basic example.
2 of 3 multisig in Ripple
if (check_multisig(2, 3, payload[“sigs”], local[“keys”]))
send_funds(payload[“dest”]);
129. 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!
130. 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
131. 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)
132. 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;
133. 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
134. 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.”
135. Microgateways
Ok, now we‟re starting to talk craziness.
Goal: Can we get PayPal support without… PayPal support?
*rolls up sleeves*
136. 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
137. 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?
138. 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.
139. 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?
140. 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
141. 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
142. 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.
143. 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”
144. 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