mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 11:45:50 +00:00
Direct XRP Payments & restructuring
- Rename 'complex payment types' to 'specialized payment types' - Move source/destination tag content to stand-alone pages
This commit is contained in:
@@ -1,40 +0,0 @@
|
|||||||
# Payments
|
|
||||||
|
|
||||||
The basis of any financial system is _transferring value_: or, in one word, payments. The XRP Ledger supports a variety of ways to make payments, with different types specialized for various use cases. The most basic type of payment in the XRP Ledger is a direct XRP-to-XRP payment.
|
|
||||||
|
|
||||||
## About Direct XRP-to-XRP Payments
|
|
||||||
|
|
||||||
Generally, any address in the XRP Ledger can send XRP directly to any other address. The address on the receiving side is often called the _destination address_, and the address on the sending side is called the _source address_. To send XRP directly, the sender uses a [Payment transaction][], which can be as concise as the following:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"TransactionType": "Payment",
|
|
||||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
|
||||||
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
|
||||||
"Amount": "13000000"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
These transaction instructions mean: Send a payment from rf1Bi... to ra5nK... delivering exactly 13 XRP. If the transaction is successfully processed, it does exactly that. Since it usually takes about 4 seconds for each new ledger version to become [validated](consensus.html), a successful transaction can be created, submitted, executed, and have a completely final outcome in 8 seconds or less, even if gets queued for the ledger version after the current in-progress one.
|
|
||||||
|
|
||||||
**Caution:** The [Payment transaction type][Payment] can also be used for some more specialized kinds of payments, including [cross-currency payments](cross-currency-payments.html) and [partial payments](partial-payments.html). In the case of partial payments, it is possible that the `Amount` shows a large amount of XRP even if the transaction only delivered a very small amount. See [partial payments exploit](partial-payments.html#partial-payments-exploit) for how to avoid crediting a customer for the wrong amount.
|
|
||||||
|
|
||||||
## Funding Accounts
|
|
||||||
|
|
||||||
Any mathematically-valid address can receive a payment, even if the XRP Ledger has no record of that address existing beforehand, as long as the payment delivers enough XRP to meet the minimum [account reserve](reserves.html). If the payment would not deliver enough XRP, it fails.
|
|
||||||
|
|
||||||
For more information, see [Accounts](accounts.html#creating-accounts).
|
|
||||||
|
|
||||||
## Blocking Incoming Payments
|
|
||||||
|
|
||||||
By default, any address can send XRP to any other address. This works well for many smart contracts and for making most transactions as smooth as possible. However, you may not want to be able to receive from unknown senders because of regulatory requirements. For example, you or your business might be required to prove that you do not receive money from economically-sanctioned countries, terrorists, or known criminals. In this case, you can enable the [DepositAuth setting](depositauth.html) to block incoming payments unless you approve the sender or individual payment before receiving funds (XRP or otherwise). For more information, see [DepositAuth](depositauth.html).
|
|
||||||
|
|
||||||
The [`DisallowXRP` setting](accountset.html#blocking-incoming-transactions) is a related, softer limitation which is not natively enforced in the XRP Ledger. (Doing so strictly could cause an account to become "locked" if it ran out of XRP to pay for [transaction costs](transaction-cost.html).) Instead, client applications should enforce this setting (unless explicitly overridden with user intervention) to reduce cases of accidentally sending XRP to an address that primarily deals in [issued currencies](issued-currencies.html).
|
|
||||||
|
|
||||||
## Source and Destination Tags
|
|
||||||
|
|
||||||
***TODO: split off from gateway guide***
|
|
||||||
|
|
||||||
## See Also
|
|
||||||
|
|
||||||
***TODO***
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
# Source and Destination Tags
|
||||||
|
|
||||||
|
_Source tags_ and _destination tags_ are a feature of XRP Ledger [payments](payment-types.html) that can indicate specific purposes for payments from and to multi-purpose addresses. Source and destination tags do not have direct on-ledger functionality; source and destination tags merely provide information about how off-ledger systems should process a payment. In transactions, both source and destination tags are formatted as 32-bit unsigned integers.
|
||||||
|
|
||||||
|
Destination tags indicate the beneficiary or destination for a payment. For example, a payment to an [exchange](list-xrp-in-your-exchange.html) or [gateway](become-an-xrp-ledger-gateway.html) address can use a destination tag to indicate which customer to credit for the amount of the payment in that business's own systems.
|
||||||
|
|
||||||
|
Source tags indicate the originator or source of a payment. Most commonly, a Source Tag is included so that the recipient of the payment knows where to send a return, or "bounced", payment. When returning an incoming payment, you should use the source tag from the incoming payment as the destination tag of the outgoing (return) payment.
|
||||||
|
|
||||||
|
The practice of giving customers the ability to send and receive transactions from your XRP Ledger address using another interface is called providing _hosted accounts_. Hosted accounts typically use source and destination tags for each customer.
|
||||||
|
|
||||||
|
## Rationale
|
||||||
|
|
||||||
|
In other distributed ledgers, it is common to use different deposit addresses for each customer. In the XRP Ledger, an address must be a funded, permanent [account](accounts.html) to receive payments. Using this approach in the XRP Ledger wastefully consumes resources of all servers in the network, and is costly because the [reserve](reserves.html) amount must be set aside indefinitely for each address.
|
||||||
|
|
||||||
|
Source and destination tags provide a more lightweight way to map deposits and payments to individual customers.
|
||||||
|
|
||||||
|
## Use Cases
|
||||||
|
|
||||||
|
A business may want to use source and destination tags for several purposes:
|
||||||
|
|
||||||
|
- Direct mappings to customer accounts.
|
||||||
|
- Matching return payments to the outgoing payments that prompted them.
|
||||||
|
- Mapping payments to quotes that expire.
|
||||||
|
- Providing disposable tags that customers can generate for specific deposits.
|
||||||
|
|
||||||
|
To prevent overlap while protecting privacy, a business can divide the total range of tags available into sections for each purpose, then assign tags in an unpredictable order within the range. For example, use a hash function or a cipher such as [Hasty Pudding](http://en.wikipedia.org/wiki/Hasty_Pudding_cipher). To be safe, check for collisions with old tags before using a new tag.
|
||||||
|
|
||||||
|
Assigning tags in numerical order provides less privacy to customers. Since all XRP Ledger transactions are public, assigning tags in this way can make it possible to guess which tags correspond to various users' addresses or to derive information about users' accounts based on the tags used.
|
||||||
|
|
||||||
|
|
||||||
|
## Requiring Tags
|
||||||
|
|
||||||
|
For an XRP Ledger address that may receive payments intended for several customer accounts, receiving a payment _without_ a destination tag can be a problem: it is not immediately obvious which customer to credit, which can require a manual intervention and a discussion with the sender to figure out who was the intended recipient. To reduce cases like this, you can [enable the RequireDest setting](require-destination-tags.html). That way, if a user forgets to include a destination tag in a payment, the XRP Ledger rejects their payment instead of giving you money you don't know what to do with. The user can then send the payment again, using the tag as they should have.
|
||||||
|
|
||||||
|
|
||||||
|
## See Also
|
||||||
|
|
||||||
|
- [Require Destination Tags](require-destination-tags.html)
|
||||||
|
- [XRP Ledger Businesses](xrp-ledger-businesses.html)
|
||||||
|
- [Payment Types](payment-types.html)
|
||||||
|
|
||||||
|
|
||||||
|
<!--{# common link defs #}-->
|
||||||
|
{% include '_snippets/rippled-api-links.md' %}
|
||||||
|
{% include '_snippets/tx-type-links.md' %}
|
||||||
|
{% include '_snippets/rippled_versions.md' %}
|
||||||
76
content/concepts/payment-types/direct-xrp-payments.md
Normal file
76
content/concepts/payment-types/direct-xrp-payments.md
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
# Direct XRP Payments
|
||||||
|
|
||||||
|
The basis of any financial system is _transferring value_: or, in one word, payments. The simplest type of payment in the XRP Ledger is a direct XRP-to-XRP payment, which transfers XRP directly from one account in the XRP Ledger to another.
|
||||||
|
|
||||||
|
## About Direct XRP-to-XRP Payments
|
||||||
|
|
||||||
|
Generally, any address in the XRP Ledger can send XRP directly to any other address. The address on the receiving side is often called the _destination address_, and the address on the sending side is called the _source address_. To send XRP directly, the sender uses a [Payment transaction][], which can be as concise as the following:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"TransactionType": "Payment",
|
||||||
|
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||||
|
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX",
|
||||||
|
"Amount": "13000000"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
These transaction instructions mean: Send a payment from rf1Bi... to ra5nK... delivering exactly 13 XRP. If the transaction is successfully processed, it does exactly that. Since it usually takes about 4 seconds for each new ledger version to become [validated](consensus.html), a successful transaction can be created, submitted, executed, and have a completely final outcome in 8 seconds or less, even if gets queued for the ledger version after the current in-progress one.
|
||||||
|
|
||||||
|
**Caution:** The [Payment transaction type][Payment] can also be used for some more specialized kinds of payments, including [cross-currency payments](cross-currency-payments.html) and [partial payments](partial-payments.html). In the case of partial payments, it is possible that the `Amount` shows a large amount of XRP even if the transaction only delivered a very small amount. See [partial payments exploit](partial-payments.html#partial-payments-exploit) for how to avoid crediting a customer for the wrong amount.
|
||||||
|
|
||||||
|
Direct XRP-to-XRP payments cannot be partial payments, but partial payments can deliver XRP after converting from a different source currency.
|
||||||
|
|
||||||
|
## Funding Accounts
|
||||||
|
|
||||||
|
Any mathematically-valid address can receive a payment, even if the XRP Ledger has no record of that address existing beforehand, as long as the payment delivers enough XRP to meet the minimum [account reserve](reserves.html). If the payment would not deliver enough XRP, it fails.
|
||||||
|
|
||||||
|
For more information, see [Accounts](accounts.html#creating-accounts).
|
||||||
|
|
||||||
|
## How Direct XRP Payments Are Processed
|
||||||
|
|
||||||
|
From a relatively high level, the XRP Ledger's transaction processing engine applies a direct XRP payment as follows:
|
||||||
|
|
||||||
|
1. It validates the parameters of the [Payment transaction][]. If the transaction is structured to send and deliver XRP, the transaction processing engine recognizes it as a direct XRP-to-XRP payment. Validation checks include:
|
||||||
|
|
||||||
|
- Checking that all fields are formatted correctly.
|
||||||
|
- Checking that the sending address is a funded [account](accounts.html) in the XRP Ledger.
|
||||||
|
- Checking that all provided signatures are valid for the sending address.
|
||||||
|
- Confirming that the destination is different than the sender.
|
||||||
|
- Confirming that the sender has a high enough XRP balance to send the payment.
|
||||||
|
|
||||||
|
If any check fails, the payment fails.
|
||||||
|
|
||||||
|
2. It checks whether the receiving address is a funded account.
|
||||||
|
|
||||||
|
- If the receiving address is funded, it checks whether the receiving address has any limitations on receiving payments, such as [DepositAuth](depositauth.html) or [RequireDest](source-and-destination-tags.html#requiring-tags). If the payment does not meet any such limitations, the payment fails.
|
||||||
|
- If the receiving address is not funded, it checks whether the payment would deliver enough XRP to meet the minimum [account reserve](reserves.html). If not, the payment fails.
|
||||||
|
|
||||||
|
3. It debits the sending account by an amount of XRP specified by the `Amount` field plus the XRP to be destroyed for the [transaction cost](transaction-cost.html) and credits the receiving account for the same amount.
|
||||||
|
|
||||||
|
If necessary, it creates a new account ([AccountRoot object](accountroot.html)) for the receiving address. The new account's starting balance is equal to the `Amount` of the payment.
|
||||||
|
|
||||||
|
The engine adds a `delivered_amount` field to the [transaction's metadata](transaction-metadata.html) to indicate how much was delivered. You should always use `delivered_amount`, **not** the `Amount` field, to avoid being tricked about how much XRP you received. (Cross-currency "Partial Payments" can deliver less XRP than stated in the `Amount` field.) For more information, see [Partial Payments](partial-payment.html#partial-payments-exploit).
|
||||||
|
|
||||||
|
|
||||||
|
## Comparison to Other Payment Types
|
||||||
|
|
||||||
|
- **Direct XRP Payments** are the only way to both send and receive XRP in a single transaction. They are a good balance of speed, simplicity, and low cost.
|
||||||
|
- [Cross-currency payments](cross-currency-payments.html) also use the [Payment][] transaction type, but can send any combination of XRP and non-XRP [issued currencies](issued-currencies.html) except XRP-to-XRP. They can also be [partial payments](partial-payments.html). Cross-currency payments are good for payments not denominated in XRP or for taking arbitrage opportunities in the [decentralized exchange](decentralized-exchange.html).
|
||||||
|
- [Checks](checks.html) :not_enabled: let the sender set up an obligation without transferring any money immediately. The recipient can cash it any time before it expires, but the amount is not guaranteed. Checks can send either XRP or issued currencies. Checks are good for giving the recipient the autonomy to claim the payment.
|
||||||
|
- [Escrow](escrow.html) sets aside XRP which can be claimed by its intended recipient when certain conditions are met. The XRP amount is fully guaranteed and cannot be otherwise used by the sender unless the Escrow expires. Escrow is good for smart contracts in large amounts.
|
||||||
|
- [Payment Channels](payment-channels.html) set aside XRP. The recipient can claim XRP from the channel in bulk using signed authorizations. Individual authorizations can be verified without sending a full XRP Ledger transaction. Payment channels are good for extremely high-volume micropayments or "streaming" payments.
|
||||||
|
|
||||||
|
|
||||||
|
## See Also
|
||||||
|
|
||||||
|
- [Payment System Basics](payment-system-basics.html)
|
||||||
|
- [Payment transaction type][Payment transaction]
|
||||||
|
- [Transaction Results](transaction-results.html)
|
||||||
|
- [Send XRP (Interactive Tutorial)](send-xrp.html)
|
||||||
|
|
||||||
|
|
||||||
|
<!--{# common link defs #}-->
|
||||||
|
{% include '_snippets/rippled-api-links.md' %}
|
||||||
|
{% include '_snippets/tx-type-links.md' %}
|
||||||
|
{% include '_snippets/rippled_versions.md' %}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
# Require Destination Tags
|
||||||
|
|
||||||
|
The `RequireDest` setting (`requireDestinationTag` in RippleAPI) is designed to prevent customers from sending payments to your address if they forgot the [destination tag](source-and-destination-tags.html) that identifies who should be credited for the payment. When enabled, the XRP Ledger rejects any payment to your address that does not specify a destination tag.
|
||||||
|
|
||||||
|
The following is an example of using a locally-hosted `rippled`'s [submit method][] to send an AccountSet transaction to enable the `RequireDest` flag:
|
||||||
|
|
||||||
|
Request:
|
||||||
|
|
||||||
|
```
|
||||||
|
POST http://localhost:5005/
|
||||||
|
Content-Type: application/json
|
||||||
|
{
|
||||||
|
"method": "submit",
|
||||||
|
"params": [
|
||||||
|
{
|
||||||
|
"secret": "sn3nxiW7v8KXzPzAqzyHXbSSKNuN9",
|
||||||
|
"tx_json": {
|
||||||
|
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||||
|
"Fee": "15000",
|
||||||
|
"Flags": 0,
|
||||||
|
"SetFlag": 1,
|
||||||
|
"TransactionType": "AccountSet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
{% include '_snippets/secret-key-warning.md' %}
|
||||||
|
<!--{#_ #}-->
|
||||||
|
|
||||||
|
Response:
|
||||||
|
|
||||||
|
```
|
||||||
|
200 OK
|
||||||
|
{
|
||||||
|
"result": {
|
||||||
|
"engine_result": "tesSUCCESS",
|
||||||
|
"engine_result_code": 0,
|
||||||
|
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
||||||
|
"status": "success",
|
||||||
|
"tx_blob": "12000322000000002400000161202100000003684000000000003A98732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100CD9A87890ADFAC49B8F69EDEC4A0DB99C86667883D7579289B06DAA4B81BF87E02207AC3FEEA518060AB2B538D330614D2594F432901F7C011D7EB92F74383E5340F81144B4E9C06F24296074F7BC48F92A97916C6DC5EA9",
|
||||||
|
"tx_json": {
|
||||||
|
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
||||||
|
"Fee": "15000",
|
||||||
|
"Flags": 0,
|
||||||
|
"Sequence": 353,
|
||||||
|
"SetFlag": 3,
|
||||||
|
"SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
|
||||||
|
"TransactionType": "AccountSet",
|
||||||
|
"TxnSignature": "3045022100CD9A87890ADFAC49B8F69EDEC4A0DB99C86667883D7579289B06DAA4B81BF87E02207AC3FEEA518060AB2B538D330614D2594F432901F7C011D7EB92F74383E5340F",
|
||||||
|
"hash": "59025DD6C9848679BA433448A1DD95833F2F4B64B03E214D074C7A5B6E3E3E70"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## See Also
|
||||||
|
|
||||||
|
- [Source and Destination Tags](source-and-destination-tags.html)
|
||||||
|
- [XRP Ledger Businesses](xrp-ledger-businesses.html)
|
||||||
|
- [Payment Types](payment-types.html)
|
||||||
|
|
||||||
|
|
||||||
|
<!--{# common link defs #}-->
|
||||||
|
{% include '_snippets/rippled-api-links.md' %}
|
||||||
|
{% include '_snippets/tx-type-links.md' %}
|
||||||
|
{% include '_snippets/rippled_versions.md' %}
|
||||||
@@ -287,11 +287,10 @@ Processing payments to and from the XRP Ledger naturally comes with some risks,
|
|||||||
- Track your obligations and balances within the XRP Ledger, and compare with the assets in your collateral account. If they do not match up, stop processing withdrawals and deposits until you resolve the discrepancy.
|
- Track your obligations and balances within the XRP Ledger, and compare with the assets in your collateral account. If they do not match up, stop processing withdrawals and deposits until you resolve the discrepancy.
|
||||||
- Avoid ambiguous situations. We recommend the following:
|
- Avoid ambiguous situations. We recommend the following:
|
||||||
- Enable the [`DisallowXRP` flag](#disallowxrp) for the issuing address and all operational addresses, so customers do not accidentally send you XRP. (Private exchanges should *not* set this flag, since they trade XRP normally.)
|
- Enable the [`DisallowXRP` flag](#disallowxrp) for the issuing address and all operational addresses, so customers do not accidentally send you XRP. (Private exchanges should *not* set this flag, since they trade XRP normally.)
|
||||||
- Enable the [`RequireDest` flag](#requiredest) for the issuing address and all operational addresses, so customers do not accidentally send a payment without the destination tag to indicate who should be credited.
|
- Enable the [`RequireDest` flag](require-destination-tags.html) for the issuing address and all operational addresses, so customers do not accidentally send a payment without the destination tag to indicate who should be credited.
|
||||||
- Enable the [`RequireAuth` flag](#requireauth) on all operational addresses so they cannot issue currency by accident.
|
- Enable the [`RequireAuth` flag](#requireauth) on all operational addresses so they cannot issue currency by accident.
|
||||||
- Monitor for suspicious or abusive behavior. For example, a user could repeatedly send funds into and out of the XRP Ledger, as a denial of service attack that effectively empties an operational address's balance. Suspend customers whose addresses are involved in suspicious behavior by not processing their XRP Ledger payments.
|
- Monitor for suspicious or abusive behavior. For example, a user could repeatedly send funds into and out of the XRP Ledger, as a denial of service attack that effectively empties an operational address's balance. Suspend customers whose addresses are involved in suspicious behavior by not processing their XRP Ledger payments.
|
||||||
|
|
||||||
|
|
||||||
## Trading on Ripple
|
## Trading on Ripple
|
||||||
|
|
||||||
After the issuances have been created in the XRP Ledger, they can be freely transferred and traded by XRP Ledger users. There are several consequences of this situation:
|
After the issuances have been created in the XRP Ledger, they can be freely transferred and traded by XRP Ledger users. There are several consequences of this situation:
|
||||||
@@ -322,7 +321,7 @@ For more information, see the [Freeze article](freezes.html).
|
|||||||
|
|
||||||
## Authorized Trust Lines
|
## Authorized Trust Lines
|
||||||
|
|
||||||
The XRP Ledger's Authorized Trust Lines feature (formerly called "Authorized Accounts") enables a gateway to limit who can hold that gateway's issuances, so that unknown XRP Ledger addresses cannot hold the currency the gateway issues. Ripple feels this is *not necessary* in most cases, since gateways have full control over the process of redeeming Ripple balances for value in the outside world. (You can collect customer information and impose limits on withdrawals at that stage without worrying about what happens within the XRP Ledger.)
|
The XRP Ledger's Authorized Trust Lines feature (formerly called "Authorized Accounts") enables a gateway to limit who can hold that gateway's issuances, so that unknown XRP Ledger addresses cannot hold the currency the gateway issues. Ripple feels this is *not necessary* in most cases, since gateways have full control over the process of redeeming XRP Ledger balances for value in the outside world. (You can collect customer information and impose limits on withdrawals at that stage without worrying about what happens within the XRP Ledger.)
|
||||||
|
|
||||||
For more information, see [Authorized Trust Lines](authorized-trust-lines.html).
|
For more information, see [Authorized Trust Lines](authorized-trust-lines.html).
|
||||||
|
|
||||||
@@ -333,14 +332,11 @@ For more information, see [Authorized Trust Lines](authorized-trust-lines.html).
|
|||||||
|
|
||||||
Similarly, *Source Tags* indicate the originator or source of a payment. Most commonly, a Source Tag is included so that the recipient of the payment knows where to bounce the payment. When you bounce an incoming payment, use the Source Tag from the incoming payment as the Destination Tag of the outgoing (bounce) payment.
|
Similarly, *Source Tags* indicate the originator or source of a payment. Most commonly, a Source Tag is included so that the recipient of the payment knows where to bounce the payment. When you bounce an incoming payment, use the Source Tag from the incoming payment as the Destination Tag of the outgoing (bounce) payment.
|
||||||
|
|
||||||
We recommend providing several kinds of Destination Tags for different purposes:
|
Ripple recommends making a user interface to generate a destination tag on-demand when a customer intends to send money to the gateway. You should consider that destination tag valid only for a payment with the expected amount. Later, bounce any other transactions that reuse the same destination tag.
|
||||||
|
|
||||||
* Direct mappings to customer accounts
|
Enable the [RequireDest](require-destination-tags.html) flag on your issuing and operational addresses so that customers must use a destination tag to indicate where funds should go when they send XRP Ledger payments to your gateway.
|
||||||
* Matching the Source Tags on outgoing payments (in case your payments get bounced)
|
|
||||||
* Tags for quotes, which expire
|
|
||||||
* Other disposable destination tags that customers can generate.
|
|
||||||
|
|
||||||
See [Generating Source and Destination Tags](#generating-source-and-destination-tags) for recommendations on the technical details of making and using Source Tags and Destination Tags.
|
For more information, see [Source and Destination Tags](source-and-destination-tags.html).
|
||||||
|
|
||||||
|
|
||||||
## Gateway Bulletins
|
## Gateway Bulletins
|
||||||
@@ -446,18 +442,6 @@ Response:
|
|||||||
To confirm that an address has DefaultRipple enabled, look up the address using the [account_info method][], specifying a validated ledger version. Use [a bitwise-AND operator](https://en.wikipedia.org/wiki/Bitwise_operation#AND) to compare the `Flags` field with 0x00800000 (the [ledger flag lsfDefaultRipple](accountroot.html#accountroot-flags)). If the result of the bitwise-AND operation is nonzero, then the address has DefaultRipple enabled.
|
To confirm that an address has DefaultRipple enabled, look up the address using the [account_info method][], specifying a validated ledger version. Use [a bitwise-AND operator](https://en.wikipedia.org/wiki/Bitwise_operation#AND) to compare the `Flags` field with 0x00800000 (the [ledger flag lsfDefaultRipple](accountroot.html#accountroot-flags)). If the result of the bitwise-AND operation is nonzero, then the address has DefaultRipple enabled.
|
||||||
|
|
||||||
|
|
||||||
## Generating Source and Destination Tags
|
|
||||||
|
|
||||||
You need a scheme to create Source and Destination tags for your customers and payments. (See [Source and Destination Tags](#source-and-destination-tags) for an explanation of what Source and Destination Tags are.)
|
|
||||||
|
|
||||||
For greater privacy and security, we recommend *not* using monotonically-incrementing numbers as destination tags that correlate 1:1 with customers. Instead, we recommend using convenient internal IDs, but mapping those to destination tags using a quick hash or cipher function such as [Hasty Pudding](http://en.wikipedia.org/wiki/Hasty_Pudding_cipher). You should set aside ranges of internal numbers for different uses of destination tags.
|
|
||||||
|
|
||||||
After passing the internal numbers through your hash function, you can use the result as a destination tag. To be safe, you should check for collisions. Do not reuse destination tags unless they have explicit expiration dates (like quotes and customer-generated tags).
|
|
||||||
|
|
||||||
We recommend making a user interface to generate a destination tag on-demand when a customer intends to send money to the gateway. Then, consider that destination tag valid only for a payment with the expected amount. Later, bounce any other transactions that reuse the same destination tag.
|
|
||||||
|
|
||||||
Enable the [RequireDest](#requiredest) flag on your issuing and operational addresses so that customers must use a destination tag to indicate where funds should go when they send XRP Ledger payments to your gateway.
|
|
||||||
|
|
||||||
|
|
||||||
## DisallowXRP
|
## DisallowXRP
|
||||||
|
|
||||||
@@ -517,65 +501,6 @@ Response:
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## RequireDest
|
|
||||||
|
|
||||||
The `RequireDest` setting (`requireDestinationTag` in RippleAPI) is designed to prevent customers from sending payments to your address while accidentally forgetting the [destination tag](#source-and-destination-tags) that identifies who should be credited for the payment. When enabled, the XRP Ledger rejects any payment to your address that does not specify a destination tag.
|
|
||||||
|
|
||||||
We recommend enabling the `RequireDest` flag on all gateway issuing and operational addresses.
|
|
||||||
|
|
||||||
The following is an example of using a locally-hosted `rippled`'s [submit method][] to send an AccountSet transaction to enable the `RequireDest` flag:
|
|
||||||
|
|
||||||
Request:
|
|
||||||
|
|
||||||
```
|
|
||||||
POST http://localhost:5005/
|
|
||||||
Content-Type: application/json
|
|
||||||
{
|
|
||||||
"method": "submit",
|
|
||||||
"params": [
|
|
||||||
{
|
|
||||||
"secret": "sn3nxiW7v8KXzPzAqzyHXbSSKNuN9",
|
|
||||||
"tx_json": {
|
|
||||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
|
||||||
"Fee": "15000",
|
|
||||||
"Flags": 0,
|
|
||||||
"SetFlag": 1,
|
|
||||||
"TransactionType": "AccountSet"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
{% include '_snippets/secret-key-warning.md' %}
|
|
||||||
<!--{#_ #}-->
|
|
||||||
|
|
||||||
Response:
|
|
||||||
|
|
||||||
```
|
|
||||||
200 OK
|
|
||||||
{
|
|
||||||
"result": {
|
|
||||||
"engine_result": "tesSUCCESS",
|
|
||||||
"engine_result_code": 0,
|
|
||||||
"engine_result_message": "The transaction was applied. Only final in a validated ledger.",
|
|
||||||
"status": "success",
|
|
||||||
"tx_blob": "12000322000000002400000161202100000003684000000000003A98732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100CD9A87890ADFAC49B8F69EDEC4A0DB99C86667883D7579289B06DAA4B81BF87E02207AC3FEEA518060AB2B538D330614D2594F432901F7C011D7EB92F74383E5340F81144B4E9C06F24296074F7BC48F92A97916C6DC5EA9",
|
|
||||||
"tx_json": {
|
|
||||||
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
|
|
||||||
"Fee": "15000",
|
|
||||||
"Flags": 0,
|
|
||||||
"Sequence": 353,
|
|
||||||
"SetFlag": 3,
|
|
||||||
"SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB",
|
|
||||||
"TransactionType": "AccountSet",
|
|
||||||
"TxnSignature": "3045022100CD9A87890ADFAC49B8F69EDEC4A0DB99C86667883D7579289B06DAA4B81BF87E02207AC3FEEA518060AB2B538D330614D2594F432901F7C011D7EB92F74383E5340F",
|
|
||||||
"hash": "59025DD6C9848679BA433448A1DD95833F2F4B64B03E214D074C7A5B6E3E3E70"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## RequireAuth
|
## RequireAuth
|
||||||
|
|
||||||
The `RequireAuth` setting prevents all counterparties from holding balances issued by an address unless the address has specifically approved an accounting relationship with that counterparty. For more information, see [Authorized Trust Lines](authorized-trust-lines.html).
|
The `RequireAuth` setting prevents all counterparties from holding balances issued by an address unless the address has specifically approved an accounting relationship with that counterparty. For more information, see [Authorized Trust Lines](authorized-trust-lines.html).
|
||||||
|
|||||||
@@ -249,60 +249,88 @@ pages:
|
|||||||
targets:
|
targets:
|
||||||
- local
|
- local
|
||||||
|
|
||||||
# TODO: "Source and Destination Tags" stand-alone document
|
- md: concepts/payment-system-basics/transaction-basics/source-and-destination-tags.md
|
||||||
|
html: source-and-destination-tags.html
|
||||||
|
funnel: Docs
|
||||||
|
doc_type: Concepts
|
||||||
|
category: Payment System Basics
|
||||||
|
subcategory: Transaction Basics
|
||||||
|
blurb: Use source and destination tags to indicate specific purposes for payments from and to multi-purpose addresses
|
||||||
|
targets:
|
||||||
|
- local
|
||||||
|
|
||||||
|
- name: Payment Types
|
||||||
|
html: payment-types.html
|
||||||
|
funnel: Docs
|
||||||
|
doc_type: Concepts
|
||||||
|
category: Payment Types
|
||||||
|
template: template-landing-children.html
|
||||||
|
blurb: The XRP Ledger supports point-to-point XRP payments alongside other, more specialized payment types.
|
||||||
|
targets:
|
||||||
|
- local
|
||||||
|
|
||||||
|
# Redirect from the old landing name/URL
|
||||||
- name: Complex Payment Types
|
- name: Complex Payment Types
|
||||||
html: complex-payment-types.html
|
html: complex-payment-types.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Concepts
|
doc_type: Concepts
|
||||||
category: Complex Payment Types
|
category: Payment Types
|
||||||
template: template-landing-children.html
|
template: template-redirect.html
|
||||||
blurb: In addition to simple point-to-point XRP Payments, the XRP Ledger supports a number of complex payment types for a variety of use cases and situations.
|
redirect_url: payment-types.html
|
||||||
targets:
|
targets:
|
||||||
- local
|
- local
|
||||||
|
|
||||||
- md: concepts/complex-payment-types/cross-currency-payments.md
|
- md: concepts/payment-types/direct-xrp-payments.md
|
||||||
|
html: direct-xrp-payments.html
|
||||||
|
funnel: Docs
|
||||||
|
doc_type: Concepts
|
||||||
|
category: Payment Types
|
||||||
|
blurb: Direct XRP payments are the simplest way to send value in the XRP Ledger.
|
||||||
|
targets:
|
||||||
|
- local
|
||||||
|
|
||||||
|
- md: concepts/payment-types/cross-currency-payments.md
|
||||||
html: cross-currency-payments.html
|
html: cross-currency-payments.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Concepts
|
doc_type: Concepts
|
||||||
category: Complex Payment Types
|
category: Payment Types
|
||||||
blurb: Cross-currency payments atomically deliver a different currency than they send by converting through paths and order books.
|
blurb: Cross-currency payments atomically deliver a different currency than they send by converting through paths and order books.
|
||||||
targets:
|
targets:
|
||||||
- local
|
- local
|
||||||
|
|
||||||
- md: concepts/complex-payment-types/checks.md
|
- md: concepts/payment-types/checks.md
|
||||||
html: checks.html
|
html: checks.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Concepts
|
doc_type: Concepts
|
||||||
category: Complex Payment Types
|
category: Payment Types
|
||||||
blurb: Checks let users create deferred payments that can be canceled or cashed by the intended recipients.
|
blurb: Checks let users create deferred payments that can be canceled or cashed by the intended recipients.
|
||||||
status: not_enabled
|
status: not_enabled
|
||||||
targets:
|
targets:
|
||||||
- local
|
- local
|
||||||
|
|
||||||
- md: concepts/complex-payment-types/escrow.md
|
- md: concepts/payment-types/escrow.md
|
||||||
html: escrow.html
|
html: escrow.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Concepts
|
doc_type: Concepts
|
||||||
category: Complex Payment Types
|
category: Payment Types
|
||||||
blurb: Escrows set aside XRP and deliver it later when certain conditions are met. Escrows can depend on time limits, cryptographic conditions, or both.
|
blurb: Escrows set aside XRP and deliver it later when certain conditions are met. Escrows can depend on time limits, cryptographic conditions, or both.
|
||||||
targets:
|
targets:
|
||||||
- local
|
- local
|
||||||
|
|
||||||
- md: concepts/complex-payment-types/partial-payments.md
|
- md: concepts/payment-types/partial-payments.md
|
||||||
html: partial-payments.html
|
html: partial-payments.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Concepts
|
doc_type: Concepts
|
||||||
category: Complex Payment Types
|
category: Payment Types
|
||||||
blurb: Partial payments subtract fees from the amount sent, delivering a flexible amount. Partial payments are useful for returning unwanted payments without incurring additional costs.
|
blurb: Partial payments subtract fees from the amount sent, delivering a flexible amount. Partial payments are useful for returning unwanted payments without incurring additional costs.
|
||||||
targets:
|
targets:
|
||||||
- local
|
- local
|
||||||
|
|
||||||
- md: concepts/complex-payment-types/payment-channels.md
|
- md: concepts/payment-types/payment-channels.md
|
||||||
html: payment-channels.html
|
html: payment-channels.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Concepts
|
doc_type: Concepts
|
||||||
category: Complex Payment Types
|
category: Payment Types
|
||||||
blurb: Payment Channels enable fast, asynchronous XRP payments that can be divided into very small increments and settled later.
|
blurb: Payment Channels enable fast, asynchronous XRP payments that can be divided into very small increments and settled later.
|
||||||
targets:
|
targets:
|
||||||
- local
|
- local
|
||||||
@@ -775,15 +803,35 @@ pages:
|
|||||||
targets:
|
targets:
|
||||||
- local
|
- local
|
||||||
|
|
||||||
|
- md: tutorials/manage-account-settings/require-destination-tags.md
|
||||||
|
html: require-destination-tags.html
|
||||||
|
funnel: Docs
|
||||||
|
doc_type: Tutorials
|
||||||
|
category: Manage Account Settings
|
||||||
|
blurb: Require users to specify a destination tag when sending to your address.
|
||||||
|
targets:
|
||||||
|
- local
|
||||||
|
|
||||||
# TODO: "Use Deposit Authorization to Block Unwanted Payments" (DOC-1555)
|
# TODO: "Use Deposit Authorization to Block Unwanted Payments" (DOC-1555)
|
||||||
|
|
||||||
|
- name: Use Specialized Payment Types
|
||||||
|
html: use-specialized-payment-types.html
|
||||||
|
funnel: Docs
|
||||||
|
doc_type: Tutorials
|
||||||
|
category: Use Specialized Payment Types
|
||||||
|
template: template-landing-children.html
|
||||||
|
blurb: Use advanced features like Escrow and Payment Channels to build smart applications on the XRP Ledger.
|
||||||
|
targets:
|
||||||
|
- local
|
||||||
|
|
||||||
|
# Redirect from old "complex" payment types URL
|
||||||
- name: Use Complex Payment Types
|
- name: Use Complex Payment Types
|
||||||
html: use-complex-payment-types.html
|
html: use-complex-payment-types.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
template: template-landing-children.html
|
template: template-redirect.html
|
||||||
blurb: Use advanced features like Escrow and Payment Channels to build smart applications on the XRP Ledger.
|
redirect_url: use-specialized-payment-types.html
|
||||||
targets:
|
targets:
|
||||||
- local
|
- local
|
||||||
|
|
||||||
@@ -791,7 +839,7 @@ pages:
|
|||||||
html: use-escrows.html
|
html: use-escrows.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Escrows
|
subcategory: Use Escrows
|
||||||
blurb: The XRP Ledger supports held payments, or escrows, that can be executed only after a certain time has passed or a cryptographic condition has been fulfilled. Escrows can only send XRP, not issued currencies. You can use these features to build publicly-provable smart contracts. This sections explains basic tasks relating to held payments.
|
blurb: The XRP Ledger supports held payments, or escrows, that can be executed only after a certain time has passed or a cryptographic condition has been fulfilled. Escrows can only send XRP, not issued currencies. You can use these features to build publicly-provable smart contracts. This sections explains basic tasks relating to held payments.
|
||||||
template: template-landing-children.html
|
template: template-landing-children.html
|
||||||
@@ -802,7 +850,7 @@ pages:
|
|||||||
html: send-a-time-held-escrow.html
|
html: send-a-time-held-escrow.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Escrows
|
subcategory: Use Escrows
|
||||||
blurb: Create an escrow whose only condition for release is that a specific time has passed.
|
blurb: Create an escrow whose only condition for release is that a specific time has passed.
|
||||||
targets:
|
targets:
|
||||||
@@ -812,7 +860,7 @@ pages:
|
|||||||
html: send-a-conditionally-held-escrow.html
|
html: send-a-conditionally-held-escrow.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Escrows
|
subcategory: Use Escrows
|
||||||
blurb: Create an escrow whose release is based on a condition being fulfilled.
|
blurb: Create an escrow whose release is based on a condition being fulfilled.
|
||||||
targets:
|
targets:
|
||||||
@@ -822,7 +870,7 @@ pages:
|
|||||||
html: cancel-an-expired-escrow.html
|
html: cancel-an-expired-escrow.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Escrows
|
subcategory: Use Escrows
|
||||||
blurb: Cancel an expired escrow.
|
blurb: Cancel an expired escrow.
|
||||||
targets:
|
targets:
|
||||||
@@ -832,7 +880,7 @@ pages:
|
|||||||
html: look-up-escrows.html
|
html: look-up-escrows.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Escrows
|
subcategory: Use Escrows
|
||||||
blurb: Look up pending escrows by sender or destination address.
|
blurb: Look up pending escrows by sender or destination address.
|
||||||
targets:
|
targets:
|
||||||
@@ -843,7 +891,7 @@ pages:
|
|||||||
html: use-payment-channels.html
|
html: use-payment-channels.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
blurb: Payment Channels are an advanced feature for sending "asynchronous" XRP payments that can be divided into very small increments and settled later. This tutorial walks through the entire process of using a payment channel, with examples using the JSON-RPC API of a local rippled server.
|
blurb: Payment Channels are an advanced feature for sending "asynchronous" XRP payments that can be divided into very small increments and settled later. This tutorial walks through the entire process of using a payment channel, with examples using the JSON-RPC API of a local rippled server.
|
||||||
targets:
|
targets:
|
||||||
- local
|
- local
|
||||||
@@ -852,7 +900,7 @@ pages:
|
|||||||
html: use-checks.html
|
html: use-checks.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Checks
|
subcategory: Use Checks
|
||||||
blurb: Checks in the XRP Ledger authorize another account to claim funds later, similar to how personal paper checks work.
|
blurb: Checks in the XRP Ledger authorize another account to claim funds later, similar to how personal paper checks work.
|
||||||
status: not_enabled
|
status: not_enabled
|
||||||
@@ -864,7 +912,7 @@ pages:
|
|||||||
html: send-a-check.html
|
html: send-a-check.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Checks
|
subcategory: Use Checks
|
||||||
status: not_enabled
|
status: not_enabled
|
||||||
targets:
|
targets:
|
||||||
@@ -874,7 +922,7 @@ pages:
|
|||||||
html: cash-a-check-for-an-exact-amount.html
|
html: cash-a-check-for-an-exact-amount.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Checks
|
subcategory: Use Checks
|
||||||
status: not_enabled
|
status: not_enabled
|
||||||
targets:
|
targets:
|
||||||
@@ -884,7 +932,7 @@ pages:
|
|||||||
html: cash-a-check-for-a-flexible-amount.html
|
html: cash-a-check-for-a-flexible-amount.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Checks
|
subcategory: Use Checks
|
||||||
status: not_enabled
|
status: not_enabled
|
||||||
targets:
|
targets:
|
||||||
@@ -894,7 +942,7 @@ pages:
|
|||||||
html: cancel-a-check.html
|
html: cancel-a-check.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Checks
|
subcategory: Use Checks
|
||||||
status: not_enabled
|
status: not_enabled
|
||||||
targets:
|
targets:
|
||||||
@@ -904,7 +952,7 @@ pages:
|
|||||||
html: look-up-checks-by-sender.html
|
html: look-up-checks-by-sender.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Checks
|
subcategory: Use Checks
|
||||||
status: not_enabled
|
status: not_enabled
|
||||||
targets:
|
targets:
|
||||||
@@ -914,7 +962,7 @@ pages:
|
|||||||
html: look-up-checks-by-recipient.html
|
html: look-up-checks-by-recipient.html
|
||||||
funnel: Docs
|
funnel: Docs
|
||||||
doc_type: Tutorials
|
doc_type: Tutorials
|
||||||
category: Use Complex Payment Types
|
category: Use Specialized Payment Types
|
||||||
subcategory: Use Checks
|
subcategory: Use Checks
|
||||||
status: not_enabled
|
status: not_enabled
|
||||||
targets:
|
targets:
|
||||||
|
|||||||
Reference in New Issue
Block a user