mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 11:45:50 +00:00
Information Architecture v3 (#1934)
* Update look up escrows to remove redundant info about lookups via sender/destination. Modify cancel expired escrow for brevity. * Cancel escrow: fix notes * Add draft of updated cancel-escrow.js. * Update intro to escrows. * Add Escrow Tutorial * Minor corrections * Fix headings, add HTML * Update escrow docs This commit re-createsf205a92db2with some adjustments: - Omit the accidentally-created dir full of junk - Fix some typos and one mistake in the Escrow limitations section - Add a table to the EscrowCreate ref to clarify valid combos of fields. * Concept info from send-a-time-held-escrow added to escrow.md * IA: Move "Consensus Network" files This re-creates some work from the original commit56fffe0b9f* Rewrite escrows article (re-created) This commit re-creates relevant work from the following commits:9a4a588f2bUpdate escrow.md context infoe1b017dc83Remove references to using escrow for interledger payments. * IA: Move "XRPL servers" files This re-creates some work from original commit7611979abf* IA: move "production readiness" files. Re-creates work from the following commit:692438693aMove tutorials to concepts * New intro articles Original commit:56fffe0b9f* IA: Reorg account concepts Re-creates some work from original commit56fffe0b9f* IA: reorg transaction concepts Original commits:9d4eff9940WIP - reorg accounts7611979abfWIP dir. reorg * IA: reorg consensus concepts Original commit:56fffe0b9f* IA: Reorg ledger docs Original commit:56fffe0b9f- Rephrased some details of the section * IA: rename issuing/operational addresses page Original commit:56fffe0b9f* Moving use cases * Fleshing out Use Cases Note, the dactyl-config.yml file has not been fully updated. * Clean up checks conceptual info. * Remove redundant checks use case section Original commit:3c29e9c05e* IA: move Dex under tokens Original commit:d08b3ba7d7* Touch up stablecoin issuer use case (#1856) * Consolidate stablecoin use case * Stablecoin issuer: cleanup progress through sending * Stablecoin issuer: reorg second half (Note: the dactyl-config.yml is not fully reconciled yet) * Move rippled and clio tutorials into infrastructure * Remove link to checks amendement. * Add note to account_objects.md about commandline interface type field. * Merge expiration case with lifecycle section. * Interoperability Use Cases * Add graphics to intro * Move escrow use cases to dedicated page. * Update use case page intros and corresponding concept info. * Clarify meaning of direct XRP payments. * Intro link updates * Payment use cases * Remove some unnecessary links in transactions section Original commit:e6fcf4a4dc* Link cleanup in Tokens section Original commit:9588dd5e70* Touch up 'Configure Peering' section Original commit:fc8f0990b8* Clean up links in accounts section Original commit:3da5fde7a8* Add NFT mkt use case * p2p payments: edits to Wallets * Clean up payments use cases * Refine history description * IA: use case cleanup * IA: reconcile servers, ledgers sections * IA: reconcile payment types, tx, tokens * IA: reconcile accounts section * IA: reconcile infra * IA: Fix most broken links * Full Docs Index: omit from sidebar * IA: fix up most broken links * fix Absolute path link to internal content * Quick updates to Software Ecosystem * Remove some absolute links to internal resources * Fix remaining broken links in JA target * Contributing: tweak formatting * Tutorials: fix some minor issues * remove interop use cases * remove intro image and personal references to dennis * alphabetize-transaction-nav * Remove unused files * Add QS escrow tutorials * IA: move ledgers, consensus protocol files around * IA: update nav for new page hierarchy * reordering of topics under new networks and servers top-nav * Move "Naming" to "What is XRP?" * Update dactyl-config.yml Remove xrp.md from the TOC. * Update list-xrp-as-an-exchange.md Update link to what-is-xrp * Update list-xrp-as-an-exchange.ja.md Change link to what-is-xrp * Update currency-formats.md Change link to what-is-xrp * Update currency-formats.ja.md Change link to what-is-xrp * Update cancel-an-expired-escrow.md Change link to what-is-xrp * Update paymentchannelfund.md Change link to what-is-xml * Update look-up-escrows.md Change link to what-is-xrp * Update tokens.md change link to what-is-xrp * Update use-payment-channels.md * Update send-a-time-held-escrow.md Update link to what-is-xml * fix broken links * Update parallel-networks.md Change link to what-is-xml * Update parallel-networks.ja.md * Update invariant-checking.md Remove link to xrp.html * Update invariant-checking.ja.md Remove link to xrp.html * Update transaction-cost.md Change link to what-is-xrp * Update transaction-cost.ja.md Change link to what-is-xrp * Update send-a-conditionally-held-escrow.md Change link to what-is-xrp * Update stablecoin-issuer.md Change link to what-is-xrp * Update tokens.ja.md Change link to what-is-xml * Update autobridging.ja.md Change link to what-is-xrp * Update currency-formats.md update text * reorganize infrastructure nav section * Update currency-formats.md Try removing link altogether. * Update currency-formats.ja.md Remove link to what-is-xrp.html * move commandline usage topic to infrastructure * initial intro rewrite * minor update to language * IA.v3: rm Production Readiness * Delete xrp.md * Update xrp link in snippet * Add redirect for old xrp.html URL * Small edits to 'What is XRP?' article * Add missing imgs * XRP - copy edit per @DennisDawson * restructure tutorials nav and pages * fix broken links * more broken link fixes * Algo trading: 1st draft * Algo trading: notes on taxes * Algo trading: edits per review * algo trading: fix broken link * Ledger structure: rewrite for accuracy and clarity * Update links to removed 'tree format' header * Ledger Structure: Update diagrams * Re-gen CSS for ledger structure changes * Ledger structure: edits per review * IA.v3: fix broken NFT links introduced by rebase * Desktop Wallet (py): update little stuff * Update some capacity/storage details * contribute doc nav update * fix image link in create diagram page * IAv3: Fix 'Ledgers' blurb * Update full history requirements with details from community members * add reviewer suggestions * Edits per @trippled review * Apply suggestions from peer review Co-authored-by: oeggert <117319296+oeggert@users.noreply.github.com> * FH: reword file size limit note per review * Update software ecosystem * updates per review * Minor tweaks to graphics * fixTypos * Update content/concepts/introduction/software-ecosystem.md Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com> * Update content/concepts/introduction/software-ecosystem.md Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com> * [JA] update AccountDelete cost * custom transactors doc * add doc to dactyl config * [JA] fix NonFungibleTokensV1_1 amendment status * [JA] update NFTokenOffer page * Remove old, unused XRP article (#2039) * add reviewer suggestions * Add tooling to check for file/nav consistency - From the repo top, run tool/check_file_consistency.py to look for Markdown files that exist in the "content/" directory but aren't used in the documentation. - New "enforce_filenames" filter prints a warning to console when building, if a file's path and filename don't match expectations based on its place in the nav and top heading. * File consistency checker: correctly handle filenames starting in _ * Remove unused old 'get started' and associated code * Create Resources section & reorg some files - Rename some files/folders based on their place in the nav - Move a bunch of non-documentation stuff, and docs on contributing code and/or docs to the new "Resources" section. - Known issue: nav spills into a second row on page widths between 993px-1110px. To be fixed in a later CSS update, maybe along with making the Resources dropdown multi-column. * Fix #2078 code tab bug CSS not built yet, to reduce merge conflicts. Won't have any effect until that happens. * fix Transaction JSON * [JA] translate contributing contents * fix contributing-to-documentation parent * fix contribute-code blurb * Top nav: add cols for Resources, fix broken links * CSS: fix top nav overflows * Fix broken link from redirect not in JA target * Top nav: add Infra to article types * Update contrib info & rename intro file * [ja] Update link to suggested first page to translate * [ja] fix contribute docs organization * Run private network with docker tutorial (#2065) * [NO-ISSUE] Run private network with docker tutorial Adds a tutorial page in the Infrastructure section on how to run a private XRPL network with Docker. Please let me know if you think this is a useful page to include for developers, whether the steps are clear or not, and if you have suggestions on what can be added to it. * Add minor link fixes and Japanese target * Apply suggestions from code review Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com> * Add link to ripple-docker-testnet setup scripts in See Also section * Update repo URL --------- Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com> * add intro gfx (#2036) * add intro gfx * Move graphic up * Update some graphics with their revised versions * Add updated version of the custodial vs non-custodial graphic --------- Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com> Co-authored-by: Amarantha Kulkarni <akulkarni@ripple.com> * Update to reflect current UNL publishers * [ja] update contributing Co-authored-by: tequ <git@tequ.dev> * Incorporate feedback on "What is XRP" page. (#2099) * Add trademark info for XRP * Revert section to previous state * Fix broken link (#2101) --------- Co-authored-by: Oliver Eggert <oeggert@ripple.com> Co-authored-by: ddawson <dennis.s.dawson@gmail.com> Co-authored-by: Maria Shodunke <mshodunke@ripple.com> Co-authored-by: tequ <git@tequ.dev> Co-authored-by: oeggert <117319296+oeggert@users.noreply.github.com> Co-authored-by: Amarantha Kulkarni <amarantha-k@users.noreply.github.com> Co-authored-by: develoQ <develoQ.jp@gmail.com> Co-authored-by: Maria Shodunke <maria-robobug@users.noreply.github.com> Co-authored-by: Amarantha Kulkarni <akulkarni@ripple.com>
This commit is contained in:
101
content/use-cases/defi/algorithmic-trading.md
Normal file
101
content/use-cases/defi/algorithmic-trading.md
Normal file
@@ -0,0 +1,101 @@
|
||||
---
|
||||
html: algorithmic-trading.html
|
||||
parent: defi-uc.html
|
||||
blurb: The XRP Ledger's decentralized exchange consists of an unlimited number of currency pairs, tracked on-demand when users make trades.
|
||||
labels:
|
||||
- Transactions
|
||||
---
|
||||
# Algorithmic Trading
|
||||
|
||||
The XRP Ledger's decentralized exchange presents an opportunity to earn money through _algorithmic trading_, which means running a computer program to find and take profitable trading opportunities automatically. In algorithmic trading, you typically make many trades based on quantitative factors to earn steady, small profits; this is unlike traditional manual trading where you make a few long-term investments based on market fundamentals and wait to earn a large return over time. Blockchains are often more suitable for algorithmic trading than manual trading, because the high volatility of cryptocurrencies in general makes them less suitable for traditional "buy and hold" investing; the XRP Ledger is particularly suited for algorithmic trading, for several reasons:
|
||||
|
||||
- Decentralized exchange data is public and freely available.
|
||||
- Trades settle in seconds, enabling frequent trading without specialized equipment.
|
||||
- Transaction fees on the XRP Ledger are low.
|
||||
|
||||
## Trading Strategies
|
||||
|
||||
Algorithmic trading can make profits through many different strategies; part of the challenge (or the fun) of algorithmic trading is designing and implementing your own unique approach. From a high level, algorithmic trading approaches often fall into the following categories:
|
||||
|
||||
- **Arbitrage:** Buying and immediately selling an asset to take advantages of price differences. This could involve finding sets of 3 or more assets where the prices aren't aligned, or using the XRP Ledger to move assets between private exchanges where the prices are different.
|
||||
- **Quantitative Trading:** Predicting and taking advantage of future price movements based on past price movements, outside data, or both. Examples include [candlestick patterns](https://blog.quantinsti.com/candlestick-patterns-meaning/), correlating an asset's price movements with other assets, and using sentiment analysis of social media.
|
||||
- **Front-running:** Taking advantage of pending trades, especially large ones, by buying and immediately reselling the assets those trades are buying. Front-running is often frowned-upon because it takes profits from other traders without adding liquidity or enabling exchanges that otherwise wouldn't occur. The XRP Ledger's canonical ordering of transactions makes front-running difficult, but not impossible.
|
||||
|
||||
### Arbitrage Examples
|
||||
|
||||
There are many ways to perform arbitrage, both within and adjacent to the XRP Ledger. The following examples are meant to illustrate potential strategies, but others are possible as well.
|
||||
|
||||
You can use **circular payments** to complete multi-asset trades for a profit. The XRP Ledger automatically connects overlapping trades between pairs of assets, as well as sets of 3 assets where XRP is the asset in the middle. However, the XRP Ledger protocol does not automatically find and compete trades across other, longer or more complex paths. (Finding the _best possible_ path is a category of problem that is known to be computationally intensive.) Therefore, if you do your own pathfinding, it is possible to find profitable arbitrage opportunities like this; if you do, you can specify those [paths](paths.html) explicitly in a [Payment transaction](payment.html). For example, imagine there are three tokens, FOO, BAR, and TST, each with different issuers. If you can buy 2 BAR by spending 1 FOO, then buy 3 TST by spending those 2 BAR, and finally buy 1.1 FOO by spending 3 TST, you can earn a profit of 0.1 FOO minus any costs of the transaction such as [transfer fees](transfer-fees.html) of the tokens involved.
|
||||
|
||||
You can perform **cross-exchange arbitrage** if you have accounts at multiple private exchanges where the prices for an asset are different. For example, if you can buy XRP at ACME Exchange for $0.45 per 1 XRP, then move the XRP over to WayGate Exchange where you sell it for $0.50 per 1 XRP, you can make a profit of $0.05 per XRP minus the costs of trading and sending the relevant transactions, including exchanges' fees to withdraw and deposit your profits. As a more complex example, if the BTC:ETH price shifts at ACME Exchange to make ETH cheaper relative to BTC, you could potentially take advantage of this price shift by selling ETH→XRP at one exchange, then moving the XRP to ACME Exchange and trading XRP→BTC→ETH for a profit there. Since XRP Ledger transactions settle in seconds but Ethereum transactions can take minutes and Bitcoin transactions can take hours, using XRP as a bridge currency can potentially allow you to take advantage of this opportunity sooner than simply trading ETH→BTC and then BTC→ETH at ACME Exchange. (This only works, of course, if there is enough liquidity and tight enough spreads that exchanging to XRP and back doesn't cost more than your profits.)
|
||||
|
||||
|
||||
## Background Reading
|
||||
|
||||
You can familiarize yourself with algorithmic trading, in general, by reading the following resources:
|
||||
|
||||
- [Investopedia: Basics of Algorithmic Trading: Concepts and Examples](https://www.investopedia.com/articles/active-trading/101014/basics-algorithmic-trading-concepts-and-examples.asp)
|
||||
- [_Flash Boys: A Wall Street Revolt_ by Michael Lewis](https://wwnorton.com/books/Flash-Boys/)
|
||||
- [Investopedia: How Arbitraging Works in Investing, With Examples](https://www.investopedia.com/terms/a/arbitrage.asp)
|
||||
|
||||
The following pages describe key elements of how the XRP Ledger's decentralized exchange works:
|
||||
|
||||
- [Tokens](tokens.html)
|
||||
- [Decentralized Exchange](decentralized-exchange.html)
|
||||
- [Offers](offers.html)
|
||||
|
||||
|
||||
## Testing and Common Mistakes
|
||||
|
||||
Like any type of trading, algorithmic trading is not a surefire way to make money; there are many ways you might take a loss. Compared with manual trading, algorithmic trading has much less room for error. If you make a small mistake, but multiply it by a large number of trades, your losses can add up quickly before you have a chance to fix the problem. Therefore, it's wise to do various tests to make sure that your trading strategy will actually make a profit. You might do any or all of the following to test your strategy or the actual implementation of it (often called a _bot_):
|
||||
|
||||
- Manually calculate the potential returns based on the current ledger state or past trades.
|
||||
- Record historical data and feed it to your bot, then record what actions the bot would have taken and compare the results against the actual historical price movements.
|
||||
- Model or predict the results of your approach in various plausible future scenarios.
|
||||
|
||||
Common mistakes you might make in these calculations or in building your bot include:
|
||||
|
||||
- Rounding errors. If your math is not sound, or does not match the precision that the blockchain uses, you could inaccurately predict the results of a trade and take a loss, or have your trade not execute at all. The XRP Ledger uses different precision for token and XRP amounts, which can lead to rounding in unexpected places when trading one for the other. For more details on the precision used in the protocol, see [Currency Formats](currency-formats.html).
|
||||
- Be aware that token issuers can further limit the precision of exchange rates involving their tokens. See [Tick Size](ticksize.html) for details.
|
||||
- Typically, you need to adjust your amounts by some small percentage to account for potential differences in rounding or price movements between when you looked things up and when your trade executes. This amount is called _slippage_, and it's important to get the right amount. If it's too low, your transaction may not execute at all; but if it's too high, you're vulnerable to front-running, and the higher it is the more that price movements can cut into your profits in general.
|
||||
- Forgetting extra costs and delays. For example, if two stablecoins are both fully backed by US dollars, but one issuer charges a 0.5% transfer fee and a different issuer charges a 0.25% [transfer fee](transfer-fees.html), you should expect about a 0.25% difference in the effective price those stablecoins trade at. Don't forget the costs of sending a transaction, even though they're usually small, nor the consequences of other potential delays. For example, even if an off-ledger private exchange shows a favorable price now, if that exchange takes hours or even days to process a deposit, the price is likely to shift so you can't take advantage of it unless you already have liquidity at that exchange.
|
||||
- Not accounting for rare events. Even setting aside unprecented ("black swan") events, your calculations can be skewed by individual outliers. As one example (which is a true story), a trader reported that, when calculating the potential profits of a given strategy in a specific time range, over 80% of the profits came from a single "fat-fingered" transaction where another user had accidentally added an extra zero to their price. The same strategy was far less profitable when calculated against time ranges that didn't include the outlier transaction.
|
||||
- Not reading transaction flags. The flags of an XRP Ledger transaction can have significant impacts on the way that transaction is processed and when the protocol marks it as "successful". For example, the flags of "Offer" transactions can make it a "fill or kill" order that only trades if the full amount can be obtained immediately; the flags of "Payment" transactions can make them [partial payments](partial-payments.html) that succeed even if they can't deliver the full amount to the intended destination. You need to do bitwise math to parse the `Flags` field of a transaction, but your expectations can be totally wrong if you skip doing so.
|
||||
|
||||
## Taxes and Licensing
|
||||
|
||||
The legal requirements for trading on a blockchain vary by jurisdiction. In many cases, there are no licensing or other legal barriers to getting started, but you may be required to report your profits for tax purposes, especially if your gains or losses are over some thresholds. In the United States, you typically report profits (or losses) from trading as capital gains, which means you need to calculate the cost basis for the assets you buy at the time you acquire them. There are various tools out there that may be able to help track your trading activity or even generate the appropriate tax forms, depending on your individual situation. Depending on which assets you are trading and your trading strategies, the details may vary. Be sure to do your research or consult with a tax professional before you get started with algorithmic trading.
|
||||
|
||||
|
||||
## Technical Details
|
||||
|
||||
### Placing Trades
|
||||
|
||||
Buying and selling _fungible_ tokens and XRP within the XRP Ledger's decentralized exchange typically involves sending [OfferCreate transactions](offercreate.html). For a detailed walkthrough of the code and technical steps to place a trade this way, see [Trade in the Decentralized Exchange](trade-in-the-decentralized-exchange.html). It is also possible to exchange currencies using the [Payment transaction type](payment.html). You could send a [cross-currency payment](cross-currency-payments.html) to another user or even send it back to yourself, using a long [path](paths.html) to link arbitrage opportunities together into a single operation.
|
||||
|
||||
Non-fungible tokens work differently; for the code and technical steps to trade NFTs, see [Transfer NFTokens Using JavaScript](transfer-nfts-using-javascript.html).
|
||||
|
||||
### Reading Trade Data
|
||||
|
||||
There are many sources of information about the trading activity in the XRP Ledger. Depending on your trading strategy and use case, you may be able to connect to the XRP Ledger through [Public Servers](public-servers.html), but you can often benefit from running your own server, and some use cases may not be practical without doing so. See [Install `rippled`](install-rippled.html) for instructions on how to set up a core server in P2P mode.
|
||||
|
||||
If your approach involves following other transaction activity, you may need to read the transactions' detailed metadata to know exactly how much they traded. Offers can partially execute and may consume multiple matching offers. For a detailed explanation of how to interpret transaction metadata, see [Look Up Transaction Results](look-up-transaction-results.html).
|
||||
|
||||
To give yourself as much time as possible to react to profit-taking opportunities, you may also want to look at pending data from the [Open Ledger](open-closed-validated-ledgers.html), or even monitor for proposed transactions. If you're connected to WebSocket, you can use the [subscribe method](subscribe.html) with the `transactions_proposed` stream to see transactions before they're validated by consensus; you can also limit this to a subset of transactions that affect a particular account (for example, the issuer of a token you're interested in trading) by subscribing using the `accounts_proposed` parameter.
|
||||
|
||||
### Future Developments
|
||||
|
||||
Ripple has proposed extending the XRP Ledger protocol with a native Automated Market Maker (AMM) design that would work alongside the existing central limit order based (CLOB) decentralized exchange. If this proposal is accepted and becomes enabled as an [amendment](amendments.html), AMMs will become an important factor in trading on the XRP Ledger. You can read more at the following links:
|
||||
|
||||
- [XLS-30d: Automated Market Maker standards proposal](https://github.com/XRPLF/XRPL-Standards/discussions/78)
|
||||
- [AMM documentation (Ripple Open Source site)](https://opensource.ripple.com/docs/xls-30d-amm/automated-market-makers/)
|
||||
|
||||
## Further Reading
|
||||
|
||||
The following articles provide some more specific examples and interesting information about how these strategies work on other blockchains. This information isn't necessary to get started, but may help to provide perspective.
|
||||
|
||||
- [Ethereum is a Dark Forest](https://www.paradigm.xyz/2020/08/ethereum-is-a-dark-forest)
|
||||
- [Flash Boys 2.0: Frontrunning, Transaction Reordering, and Consensus Instability in Decentralized Exchanges (PDF)](https://arxiv.org/pdf/1904.05234.pdf)
|
||||
- [Slippage in AMM Markets](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4133897)
|
||||
- [Frontrunner Jones and the Raiders of the Dark Forest: An Empirical Study of Frontrunning on the Ethereum Blockchain](https://www.usenix.org/conference/usenixsecurity21/presentation/torres)
|
||||
- [SoK: Transparent Dishonesty: front-running attacks on Blockchain (PDF)](https://arxiv.org/pdf/1902.05164)
|
||||
610
content/use-cases/defi/list-xrp-as-an-exchange.ja.md
Normal file
610
content/use-cases/defi/list-xrp-as-an-exchange.ja.md
Normal file
@@ -0,0 +1,610 @@
|
||||
---
|
||||
html: list-xrp-as-an-exchange.html
|
||||
parent: defi-uc.html
|
||||
blurb: デジタルアセット取引所でXRPを上場するために必要な手順の概要を説明します。
|
||||
labels:
|
||||
- XRP
|
||||
---
|
||||
# 取引所としてのXRPの上場
|
||||
|
||||
本書では、取引所がXRPを上場するために必要なステップを説明します。
|
||||
|
||||
## Alpha Exchange
|
||||
|
||||
本書での説明目的で、架空の企業である _Alpha Exchange_ を使用して、XRPを上場するために必要な手順の概要を説明します。本書では、Alpha Exchangeは以下のような取引所です。
|
||||
|
||||
* 現在BTC/USDの上場を専門としています
|
||||
|
||||
* BTC/XRPとXRP/USDの取引ペアの追加を希望しています
|
||||
|
||||
* すべての顧客の残高を保持しています
|
||||
|
||||
* サポートしている各通貨の残高を保持しています
|
||||
|
||||
### ユーザーの利益
|
||||
|
||||
Alpha Exchangeは、BTC/XRPおよびXRP/USDの取引ペアを上場することを希望しています。理由の1つとして、これらのペアがユーザーにとって有用なものであることが挙げられます。特に、このサポートによりユーザーは以下ができるようになります。
|
||||
|
||||
* XRP Ledger _から_ Alpha Exchange _に_ XRPを入金できます
|
||||
|
||||
* Alpha Exchange _から_ XRP Ledger _に_ XRPを送金できます
|
||||
|
||||
* XRPをBTCやUSDなどの他の通貨と交換できます
|
||||
|
||||
## XRPをサポートするための前提条件
|
||||
|
||||
XRPをサポートするために、Alpha Exchangeでは以下を行う必要があります。
|
||||
|
||||
* 新しい[アカウント](#アカウント)を作成して維持します
|
||||
|
||||
* [バランスシート](#バランスシート)を作成して維持します
|
||||
|
||||
関連項目:
|
||||
|
||||
* [ゲートウェイコンプライアンス](stablecoin-issuer.html#compliance-guidelines) — ゲートウェイと取引所は異なりますが、取引所は地域の規制に準拠し、適切な当局の監督下になければなりません。
|
||||
|
||||
* [Requirements for Sending to XRP Ledger](stablecoin-issuer.html#requirements-for-sending-to-xrp-ledger)
|
||||
|
||||
* [Requirements for Receiving from XRP Ledger](stablecoin-issuer.html#requirements-for-receiving-from-xrp-ledger)
|
||||
|
||||
* [ゲートウェイの注意事項](stablecoin-issuer.html#precautions)
|
||||
|
||||
### Partial Payments
|
||||
|
||||
追加の前に、取引所は[Partial Payments](partial-payments.html)機能について知っておく必要があります。この機能を使用すると、XRP Ledgerのユーザーは、`SendMax`を増やさずに、受取金額を減額して、支払いを正常に送信できます。この機能は、送信者側に追加費用が発生せず、[支払いの返金](stablecoin-issuer.html#bouncing-payments)に便利です。
|
||||
|
||||
#### Partial Paymentsに関する警告
|
||||
|
||||
[tfPartialPaymentフラグ](payment.html#paymentのフラグ)が有効にされると、`Amount`フィールド **_は受取り金額とは同じでなくなることがあります_** 。支払いのメタデータにある`delivered_amount`フィールドは、宛先アカウントが実際に受け取る通貨の金額を示しています。支払いを受信するときに、Amountフィールドの代わりに、`delivered_amount`を使用してアカウントで受信した金額を判断します。
|
||||
|
||||
**警告:** この機能が悪用されることがあります。詳細については、[Partial Payments](partial-payments.html)を参照してください。
|
||||
|
||||
### アカウント
|
||||
|
||||
XRPは、XRP Ledgerの _アカウント_ ( _ウォレット_ や _アドレス_ とも呼ばれる)で保持されます。XRP Ledgerのアカウントは、例えばBitcoinのような、アカウントに経費がほとんどまたは一切かからない他のブロックチェーンの台帳とは異なります。XRP Ledgerでは、[アカウントの削除](accounts.html#アカウントの削除)は可能が、各アカウントは個別の、他の人に送信することのできない、[XRPの準備金](reserves.html)を保持する必要があります。このような理由から、Rippleでは利用機関に対し、必要のない過剰なアカウントを作成しないように勧めています。
|
||||
|
||||
<!-- STYLE_OVERRIDE: hot wallet, warm wallet, cold wallet, wallet -->
|
||||
|
||||
Rippleが推奨するベストプラクティスに従い、Alpha Exchangeは、XRP Ledgerに最低2つのアカウントを作成する必要があります。シークレットキーが悪用された場合の危険を最小限にとどめるため、Rippleでは、[ _コールドアカウント_ 、 _ホットアカウント_ 、 _ウォームアカウント_ ](https://ripple.com/build/issuing-operational-addresses/)(それぞれコールドウォレット、ホットウォレット、ウォームウォレットとも呼ばれる)の作成をお勧めしています。コールド/ホット/ウォームのモデルは、セキュリティと利便性のバランスをとるためのものです。XRPを上場する取引所は、以下のアカウントを作成する必要があります。
|
||||
|
||||
* 大部分のXRPと顧客の資金を維持する[ _コールドウォレット_ ](account-types.html#発行アドレス)。取引所にとって、これはユーザーが[預入れ](#取引所へのxrpの入金)をするアドレスです。 セキュリティを最適化するため、このアカウントのシークレットキーはオフラインにする必要があります。
|
||||
|
||||
取引所のコールドウォレットが悪用されると、以下のような結果が生じるおそれがあります。
|
||||
|
||||
* 不正使用者が、コールドウォレットの全XRPにアクセスできます。
|
||||
|
||||
* マスターキーが悪用されると、不正使用者は(マスターキーを無効にし、新しいレギュラーキーや署名者リストを設定することにより)そのコールドウォレットを恒久的に制御できます。これにより、その不正使用者は今後そのコールドウォレットで受信するすべてのXRPも制御できるようになります。
|
||||
|
||||
* このような事態が発生した場合には、取引所は新しいコールドウォレットアドレスを作成し、顧客にその新しいアドレスを伝える必要があります。
|
||||
|
||||
* レギュラーキーや署名者リストが悪用された場合には、取引所はコールドウォレットの制御を取り戻すことができます。ただし、不正使用者の行為の中には、以下のように簡単に元に戻せないものもあります。 <!-- STYLE_OVERRIDE: easily -->
|
||||
|
||||
* 不正使用者が、コールドウォレットを使用してXRP Ledgerで通貨を発行しても、その通貨の価値はだれにも認められません。(取引所が明示的にゲートウェイでもあると示した場合を除きます)。
|
||||
|
||||
* 不正使用者が、アカウントにasfRequireAuthフラグを設定した場合。この設定は解除できません。ただし、これは通貨の発行のみに関係し、ゲートウェイではない取引所には影響しません。不正使用者がマスターキーで設定または設定解除したその他の設定は、元に戻すことができます。
|
||||
|
||||
* 顧客のXRP出金や入金を管理する、日常業務を遂行するための1つ以上の[ _ホットウォレット_ ](account-types.html#運用アドレス)。例えば、ホットウォレットがあれば、取引所はこの種のXRPの自動送金を安全にサポートできます。出金要求にただちに応じるため、ホットウォレットはオンラインである必要があります。
|
||||
|
||||
不正使用されたホットウォレットによって発生するおそれのある結果についての詳細は、[Operational Account Compromise](account-types.html#運用アドレスの漏えい)を参照してください。
|
||||
|
||||
* オプションとして、コールドウォレットとホットウォレットの間で追加のセキュリティ層を提供する、1つ以上のウォームウォレット。ホットウォレットとは異なり、ウォームウォレットのシークレットキーはオンラインである必要はありません。さらに、ウォームウォレットのシークレットキーを複数の人に分散し、[マルチシグ](multi-signing.html)を導入してセキュリティを強化することもできます。
|
||||
|
||||
不正使用されたウォームウォレットによって発生するおそれのある結果についての詳細は、[スタンバイアドレスの漏えい](account-types.html#スタンバイアドレスの漏えい)を参照してください。
|
||||
|
||||
|
||||
関連項目:
|
||||
|
||||
* [発行アドレスと運用アドレス](account-types.html)
|
||||
|
||||
* [アカウントの作成](accounts.html#アカウントの作成)
|
||||
|
||||
* [準備金](reserves.html)
|
||||
|
||||
### バランスシート
|
||||
|
||||
顧客のXRPを管理するため、Alpha Exchangeは各顧客のXRP残高と自身の保有残高を追跡する必要があります。このためには、Alpha Exchangeは別のバランスシートまたは会計システムを作成し、維持する必要があります。以下の表は、このバランスシートを説明するものです。
|
||||
|
||||
新しいXRP Ledgerアカウント( _Alpha Hot_ 、 _Alpha Warm_ 、 _Alpha Cold_ )が、「*XRP LedgerのXRP残高*」表の*ユーザー*列に示されています。
|
||||
|
||||
「*Alpha ExchangeのXRP残高*」表は、新しい追加のバランスシートを表します。Alpha Exchangeのソフトウェアは、この会計システムでユーザーのXRP残高を管理します。
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><b><i>XRP Ledgerの
|
||||
XRP残高</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchange
|
||||
のXRP残高</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>ユーザー</b></td>
|
||||
<td><b>残高</b></td>
|
||||
<td></td>
|
||||
<td><b>アカウント番号</b></td>
|
||||
<td><b>ユーザー</b></td>
|
||||
<td><b>残高</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dave</td>
|
||||
<td>25,000</td>
|
||||
<td></td>
|
||||
<td>123</td>
|
||||
<td>Alice</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Edward</td>
|
||||
<td>45,000</td>
|
||||
<td></td>
|
||||
<td>456</td>
|
||||
<td>Bob</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charlie</td>
|
||||
<td>50,000</td>
|
||||
<td></td>
|
||||
<td>789</td>
|
||||
<td>Charlie</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Hot</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Warm</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Cold</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#### XRPの額
|
||||
|
||||
XRPの額は、XRP Ledgerで、符号なし整数の _drop_ として示されます。1XRPは1,000,000 dropです。Rippleでは、ソフトウェアでXRP残高をdropの整数値として格納し、これらの数値に整数演算を実行することをお勧めしています。ただし、ユーザーインターフェイスでは残高をXRPの単位で表示すべきです。
|
||||
|
||||
1drop(.000001XRP)はこれ以上分割できません。XRPと他の資産の間でFXレートを計算して表示するときには、この点にご注意ください。
|
||||
|
||||
詳細は、[通貨額の指定][]を参照してください。
|
||||
|
||||
#### 台帳上と台帳外
|
||||
|
||||
_Alpha Exchange_ のような取引所では、XRPは「台帳上」または「台帳外」に存在します。
|
||||
|
||||
* **台帳上のXRP**: XRP保有者のパブリック[アドレス](accounts.html#アドレス)を指定し、パブリックのXRP Ledgerを通じて照会できるXRP。これらの残高の取引相手はXRP Ledgerです。詳細については、[XRP](what-is-xrp.html)を参照してください。
|
||||
|
||||
* **台帳外のXRP**: 取引所の会計システムに保持されている、取引所のインターフェイスで照会できるXRP。台帳外のXRP残高はクレジットペースです。取引相手は、XRPを保有している取引所です。
|
||||
|
||||
台帳外のXRP残高は、取引所の参加者の間で取引されます。このような取引をサポートするため、取引所は取引で使用可能な、 _台帳外_ のXRP合計金額に等しい _台帳上_ のXRP残高を保持する必要があります。
|
||||
|
||||
|
||||
## 資金の流れ
|
||||
|
||||
残りのセクションでは、ユーザーによる入金、取引、XRP残高の換金の過程で、Alpha Exchangeが管理するアカウントを通じて資金がどのように流れるのかを説明します。資金の流れを解説するため、本書では、[「バランスシート」セクション](#バランスシート)で使用した表を使用します。
|
||||
|
||||
取引所の一般的な資金の流れには、主要な4つステップが伴います。
|
||||
|
||||
1. [取引所へのXRPの入金](#取引所へのxrpの入金)
|
||||
|
||||
2. [XRPの保有高のリバランス](#xrpの保有高のリバランス)
|
||||
|
||||
3. [取引所からのXRPの出金](#取引所からのxrpの出金)
|
||||
|
||||
4. [取引所でのXRPの取引](#取引所でのxrpの取引)
|
||||
|
||||
|
||||
このリストには、取引所の[前提条件](#xrpをサポートするための前提条件)が含まれていません。
|
||||
|
||||
この時点で、 _Alpha Exchange_ はXRP Ledgerの[ホットウォレット、ウォームウォレット、コールドウォレット](#アカウント)を作成し、それらをバランスシートに追加しましたが、ユーザーからの入金はまだ受け付けていません。
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><b><i>XRP Ledgerの
|
||||
XRP残高</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchange
|
||||
のXRP残高</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>ユーザー</b></td>
|
||||
<td><b>残高</b></td>
|
||||
<td></td>
|
||||
<td><b>アカウント番号</b></td>
|
||||
<td><b>ユーザー</b></td>
|
||||
<td><b>残高</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dave</td>
|
||||
<td>25,000</td>
|
||||
<td></td>
|
||||
<td>123</td>
|
||||
<td>Alice</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Edward</td>
|
||||
<td>45,000</td>
|
||||
<td></td>
|
||||
<td>456</td>
|
||||
<td>Bob</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charlie</td>
|
||||
<td>50,000</td>
|
||||
<td></td>
|
||||
<td>789</td>
|
||||
<td>Charlie</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Hot</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Warm</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Cold</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
### 取引所へのXRPの入金
|
||||
|
||||
[台帳外のXRP残高](#台帳上と台帳外)を追跡するには、取引所は新しい[バランスシート](#バランスシート)(または類似の会計システム)を作成する必要があります。以下の表は、ユーザーがXRPを入金するにつれ、Alpha Exchangeの新しいバランスシートで発生する残高の変化を示すものです。
|
||||
|
||||
CharlieというユーザーがAlpha Exchangeに50,000XRPを入金したいと希望しています。これには、以下のステップが伴います。
|
||||
|
||||
1. Charlieは50,000XRPの支払いを、Alpha Exchangeの[コールドウォレット](#アカウント)に送信します。
|
||||
|
||||
a. Charlieは識別子(このケースでは`789`)を支払いに追加し、Alpha Exchangeにある自身のアカウントに関連付けます。これは、[ _宛先タグ_ ](source-and-destination-tags.html)と呼ばれます。(これを使用するには、Alpha Exchangeは、すべての入金でCharlieのような宛先タグを必要とするように、すべてのアカウントでasfRequireDestフラグをオンに設定している必要があります。詳細については、[AccountSet Flags](accountset.html#accountsetのフラグ)を参照してください。)
|
||||
|
||||
2. Alpha Exchangeのソフトウェアは、受信される支払を検出し、`789`をチャーリーのアカウントの宛先タグとして認識します。
|
||||
|
||||
3. 受信される支払を検出すると、Alpha Exchangeのソフトウェアは、入金された50,000XRPがCharlieによって管理されるものであることを示すようにバランスシートを更新します。
|
||||
|
||||
Charlieは、これで、取引所で最大50,000XRPまで使用できます。例えば、XRPをBTCやその他のAlpha Exchangeでサポートされている通貨と取引するオファー(注文)を作成できます。
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><b><i>XRP Ledgerの
|
||||
XRP残高</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchange
|
||||
のXRP残高</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>ユーザー</b></td>
|
||||
<td><b>残高</b></td>
|
||||
<td></td>
|
||||
<td><b>アカウント番号</b></td>
|
||||
<td><b>ユーザー</b></td>
|
||||
<td><b>残高</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dave</td>
|
||||
<td>25,000</td>
|
||||
<td></td>
|
||||
<td>123</td>
|
||||
<td>Alice</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Edward</td>
|
||||
<td>45,000</td>
|
||||
<td></td>
|
||||
<td>456</td>
|
||||
<td>Bob</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charlie</td>
|
||||
<td><s>100,000</s>
|
||||
<br>50,000</td>
|
||||
<td></td>
|
||||
<td>789</td>
|
||||
<td>Charlie</td>
|
||||
<td><s>0</s>
|
||||
<br>50,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alpha Hot</td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alpha Warm</td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alpha Cold</td>
|
||||
<td><s>0</s>
|
||||
<br>50,000</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
### 取引所でのXRPの取引
|
||||
|
||||
Alpha Exchangeユーザー(Charlieなど)は、Alpha Exchangeでクレジットベースの残高を取引できます。Alpha Exchangeは、これらの取引の作成時に、新しいバランスシートでユーザーの残高を追跡する必要があります。これらの取引は、 _台帳外_ であり、XRP Ledgerから独立しています。このため、この残高の変化はXRP Ledgerには記録されません。
|
||||
|
||||
XRPを自身のXRP Ledgerアカウントに保有している顧客は、XRP Ledgerに組み込まれた分散型取引所 を使用して、ゲートウェイによって発行された通貨を取引することもできます。XRP Ledger _上_ での取引の詳細は、[オファーのライフサイクル](offers.html#オファーのライフサイクル)を参照してください。
|
||||
|
||||
|
||||
### XRPの保有高のリバランス
|
||||
|
||||
取引所は、いつでもホットウォレットとコールドウォレットの間で残高を調整できます。各残高調整には、[トランザクションコスト](transaction-cost.html)がかかりますが、それ以外にはすべてのアカウントの合計残高に影響はありません。台帳上の合計残高は、取引所で取引に使用できる合計残高を常に上回る必要があります。(XRP Ledgerのトランザクションコストをカバーできるだけの十分な余剰が必要です。)
|
||||
|
||||
以下の表は、(XRP Ledgerで[Paymentトランザクション][]を介した)Alpha Exchangeのコールドウォレットとホットウォレットの間での80,000XRPの残高調整を示すものです。コールドウォレットから引き落としが行われ、ホットウォレットに入金が行われました。この支払いを逆にすると(ホットウォレットから引き落としが行われ、コールドウォレットに入金が行われる)、ホットウォレットの残高は減少します。このような残高調整は、取引所がオンラインホットウォレットにXRPを保持することに関連するリスクを抑えるために役立ちます。
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><b><i>Alpha Exchangeの
|
||||
台帳外のXRP残高</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchangeの台帳上のXRP残高</i></b></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>アカウント番号</b></td>
|
||||
<td><b>ユーザー</b></td>
|
||||
<td><b>残高</b></td>
|
||||
<td></td>
|
||||
<td><b>XRP Ledgerアカウント</b></td>
|
||||
<td><b>残高</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>123</td>
|
||||
<td>Alice</td>
|
||||
<td>80,000</td>
|
||||
<td></td>
|
||||
<td>ホット</td>
|
||||
<td><s>0</s>
|
||||
<br>80,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>456</td>
|
||||
<td>Bob</td>
|
||||
<td>50,000</td>
|
||||
<td></td>
|
||||
<td>ウォーム</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>….</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>….</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>789</td>
|
||||
<td>Charlie</td>
|
||||
<td>50,000</td>
|
||||
<td></td>
|
||||
<td>コールド</td>
|
||||
<td><s>180,000</s>
|
||||
<br>100,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
### 取引所からのXRPの出金
|
||||
|
||||
出金により、取引所のユーザーは、取引所の台帳外バランスシートから、XRP LedgerのアカウントにXRPを移動できます。
|
||||
|
||||
この例では、Charlieは、Alpha Exchangeから25,000XRPを出金します。これには、以下のステップが伴います。
|
||||
|
||||
1. Charlieは、Alpha ExchangeのWebサイトでプロセスを開始します。彼は、25,000XRPをXRP Ledgerの特定のアカウント(以下の表では、「Charlie XRP Ledger」という名前)に送金する指示を出します。
|
||||
|
||||
2. Charlieの指示に対応し、Alpha Exchangeは以下の作業を実行します。
|
||||
|
||||
A. その金額(25,000XRP)を台帳外バランスシートのCharlieのアカウントから引き出します。
|
||||
|
||||
B. XRP Ledgerで、Alpha ExchangeのホットウォレットからCharlieのXRP Ledgerアカウントに同じ金額(25,000XRP)の支払いを送信します。
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><b><i>XRP Ledger台帳上のXRP残高</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchangeの
|
||||
台帳外のXRP残高</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchangeの台帳上のXRP残高</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>ユーザー</td>
|
||||
<td><b>残高</td>
|
||||
<td></td>
|
||||
<td><b>アカウント番号</td>
|
||||
<td><b>ユーザー</td>
|
||||
<td><b>残高</td>
|
||||
<td></td>
|
||||
<td><b>XRP Ledgerアカウント</td>
|
||||
<td><b>残高</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dave</td>
|
||||
<td>25,000</td>
|
||||
<td></td>
|
||||
<td>123</td>
|
||||
<td>Alice</td>
|
||||
<td>80,000</td>
|
||||
<td></td>
|
||||
<td>ホット</td>
|
||||
<td><s>80,000</s>
|
||||
<br>55,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Edward</td>
|
||||
<td>45,000</td>
|
||||
<td></td>
|
||||
<td>456</td>
|
||||
<td>Bob</td>
|
||||
<td>50,000</td>
|
||||
<td></td>
|
||||
<td>ウォーム</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>….</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>….</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>….</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CharlieのXRP Ledger</td>
|
||||
<td><s>50,000</s>
|
||||
<br>75,000</td>
|
||||
<td></td>
|
||||
<td>789</td>
|
||||
<td>Charlie</td>
|
||||
<td><s>50,000</s>
|
||||
<br>25,000</td>
|
||||
<td></td>
|
||||
<td>コールド</td>
|
||||
<td>100,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
626
content/use-cases/defi/list-xrp-as-an-exchange.md
Normal file
626
content/use-cases/defi/list-xrp-as-an-exchange.md
Normal file
@@ -0,0 +1,626 @@
|
||||
---
|
||||
html: list-xrp-as-an-exchange.html
|
||||
parent: defi-uc.html
|
||||
blurb: Run a digital asset exchange? Follow these steps to add XRP.
|
||||
labels:
|
||||
- XRP
|
||||
---
|
||||
# List XRP as an Exchange
|
||||
|
||||
This document describes the steps that an exchange needs to take to list XRP. These steps are targeted at _custodial exchanges_ that holds fund on behalf of users, and allows users to deposit, withdraw, and trade other digital assets, fiat currencies, or other types of assets.
|
||||
|
||||
## Alpha Exchange
|
||||
|
||||
For illustrative purposes, this document uses a fictitious business called _Alpha Exchange_ to explain the high-level steps required to list XRP. For the purposes of this document, Alpha Exchange:
|
||||
|
||||
* Currently specializes in listing BTC/USD
|
||||
|
||||
* Wants to add BTC/XRP and XRP/USD trading pairs
|
||||
|
||||
* Maintains balances for all of its customers
|
||||
|
||||
* Maintains balances for each of its supported currencies
|
||||
|
||||
### User Benefits
|
||||
|
||||
Alpha Exchange wants to list BTC/XRP and XRP/USD trading pairs partially because listing these pairs benefits its users. Specifically, this support wants to enable its users to:
|
||||
|
||||
* Deposit XRP _to_ Alpha Exchange _from_ the XRP Ledger
|
||||
|
||||
* Withdraw XRP _from_ Alpha Exchange _to_ the XRP Ledger
|
||||
|
||||
* Trade XRP with other currencies, such as BTC, USD, among others
|
||||
|
||||
## Prerequisites for Supporting XRP
|
||||
|
||||
To support XRP, Alpha Exchange must:
|
||||
|
||||
* Create and maintain new [accounts](#accounts)
|
||||
|
||||
* Create and maintain [balance sheets](#balance-sheets)
|
||||
|
||||
See also:
|
||||
|
||||
* [Compliance Guidelines](stablecoin-issuer.html#compliance-guidelines) — Token issuers and exchanges are different, but exchanges should also ensure that they are complying with local regulations and reporting to the appropriate agencies.
|
||||
|
||||
* [Requirements for Sending to XRP Ledger](stablecoin-issuer.html#requirements-for-sending-to-xrp-ledger)
|
||||
|
||||
* [Requirements for Receiving from XRP Ledger](stablecoin-issuer.html#requirements-for-receiving-from-xrp-ledger)
|
||||
|
||||
* [Precautions](stablecoin-issuer.html#precautions)
|
||||
|
||||
### Partial Payments
|
||||
|
||||
Before integrating, exchanges should be aware of the [partial payments](partial-payments.html) feature. This feature allows XRP Ledger users to send successful payments that reduce the amount received instead of increasing the `SendMax`. This feature can be useful for [returning payments](stablecoin-issuer.html#bouncing-payments) without incurring additional cost as the sender.
|
||||
|
||||
#### Partial Payments Warning
|
||||
|
||||
When the [`tfPartialPayment` flag](payment.html#payment-flags) is enabled, the `Amount` field **_is not guaranteed to be the amount received_**. The `delivered_amount` field of a payment's metadata indicates the amount of currency actually received by the destination account. When receiving a payment, use `delivered_amount` instead of the Amount field to determine how much your account received instead.
|
||||
|
||||
**Warning:** Be aware that malicious actors could exploit this. For more information, see [Partial Payments](partial-payments.html).
|
||||
|
||||
### Accounts
|
||||
|
||||
XRP is held in _accounts_ (also referred to as _wallets_ or _addresses_ ) on the XRP Ledger. Accounts on the XRP Ledger are different than accounts on other blockchain ledgers, such as Bitcoin, where accounts incur little to no overhead. In the XRP Ledger, account state is stored per ledger and accounts are [not easy to delete](deleting-accounts.html). To offset the costs associated with storing accounts, each account must hold a separate [reserve of XRP](reserves.html) that cannot be sent to others. For these reasons, Ripple recommends that institutions not create excessive or needless accounts. <!-- STYLE_OVERRIDE: hot wallet, warm wallet, cold wallet, wallet, easy -->
|
||||
|
||||
To follow Ripple's recommended best practices, Alpha Exchange should create at least two new accounts on the XRP Ledger. To minimize the risks associated with a compromised secret key, Ripple recommends creating [_cold_, _hot_, and _warm_ accounts](account-types.html) (these are sometimes referred to, respectively, as cold, hot, and warm wallets). The hot/warm/cold model is intended to balance security and convenience. Exchanges listing XRP should create the following accounts:
|
||||
|
||||
* A [_cold wallet_](account-types.html#issuing-address) to securely hold the majority of XRP and customers' funds. For exchanges, this is also the address to which its users send [deposits](#deposit-xrp-into-exchange). To provide optimal security, this account's secret key should be offline.
|
||||
|
||||
If a malicious actor compromises an exchange's cold wallet, the possible consequences are:
|
||||
|
||||
* The malicious actor gets full access to all XRP in the cold wallet.
|
||||
|
||||
* If the master key is compromised, the malicious actor can irrevocably take control of the cold wallet forever (by disabling the master key and setting a new regular key or signer list). This would also give the malicious actor control over all future XRP received by the cold wallet.
|
||||
|
||||
* If this happens, the exchange has to make a new cold wallet address and tell its customers the new address.
|
||||
|
||||
* If the regular key or signer list are compromised, the exchange can regain control of the cold wallet. However, some of a malicious actor's actions cannot easily be undone: <!-- STYLE_OVERRIDE: easily -->
|
||||
|
||||
* The malicious actor could issue tokens in the XRP Ledger by using the cold wallet, but those tokens should not be valued by anyone (unless the exchange is also a token issuer).
|
||||
|
||||
* If a malicious actor enables the [Authorized Trust Lines](authorized-trust-lines.html) setting for the account, that cannot be unset, although this only relates to issuing tokens and should not affect an exchange that is not also an issuer. Any other settings a malicious actor changes with a master key can be reverted.
|
||||
|
||||
* One or more [_hot wallets_](account-types.html#operational-addresses) to conduct the day-to-day business of managing customers' XRP withdrawals and deposits. For example, with a hot wallet, exchanges can securely support these types of automated XRP transfers. Hot wallets need to be online to service instant withdrawal requests.
|
||||
|
||||
For more information about the possible consequences of a compromised hot wallet, see [Operational Account Compromise](account-types.html#operational-address-compromise).
|
||||
|
||||
* Optionally, one or more warm wallets to provide an additional layer of security between the cold and hot wallets. Unlike a hot wallet, the secret key of a warm wallet does not need to be online. Additionally, you can distribute the secret keys for the warm wallet to several different people and implement [multi-signing](multi-signing.html) to increase security.
|
||||
|
||||
For more information about the possible consequences of a compromised warm wallet, see [Standby Account Compromise](account-types.html#standby-address-compromise).
|
||||
|
||||
|
||||
See also:
|
||||
|
||||
* [Issuing and Operational Addresses](account-types.html)
|
||||
|
||||
* [Creating Accounts](accounts.html#creating-accounts)
|
||||
|
||||
* [Reserves](reserves.html)
|
||||
|
||||
### Balance Sheets
|
||||
|
||||
To custody its customers' XRP, Alpha Exchange must track each customer's XRP balance and its own holdings. To do this, Alpha Exchange must create and maintain an additional balance sheet or accounting system. The following table illustrates what this balance sheet might look like.
|
||||
|
||||
The new XRP Ledger accounts (_Alpha Hot_, _Alpha Warm_, _Alpha Cold_) are in the *User* column of the *XRP Balances on XRP Ledger* table.
|
||||
|
||||
The *Alpha Exchange XRP Balances* table represents new, additional balance sheet. Alpha Exchange’s software manages their users’ balances of XRP on this accounting system.
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><b><i>XRP Balances
|
||||
on XRP Ledger</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchange
|
||||
XRP Balances</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>User</b></td>
|
||||
<td><b>Balance</b></td>
|
||||
<td></td>
|
||||
<td><b>Account #</b></td>
|
||||
<td><b>User</b></td>
|
||||
<td><b>Balance</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dave</td>
|
||||
<td>25,000</td>
|
||||
<td></td>
|
||||
<td>123</td>
|
||||
<td>Alice</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Edward</td>
|
||||
<td>45,000</td>
|
||||
<td></td>
|
||||
<td>456</td>
|
||||
<td>Bob</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charlie</td>
|
||||
<td>50,000</td>
|
||||
<td></td>
|
||||
<td>789</td>
|
||||
<td>Charlie</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Hot</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Warm</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Cold</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
#### XRP Amounts
|
||||
|
||||
Amounts of XRP are represented on the XRP Ledger as an unsigned integer count of _drops_, where one XRP is 1,000,000 drops. Ripple recommends that software store XRP balances as integer amounts of drops, and perform integer arithmetic on these values. However, user interfaces should present balances in units of XRP.
|
||||
|
||||
One drop (.000001 XRP) cannot be further subdivided. Keep this in mind when calculating and displaying FX rates between XRP and other assets.
|
||||
|
||||
For more information, see [Specifying Currency Amounts][].
|
||||
|
||||
#### On-Ledger and Off-Ledger
|
||||
|
||||
With exchanges like _Alpha Exchange_, XRP can be "on-ledger" or "off-ledger":
|
||||
|
||||
* **On-Ledger XRP**: XRP that can be queried through the public XRP Ledger by specifying the public [address](addresses.html) of the XRP holder. The counterparty to these balances is the XRP Ledger. For more information, see [XRP](what-is-xrp.html).
|
||||
|
||||
* **Off-Ledger XRP**: XRP that is held by the accounting system of an exchange and can be queried through the exchange interface. Off-ledger XRP balances are credit-based. The counterparty is the exchange holding the XRP.
|
||||
|
||||
Off-ledger XRP balances are traded between the participants of an exchange. To support these trades, the exchange must hold a balance of _on-ledger XRP_ equal to the aggregate amount of _off-ledger XRP_ that it makes available for trade.
|
||||
|
||||
|
||||
## Flow of Funds
|
||||
|
||||
The remaining sections describe how funds flow through the accounts managed by Alpha Exchange as its users begin to deposit, trade, and redeem XRP balances. To illustrate the flow of funds, this document uses the tables introduced in the ["Balance Sheets" section](#balance-sheets).
|
||||
|
||||
There are four main steps involved in an exchange's typical flow of funds:
|
||||
|
||||
1. [Deposit XRP into Exchange](#deposit-xrp-into-exchange)
|
||||
|
||||
2. [Rebalance XRP Holdings](#rebalance-xrp-holdings)
|
||||
|
||||
3. [Withdraw XRP from Exchange](#withdraw-xrp-from-exchange)
|
||||
|
||||
4. [Trade XRP on the Exchange](#trade-xrp-on-the-exchange)
|
||||
|
||||
|
||||
This list does not include the [prerequisites](#prerequisites-for-supporting-xrp) required of an exchange.
|
||||
|
||||
At this point, _Alpha Exchange_ has created [hot, warm, and cold wallets](#accounts) on the XRP Ledger and added them to its balance sheet, but has not accepted any deposits from its users.
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><b><i>XRP Balances
|
||||
on XRP Ledger</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchange
|
||||
XRP Balances</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>User</b></td>
|
||||
<td><b>Balance</b></td>
|
||||
<td></td>
|
||||
<td><b>Account #</b></td>
|
||||
<td><b>User</b></td>
|
||||
<td><b>Balance</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dave</td>
|
||||
<td>25,000</td>
|
||||
<td></td>
|
||||
<td>123</td>
|
||||
<td>Alice</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Edward</td>
|
||||
<td>45,000</td>
|
||||
<td></td>
|
||||
<td>456</td>
|
||||
<td>Bob</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charlie</td>
|
||||
<td>50,000</td>
|
||||
<td></td>
|
||||
<td>789</td>
|
||||
<td>Charlie</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Hot</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Warm</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i>Alpha Cold</i></td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
### Deposit XRP into Exchange
|
||||
|
||||
To track [off-ledger XRP balances](#on-ledger-and-off-ledger), exchanges need to create new [balance sheets](#balance-sheets) (or similar accounting systems). The following table illustrates the balance changes that take place on Alpha Exchange's new balance sheet as users begin to deposit XRP.
|
||||
|
||||
A user named Charlie wants to deposit 50,000 XRP to Alpha Exchange. Doing this involves the following steps:
|
||||
|
||||
1. Charlie submits a payment of 50,000 XRP to Alpha Exchange's [cold wallet](#accounts).
|
||||
|
||||
a. Charlie adds an identifier (in this case, `789`) to the payment to associate it with his account at Alpha Exchange. This is called a [_destination tag_](source-and-destination-tags.html). (To use this, Alpha Exchange should have set the `asfRequireDest` flag on all of its accounts to require all incoming payments to have a destination tag like Charlie's. For more information, see [AccountSet Flags](accountset.html#accountset-flags)).
|
||||
|
||||
2. The software at Alpha Exchange detects the incoming payment, and recognizes `789` as the destination tag for Charlie’s account.
|
||||
|
||||
3. When it detects the incoming payment, Alpha Exchange's software updates its balance sheet to indicate that the 50,000 XRP it received is controlled by Charlie.
|
||||
|
||||
Charlie can now use up to 50,000 XRP on the exchange. For example, he can create offers to trade XRP with BTC or any of the other currencies Alpha Exchange supports.
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><b><i>XRP Balances
|
||||
on XRP Ledger</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchange
|
||||
XRP Balances</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>User</b></td>
|
||||
<td><b>Balance</b></td>
|
||||
<td></td>
|
||||
<td><b>Account #</b></td>
|
||||
<td><b>User</b></td>
|
||||
<td><b>Balance</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dave</td>
|
||||
<td>25,000</td>
|
||||
<td></td>
|
||||
<td>123</td>
|
||||
<td>Alice</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Edward</td>
|
||||
<td>45,000</td>
|
||||
<td></td>
|
||||
<td>456</td>
|
||||
<td>Bob</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charlie</td>
|
||||
<td><s>100,000</s>
|
||||
<br>50,000</td>
|
||||
<td></td>
|
||||
<td>789</td>
|
||||
<td>Charlie</td>
|
||||
<td><s>0</s>
|
||||
<br>50,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alpha Hot</td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alpha Warm</td>
|
||||
<td>0</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Alpha Cold</td>
|
||||
<td><s>0</s>
|
||||
<br>50,000</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
### Trade XRP on the Exchange
|
||||
|
||||
Alpha Exchange users (like Charlie) can trade credit-based balances on Alpha Exchange. Alpha Exchange should keep track of user balances on its new balance sheet as these trades are made. These trades are _off-ledger_ and independent from the XRP Ledger, so the balance changes are not recorded on the XRP Ledger.
|
||||
|
||||
Customers who hold XRP in their own XRP Ledger accounts can also use the distributed exchange built into the XRP Ledger to trade currencies issued by gateways. For more information about trading _on_ the XRP Ledger, see [Lifecycle of an Offer](offers.html#lifecycle-of-an-offer).
|
||||
|
||||
|
||||
### Rebalance XRP Holdings
|
||||
|
||||
Exchanges can adjust the balances between their hot and cold wallets at any time. Each balance adjustment consumes a [transaction cost](transaction-cost.html), but does not otherwise affect the aggregate balance of all the accounts. The aggregate, on-ledger balance should always exceed the total balance available for trade on the exchange. (The excess should be enough to cover the XRP Ledger's transaction costs.)
|
||||
|
||||
The following table demonstrates a balance adjustment of 80,000 XRP (via a [Payment transaction][] on the XRP Ledger) between Alpha Exchange's cold wallet and its hot wallet, where the cold wallet was debited and the hot wallet was credited. If the payment were reversed (debiting the hot wallet and crediting the cold wallet), the hot wallet balance would decrease. Balance adjustments like these allow an exchange to limit the risks associated with holding XRP in online hot wallets.
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><b><i>Alpha Exchange XRP
|
||||
Off-Ledger Balances</i></b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchange XRP On-Ledger Balances</i></b></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Account #</b></td>
|
||||
<td><b>User</b></td>
|
||||
<td><b>Balance</b></td>
|
||||
<td></td>
|
||||
<td><b>XRP Ledger Account</b></td>
|
||||
<td><b>Balance</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>123</td>
|
||||
<td>Alice</td>
|
||||
<td>80,000</td>
|
||||
<td></td>
|
||||
<td>Hot</td>
|
||||
<td><s>0</s>
|
||||
<br>80,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>456</td>
|
||||
<td>Bob</td>
|
||||
<td>50,000</td>
|
||||
<td></td>
|
||||
<td>Warm</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>….</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>….</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>789</td>
|
||||
<td>Charlie</td>
|
||||
<td>50,000</td>
|
||||
<td></td>
|
||||
<td>Cold</td>
|
||||
<td><s>180,000</s>
|
||||
<br>100,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
### Withdraw XRP from Exchange
|
||||
|
||||
Withdrawals allow an exchange's users to move XRP from the exchange's off-ledger balance sheet to an account on the XRP Ledger.
|
||||
|
||||
In this example, Charlie withdraws 25,000 XRP from Alpha Exchange. This involves the following steps:
|
||||
|
||||
1. Charlie initiates the process on Alpha Exchange’s website. He provides instructions to transfer 25,000 XRP to a specific account on the XRP Ledger (named "Charlie XRP Ledger" in the following table).
|
||||
|
||||
2. In response to Charlie’s instructions, Alpha Exchange does the following:
|
||||
|
||||
a. Debits the amount (25,000 XRP) from Charlie’s account on its off-ledger balance sheet
|
||||
|
||||
b. Submits a payment on the XRP Ledger for the same amount (25,000 XRP), from Alpha Exchange's hot wallet to Charlie’s XRP Ledger account
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><b><i>XRP Ledger On-Ledger XRP Balances</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchange XRP
|
||||
Off-Ledger Balances</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b><i>Alpha Exchange XRP On-Ledger Balances</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>User</td>
|
||||
<td><b>Balance</td>
|
||||
<td></td>
|
||||
<td><b>Account #</td>
|
||||
<td><b>User</td>
|
||||
<td><b>Balance</td>
|
||||
<td></td>
|
||||
<td><b>XRP Ledger Account</td>
|
||||
<td><b>Balance</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dave</td>
|
||||
<td>25,000</td>
|
||||
<td></td>
|
||||
<td>123</td>
|
||||
<td>Alice</td>
|
||||
<td>80,000</td>
|
||||
<td></td>
|
||||
<td>Hot</td>
|
||||
<td><s>80,000</s>
|
||||
<br>55,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Edward</td>
|
||||
<td>45,000</td>
|
||||
<td></td>
|
||||
<td>456</td>
|
||||
<td>Bob</td>
|
||||
<td>50,000</td>
|
||||
<td></td>
|
||||
<td>Warm</td>
|
||||
<td>0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>….</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>….</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>….</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charlie XRP Ledger</td>
|
||||
<td><s>50,000</s>
|
||||
<br>75,000</td>
|
||||
<td></td>
|
||||
<td>789</td>
|
||||
<td>Charlie</td>
|
||||
<td><s>50,000</s>
|
||||
<br>25,000</td>
|
||||
<td></td>
|
||||
<td>Cold</td>
|
||||
<td>100,000</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>...</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## See Also
|
||||
|
||||
- **Concepts:**
|
||||
- [Accounts](accounts.html)
|
||||
- [Direct XRP Payments](direct-xrp-payments.html)
|
||||
- [Partial Payments](partial-payments.html)
|
||||
- [Source and Destination Tags](source-and-destination-tags.html)
|
||||
- **Tutorials:**
|
||||
- [Install `rippled`](install-rippled.html)
|
||||
- [Send XRP](send-xrp.html)
|
||||
- [Set Up Secure Signing](secure-signing.html)
|
||||
- [Monitor Incoming Payments with WebSocket](monitor-incoming-payments-with-websocket.html)
|
||||
- **References:**
|
||||
- [Payment transaction][]
|
||||
- [account_info method][]
|
||||
- [AccountRoot object](accountroot.html)
|
||||
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
Reference in New Issue
Block a user