ripple developer conference 2013 at money2020
DESCRIPTION
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.TRANSCRIPT
Agenda8: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 Keller-
Heikkila, 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
Summary
• a distributed payments protocol
• a new currency - ripples (XRP)
• the world’s first distributed
currency exchange
Chris Larsen, CEO, Ripple Labs
Ripple and Ripple Labs
• venture backed company that
contributes code and promotes
the Ripple protocol
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
Chris Larsen, CEO, Ripple Labs
AU BTC/XRP/LTC
Virtual Currency is Just the Beginning
Chris Larsen, CEO, Ripple Labs
The World Needs a Transaction Web Protocol
Information Exchange
Chris Larsen, CEO, Ripple Labs
Value Exchange“world is flat” “world is curved”
Confirmation in a Decentralized System• Reward first ‘miner’ to solve a
math problem that is a confirmation.
• Need extremely powerful computers, energy intensive.
• Average 10 minute confirmations
Mining Method (Bitcoin)
Chris Larsen, CEO, Ripple Labs
• Current state of global ledger.
• Transactions that are valid to majority of servers are updated to ledger.
• 5-10 second confirmations.
Consensus Method (Ripple)
Benefits as a Payment Protocol
Any Currency Global No Chargebacks Fast Free
Chris Larsen, CEO, Ripple Labs
Peer-to-Peer Architecture
Chris Larsen, CEO, Ripple Labs
A Common Ledger
Chris Larsen, CEO, Ripple Labs
Ripple is a Protocol
• Ripple is a set of standards
• “Server Calls” to Send, Receive, etc.
• Transact without Intermediaries
• Decentralized System
• Open to Developers
• No Network Operator
Like SMTP, a Protocol for Moving Money
Chris Larsen, CEO, Ripple Labs
Gateways
• 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
Cash in, Cash Out
Chris Larsen, CEO, Ripple Labs
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
The Role of XRP in Ripple
Chris Larsen, CEO, Ripple Labs
1. protects network from:- DDOS attacks- ledger spam
2. universal medium of exchange- no counterparty- every node trusts
Pre-Mining
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
Ripple doesn’t need to incent transaction validators with XRP, so mining is optional. Instead we chose to use XRP to support:
Chris Larsen, CEO, Ripple Labs
What, How, Who Cares?Some text goes here
(in 20 minutes)
Evan Schwartz
Some text goes here
What is Ripple?
Evan Schwartz
Some text goes here
Open Source Payment Network
Evan Schwartz
Some text goes here
Four Types of Users
Basic Users Merchants Market Makers
Gateways
Evan Schwartz
Some text goes here
Basic User Experience
Evan Schwartz
Some text goes here
Basic User Experience
What could you
do with that?
Evan Schwartz
Some text goes here
Merchant Experience
Evan Schwartz
Some text goes here
Basic User Experience What could you
do with that?
Evan Schwartz
Some text goes here
Market Maker Experience
Evan Schwartz
Some text goes here
Market Maker Experience
Evan Schwartz
Some text goes here
Basic User Experience
Interesting…
Evan Schwartz
Some text goes here
Gateway Experience
Evan Schwartz
Some text goes here
Gateway Experience
Evan Schwartz
Some text goes here
Transactions in any currency?
Evan Schwartz
Some text goes here
Too many pairsof currencies
Evan Schwartz
Some text goes here
XRP connects people
Evan Schwartz
Some text goes here
XRP connectscurrencies
Evan Schwartz
Some text goes here
Basic User Experience
Evan Schwartz
Some text goes here
Basic User Experience
Did you really need a caption?
Evan Schwartz
Some text goes here
Coding time!
Evan Schwartz
Bob Way, Integration Engineer
Business Integration
Ripple Integration
1. Set-up your Ripple account and trust lines.
2. Install a local rippled server
3. Automate your business processes
Three Steps
Bob Way, Integration Engineer
Step 1The Ripple Ledger
Bob Way, Integration Engineer
NewGateA gateway in 10 minutes
NewGate
Bob Way, Integration Engineer
NewGateuser trust
NewGate
Alice
Bob Way, Integration Engineer
NewGateuser trust
NewGate
Alice
Bob Way, Integration Engineer
deposit
NewGate
$5
Alice
NewGate
Bob Way, Integration Engineer
second user trust
NewGate
$5
Alice Bob
NewGate
Bob Way, Integration Engineer
payment
NewGate $5
Alice Bob
NewGate
Bob Way, Integration Engineer
payment
NewGate $5
Alice Bob
NewGate
Bob Way, Integration Engineer
withdrawal
NewGate $4
$1
Alice Bob
NewGate
Bob Way, Integration Engineer
NewGate $4
LAME!
make it real!
Alice Bob
NewGate
Bob Way, Integration Engineer
making it real!
NewGate
BitstampSnapSwap
OffersBitcoin
฿Outbound Bridge
$4
Alice Bob
NewGate
Bob Way, Integration Engineer
liquidity
NewGate $4
$10
$10
Alice Bob
Mark
NewGate
Bob Way, Integration Engineer
BitstampSnapSwap
OffersBitcoin
฿Outbound Bridge
$10
BitstampSnapSwap
OffersBitcoin
฿Outbound Bridge
inter-gateway payment
NewGate $2
$10
$8
$2
Alice Bob
Mark
NewGate
Bob Way, Integration Engineer
pay anyone
NewGate $2
$8
Alice Bob
Mark
$2
NewGate
Bob Way, Integration Engineer
$10
BitstampSnapSwap
OffersBitcoin
฿Outbound Bridge
$8$8
BitstampSnapSwap
OffersBitcoin
฿Outbound Bridge
Denis Kiselev
NewGate
SnapSwap
$8
Alice Bob
Mark
$4
SnapSwap
Denis
$2
Bob Way, Integration Engineer
Denis KiselevCEO SnapSwap
Bob Way, Integration Engineer
NewGateautomation
NewGate
web application
NewGate
Bob Way, Integration Engineer
NewGate
Code
user interface
NewGate
Bob Way, Integration Engineer
NewGate
Code
funds interface
NewGate
Bob Way, Integration Engineer
NewGate
Code
rippled interface
NewGate
Bob Way, Integration Engineer
NewGate
Code
Step 2Install rippled
Bob Way, Integration Engineer
JSON messages over websockets or RPC
NewGate
Bob Way, Integration Engineer
NewGate
Code
Bob Way, Integration Engineer
Step 3Using the rippled API
Bob Way, Integration Engineer
Two Core Tasks1) receive incoming payments
Code
Monitor for incoming payments
Bob Way, Integration Engineer
Monitoring your Ripple address
{"command":"account_info","account":"rUPotLj5CNKaP4bQANcecEuT8hai3VpxfB",
}
account_info - websocket command
websocket
Bob Way, Integration Engineer
Monitoring your Ripple address
curl -X POST -d '{
"method": "account_ingo", "params": [ { "account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", }]
}' http://s1.ripple.com:51234
account_info - RPC Call
rpc
Bob Way, Integration Engineer
{ "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_inforesponse
Bob Way, Integration Engineer
Monitoring your Ripple address
account_infoaccount_linesaccount_txaccount_offers
api calls
Bob Way, Integration Engineer
Two Core Tasks2) send outgoing payments
Code
Send outgoing payments
Bob Way, Integration Engineer
Sending Payments
ripple_path_findpath_findformat “payment” transactionsignsubmit
api calls
Bob Way, Integration Engineer
Tools
Understanding the Ledger
Woot!
• 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
Brian Keller-KeikkilaCTO ZipZap
Bob Way, Integration Engineer
integration
Pay with CASH.
Bob Way, Integration Engineer
ZipZapintegration
Bob
ZipZap Merchants
Alice
$
$
PaymentCenter
Bob Way, Integration Engineer
ZipZapintegration
$
Bitstamp
SnapSwap
ZipZap
Bob Way, Integration Engineer
ZipZapintegration
$
Bitstamp
SnapSwap
Bob Way, Integration Engineer
ZipZapintegration
$
ZipZap
Bitstamp
SnapSwap
Bob Way, Integration Engineer
ZipZapintegration
SnapSwapBitstamp
ZipZap
$ $
PaymentCenter
Bob Way, Integration Engineer
ZipZapintegration
SnapSwapBitstamp
$ $
$
ZipZap
$
Alice
PaymentCenter
Bob Way, Integration Engineer
ZipZapintegration
SnapSwapBitstamp
$
$
$ $
ZipZap
Alice
Bob Way, Integration Engineer
integration
What’s Next?
THE WORLD.
Bob Way, Integration Engineer
integration
10 Minute BreakSome text goes here
About Me
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
Some text goes here
David Schwartz, Chief Cryptographer
• 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.
Key Features
A platform for issuing, holding, transferring, and trading arbitrary assets.
David Schwartz, Chief Cryptographer
Ledger
• 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.
Key Features
The ledger is public.
David Schwartz, Chief Cryptographer
Ledger Contents
• Header
• State Tree
• Transaction Tree
Ledger Contents
A new ledger built every 5 to 30 seconds.
David Schwartz, Chief Cryptographer
Ledger Contents
• 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
Ledger Header
David Schwartz, Chief Cryptographer
Ledger Contents
• 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.
Hash Tree
David Schwartz, Chief Cryptographer
Ledger Contents
• 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.
State Tree
David Schwartz, Chief Cryptographer
Ledger Contents
• Account root
• Ripple state
• Offer
• Directory
• Fee settings
• Features
• Ledger Hashes
Key Entry Types
State Tree
David Schwartz, Chief Cryptographer
Ledger Contents
{ "Account" : "rKu4m1UDLGxR6fjhdNEVWrF4gCDhpocWAQ", "Balance" : "199999990", "Flags" : 0, "LedgerEntryType" : "AccountRoot", "OwnerCount" : 0, "PreviousTxnID" : "922345F7771870688116ABD484960D5A566F38C...", "PreviousTxnLgrSeq" : 339000, "Sequence" : 2, "index" : "00118F9DC4F5767D6927A98FF749C..."}
Sample Entry
State Tree
David Schwartz, Chief Cryptographer
Ledger Contents
• 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.
Transaction Tree
David Schwartz, Chief Cryptographer
Transactions
• Account
• Public Key
• Signature
• Fee
• Type
• Sequence
• Type-specific information
Basic Structure
Cryptographically signed authorizations to modify ledger state
David Schwartz, Chief Cryptographer
Transactions
{ "Account" : "rMWUykAmNQDaM9poSes8VLDZDDKEbmo7MX", "Fee" : "10", "Flags" : 0, "OfferSequence" : 62462, "Sequence" : 582232, "SigningPubKey" : "0256C64F0378DCCCB4E0224B36F7ED1…", "TransactionType" : "OfferCancel", "TxnSignature" : "3044022000ED14…", "hash" : "FC6F9BC14A7DA643…“}
Sample Transaction
This real transaction was randomly selected.
David Schwartz, Chief Cryptographer
Transactions
Metadata
Metadata justifies ledger changes
David Schwartz, Chief Cryptographer
{ "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 }
Consensus
• 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
Key Points
Consensus establishes transaction ordering
David Schwartz, Chief Cryptographer
Consensus
• 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
Why is transaction ordering important?
Consensus establishes transaction ordering
David Schwartz, Chief Cryptographer
Consensus
• 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
What do validators do?
Consensus establishes transaction ordering
David Schwartz, Chief Cryptographer
Consensus
• 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
Why is consensus robust?
Consensus establishes transaction ordering
David Schwartz, Chief Cryptographer
Consensus
• 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
Why is consensus robust?
Consensus establishes transaction ordering
David Schwartz, Chief Cryptographer
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.
Characteristics of Ripple payments
Pathfinding makes sophisticated payments possible
David Schwartz, Chief Cryptographer
PaymentsAll 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
PaymentsCross-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
Payments
An account to account link uses a pathway to move funds from one account to another.
It is helpful to think of funds as being transferred by 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.
Account to Account Link
Two types of path links
Order book links can change currencies.
Path specifies the order book, not specific orders.
Order book links appear with account links for their issuers.
Order Book Link
David Schwartz, Chief Cryptographer
Payments
Only one server needs to do the pathfinding work for a given payment.
Pathfinding generates a set of paths for the transaction and gives an estimate of the cost.
Degrees of separation tend to be short.
Current Ripple servers use a table driven pathfinding engine.
There is room for innovation in path finding.
Pathfinding
Every validator executes the transaction.
Path set is already known.
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.
Payments succeed or fail atomically.
Must be completely deterministic.
Execution
Division of labor
David Schwartz, Chief Cryptographer
Trading
Marking making is offering to buy and sell the same asset over a period of time.
Market making in Ripple makes large payments possible and improves rates.
Market makers link cash-in networks with cash-out networks, making remittance efficient.
Market Making
Arbitrage is buying and selling the same asset at approximately the same time to profit from a difference in price.
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.
Arbitrage
Ripple supports order books between all asset pairs.
David Schwartz, Chief Cryptographer
Invisible 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.
Inbound payments using Ripple
Ripple can be the back end that makes a payment work
David Schwartz, Chief Cryptographer
Invisible Ripple
• 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.
Advantages
Ripple can be the back end that makes a payment work
David Schwartz, Chief Cryptographer
XRP
• 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.
Characteristics:
What is it for?
David Schwartz, Chief Cryptographer
Conclusion
• Do what you do best.
• Everything works together.
- Currencies don’t matter.
- Locations don’t matter.
- Institutions don’t matter.
Ripple completes commerce
David Schwartz, Chief Cryptographer
The Internet works. Shipping works. Payments are broken.
Conclusion
• 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.
What does Ripple offer?
David Schwartz, Chief Cryptographer
Any questions?Some text goes here
David Schwartz, Chief Cryptographer
ContractsSome text goes here
About Me
Stefan Thomas
Some text goes here
CTO, Ripple Labs
Previous:
Bitcoin Scripts
Outputs and inputs connect
A simple stack machine.
Bitcoin Scripts
• 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!
Outputs and inputs connect
A simple stack machine.
Bitcoin Scripts
• Limited set of opcodes
• No ability to reference external data
• No concept of accounts
Limitations
A simple stack machine.
Contracts
• Contracts use arbitrary x86 code
• Ledger is a generic key/value store
Consensus for your own apps
A distributed Turing machine.
Escrow
Mediator should only be able to send funds to one of the parties, but not to
herself.
Two parties transacting with mediator
Basic example.
Escrow
2 <K1> <K2> <K3> 3 CHECKMULTISIGVERIFY
2 of 3 multisig in Bitcoin
A basic example.
Escrow
if (check_multisig(2, 3, payload[“sigs”], local[“keys”])) send_funds(payload[“dest”]);
2 of 3 multisig in Ripple
A basic example.
Escrow
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;}
Someone has to actually implement check_multisig…
A basic example.
It’s a contract!
Escrow
Code duplication?
A basic example.
• Contracts can link to other contracts as libraries
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)
Escrow
• 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)
What about verify_ecdsa_sig?
Basic example.
Escrow
• A contract generates a static piece of data called the “agenda”.
SEND_CONTRACT_FUNDS_ALL [destination_account]
• Think of it like an SQL query.
And what about send_funds?
Basic example.
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;
Details
• 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
Some more notes on how it all works
We skipped a lot of stuff.
Subscriptions
• I want to have a contract that says:
“You can take up to 10 USD/Bitstamp out of my account per month.”
Let’s ramp things up a bit!
This is a bit more interesting.
Microgateways
*rolls up sleeves*
Goal: Can we get PayPal support without… PayPal support?
Ok, now we’re starting to talk craziness.
Microgateways
• 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
Contracts managing peer-to-peer transactions
Ok, now we’re starting to talk craziness.
Microgateways
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?
SSL proofs
Ok, now we’re starting to talk craziness.
Microgateways
• 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.
Problem: How are these IOUs issued?
Ok, now we’re starting to talk crazy.
Microgateways
• 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?
Bigger problem: How are these IOUs redeemed?!
Ok, now we’re starting to talk crazy.
Microgateways
• Two main options:
– If underlying asset is inflationary: Do nothing
– If underlying asset is deflationary: Add demurrage to IOUs
IOU inflation
Ok, now we’re starting to talk crazy.
Microgateways
• 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
Let’s recap
Ok, now we’re starting to talk crazy.
Autonomous Agents
• Agents need somewhere to run.
– Physical autonomous agents (e.g. self-driving cars)
– Hosted autonomous agents (hosting risk)
– Distributed autonomous agents (first time possible with Ripple)
• And they need to hold funds.
If code can own money…
He’s lost it.
Autonomous Agents
• 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”
… fun things happen.
He’s lost it.
Capital contracts
• Developers write agents and publish them
• Investors fund them
• Can be as flexible or rigid as needed
An alternative to the evolutionary model
Putting it all together.
Any questions?Some text goes here
Thanks For Joining Us!Some text goes here
We’re Hiring!
Business Development
• VP of Financial Services
• VP of Emerging Markets
Software Development
• Sr. Javascript Engineer
• Lead Android Developer
• Data Analyst
ripple.com/jobs - Inquire with [email protected]
Product
• Integration Engineer
• Product Manager of Platform
• Technical Writer
• UX Product Designer