|
| 1 | +--- |
| 2 | +title: XRPPayment |
| 3 | +description: Information about an XRP Ledger payment, including memo data and destination tag. |
| 4 | +keywords: [fdc, oracle, flare-data-connector, flare-network, xrpl] |
| 5 | +sidebar_position: 8 |
| 6 | +--- |
| 7 | + |
| 8 | +import TransactionSuccessStatus from "./_transaction_success_status.mdx"; |
| 9 | + |
| 10 | +Information about a `Payment` transaction on the **XRP Ledger** transferring native XRP from a source address to a receiving address. |
| 11 | + |
| 12 | +Unlike the chain-agnostic [`Payment`](/fdc/attestation-types/payment.mdx) attestation type, `XRPPayment` exposes XRPL-specific fields directly in the response: the source `r`-address (XRPL addresses) as a string, raw bytes of the first Memo's `MemoData`, and the destination tag. |
| 13 | +This avoids the need for off-chain helpers when a consumer contract needs to act on these fields. |
| 14 | + |
| 15 | +## Supported chains |
| 16 | + |
| 17 | +| Network Type | Supported Chains | |
| 18 | +| ------------ | ------------------------ | |
| 19 | +| **Mainnet** | `XRP` (XRP Ledger) | |
| 20 | +| **Testnet** | `testXRP` (XRPL Testnet) | |
| 21 | + |
| 22 | +## Request |
| 23 | + |
| 24 | +| Field | Solidity Type | Description | |
| 25 | +| --------------- | ------------- | ------------------------------------------------------------------------------------------- | |
| 26 | +| `transactionId` | `bytes32` | ID of the payment transaction. | |
| 27 | +| `proofOwner` | `address` | Address authorized to use the proof, where applicable. The verifier lower-cases this value. | |
| 28 | + |
| 29 | +## Response |
| 30 | + |
| 31 | +| Field | Solidity Type | Description | |
| 32 | +| ------------------------------ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------- | |
| 33 | +| `blockNumber` | `uint64` | Number of the ledger in which the transaction is included. | |
| 34 | +| `blockTimestamp` | `uint64` | The timestamp of the ledger, derived from `close_time` converted to UNIX time. | |
| 35 | +| `sourceAddress` | `string` | The XRPL `r`-address of the source. | |
| 36 | +| `sourceAddressHash` | `bytes32` | [Standard address hash](#standard-address-hash) of the source address. | |
| 37 | +| `receivingAddressHash` | `bytes32` | Standard address hash of the receiving address. Zero `bytes32` if `status` is not success. | |
| 38 | +| `intendedReceivingAddressHash` | `bytes32` | Standard address hash of the intended receiving address (the `Destination` field). Relevant when the transaction failed. | |
| 39 | +| `spentAmount` | `int256` | Amount in drops actually spent by the source address. | |
| 40 | +| `intendedSpentAmount` | `int256` | Amount in drops the source intended to spend (`Amount + Fee`). Relevant when the transaction failed. | |
| 41 | +| `receivedAmount` | `int256` | Amount in drops received by the receiving address. | |
| 42 | +| `intendedReceivedAmount` | `int256` | Amount in drops the receiving address would have received had the transaction succeeded. | |
| 43 | +| `hasMemoData` | `bool` | `true` if the transaction has a `MemoData` field. | |
| 44 | +| `firstMemoData` | `bytes` | Raw bytes of the `MemoData` field of the **first** Memo. Empty when `hasMemoData` is false. | |
| 45 | +| `hasDestinationTag` | `bool` | `true` if the transaction has a destination tag. | |
| 46 | +| `destinationTag` | `uint256` | Destination tag of the transaction. `0` when `hasDestinationTag` is false. XRPL currently only supports `uint32` destination tags. | |
| 47 | +| `status` | `uint8` | [Transaction success status](#transaction-success-status). | |
| 48 | + |
| 49 | +:::note[Differences from `Payment`] |
| 50 | + |
| 51 | +`XRPPayment` is XRPL only and replaces the `inUtxo` / `utxo` request fields with `proofOwner`. |
| 52 | +The response drops `standardPaymentReference`, `oneToOne`, and `sourceAddressesRoot` (always implied for XRPL Payment transactions) and adds `sourceAddress`, `hasMemoData`, `firstMemoData`, `hasDestinationTag`, and `destinationTag`. |
| 53 | + |
| 54 | +::: |
| 55 | + |
| 56 | +## Verification process |
| 57 | + |
| 58 | +1. The transaction identified by `transactionId` is fetched from an XRPL node or indexer via the [`tx`](https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/transaction-methods/tx) method. |
| 59 | +2. If the transaction cannot be retrieved, or its ledger lacks the required [confirmations](#finality), the request is rejected. |
| 60 | +3. A [payment summary](/fdc/attestation-types/payment.mdx#payment-summary) is computed for the transaction. |
| 61 | + - Only XRPL transactions of type `Payment` produce a summary; other types are rejected. |
| 62 | + - A successful payment has exactly one sender and at most one receiver. |
| 63 | + Multi-output payments are rejected. |
| 64 | +4. `blockNumber` and `blockTimestamp` are extracted from the ledger if not present in the transaction data. |
| 65 | + `blockTimestamp` is the ledger `close_time` converted to UNIX time. |
| 66 | +5. The first Memo's `MemoData` (if any) and the `DestinationTag` (if any) are surfaced unchanged in the response. |
| 67 | + |
| 68 | +:::note[Lowest used timestamp] |
| 69 | + |
| 70 | +For the `lowestUsedTimestamp` parameter, the `blockTimestamp` of the transaction is used. |
| 71 | + |
| 72 | +::: |
| 73 | + |
| 74 | +## Transaction success status |
| 75 | + |
| 76 | +<TransactionSuccessStatus /> |
| 77 | + |
| 78 | +## Standard address hash |
| 79 | + |
| 80 | +The **standard address hash** is the `keccak256` hash of the XRPL standard address as a string: |
| 81 | + |
| 82 | +```solidity |
| 83 | +keccak256(standardAddress) |
| 84 | +``` |
| 85 | + |
| 86 | +XRPL `r`-addresses are case-sensitive, so the address has a single canonical form (no lower-casing applied). |
| 87 | + |
| 88 | +**Example:** |
| 89 | + |
| 90 | +| Chain | Standard Address | Standard Address Hash | |
| 91 | +| ----- | ------------------------------------ | -------------------------------------------------------------------- | |
| 92 | +| XRPL | `rDsbeomae4FXwgQTJp9Rs64Qg9vDiTCdBv` | `0xa491aed10a1920ca31a85ff29e4bc410705d37d4dc9e690d4d500bcedfd8078f` | |
| 93 | + |
| 94 | +## Finality |
| 95 | + |
| 96 | +XRPL ledgers must reach the required confirmation depth before the transaction can be proven. |
| 97 | + |
| 98 | +| Chain | `chainId` | Confirmations required | Confirmation time | |
| 99 | +| ----- | --------- | ---------------------- | ----------------- | |
| 100 | +| XRPL | 3 | 3 | ≈12 seconds | |
| 101 | + |
| 102 | +## Contract Interface |
| 103 | + |
| 104 | +For the complete interface definition, see [`IXRPPayment`](/fdc/reference/IXRPPayment.mdx). |
0 commit comments