From a59b1728e8d9aa641f8c9e2ff19c4a8c99969129 Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Tue, 2 Dec 2014 18:06:30 -0800 Subject: [PATCH] [DOC] deposit/withdraw processes sketched out --- content/exchange_to_gateway.md | 75 +++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/content/exchange_to_gateway.md b/content/exchange_to_gateway.md index 1db7670696..129fa6a4e9 100644 --- a/content/exchange_to_gateway.md +++ b/content/exchange_to_gateway.md @@ -8,6 +8,77 @@ h2. Ripple Gateways Explained A Ripple _*Gateway*_ is an entity that exchanges balances in the Ripple Network for balances in the Ripple Network -- in other words, performing deposits and withdrawals from Ripple. Typically, a Gateway holds money (or other assets of value) outside of Ripple, and creates _*issuances*_ in the Ripple Network that represent that money and can be sent, traded, and exchanged atomically in Ripple. - +h3. Prior to Ripple Integration -A digital exchange already accepts withdrawals and deposits from users using some existing system. In the United States, +A digital exchange already accepts withdrawals and deposits from users using some existing system, and uses some internal accounting system to track how much balance each user has with the exchange. Such a system can be modeled simply like this: + + + +h3. Adding Ripple Deposits + +Two changes are necessary in order to become a Ripple Gateway. First, you must modify your accounting system to track money that is backing funds issued on the Ripple Network. This could be as simple as adding a record in your core accounting system for Ripple. Second, you must create and follow a process for "deposits" into Ripple, and "withdrawals" from Ripple. These are similar to, but separate from the process of depositing and withdrawing money from the exchange. + +A deposit into Ripple involves the following steps: + +1. Alice asks to deposit €2 of her balance into Ripple +2. In its internal accounting, ACME debits Alice's balance €2 and credits the Ripple-backed balance by €2. +3. ACME submits a Ripple transaction, sending €2 to Alice's Ripple address. The €2 is marked in Ripple as being "issued" by ACME. + + + +There are several prerequisites that ACME must meet in order for this to happen: + +- ACME must have a Ripple account. Our best practices recommend actually having at least two accounts, so that the account creating issuances in Ripple is exposed to less risk than the account(s) performing day-to-day transactions. +- ACME needs to know Alice's Ripple address. +- Alice must create a trustline from her Ripple address to ACME. + +h3. Trading on Ripple + +(TODO: flesh out) + +- Anyone can buy/sell EUR@ACME on Ripple + - including users who don't have ACME accounts (caveat: requireauth flag) +- Ripple users trading and sending EUR@ACME to one another requires no intervention by ACME + + +h3. Withdrawing from Ripple + +(TODO: flesh out) + +- ACME should honor its obligations + - but should do KYC first + +Withdrawal process: (like a deposit in reverse!) + +1. Bob sends Ripple transaction of €1 to ACME +2. In its internal accounting, ACME debits its Ripple-backing balance €1 and credits Bob's balance €1.