# MPT Escrow

Place Multi-Purpose Tokens in escrow on the XRP Ledger.

## How MPT escrow works

Escrow allows tokens to be held on-chain with release conditions such as time-based locks or cryptographic conditions. This enables use cases like scheduled payments, conditional releases, and trustless token exchanges.

Escrow requires `tfMPTCanEscrow` to be set during issuance. This flag cannot be added after the MPT is created.

## Prerequisites

- The MPT was created with the `tfMPTCanEscrow` flag enabled
- The holder has sufficient tokens to place in escrow
- Sufficient XRP for transaction fees and reserves


## Finish an escrow

To release tokens from an existing escrow, submit an `EscrowFinish` transaction:


```json
{
  "payload": {
    "id": "{{intent_id}}",
    "accountId": "{{account_id}}",
    "ledgerId": "xrpl-testnet",
    "parameters": {
      "type": "XRPL",
      "feeStrategy": {
        "priority": "High",
        "type": "Priority"
      },
      "maximumFee": "1000000000",
      "operation": {
        "type": "EscrowFinish",
        "owner": {
          "address": "rOwnerAddress...",
          "type": "Address"
        },
        "offerSequence": 12345678
      }
    },
    "description": "EscrowFinish intent",
    "customProperties": {},
    "type": "v0_CreateTransactionOrder"
  }
}
```

## Parameters

| Field | Type | Required | Description |
|  --- | --- | --- | --- |
| `owner` | object | Yes | The account that created the escrow. |
| `owner.type` | string | Yes | One of: `Account` (internal account UUID), `Address` (XRPL address), or `Endpoint` (endpoint UUID). |
| `owner.address` | string | Conditional | The XRPL address that created the escrow. Required when `owner.type` is `Address`. |
| `owner.accountId` | string | Conditional | Internal account UUID. Required when `owner.type` is `Account`. |
| `owner.endpointId` | string | Conditional | Endpoint UUID. Required when `owner.type` is `Endpoint`. |
| `offerSequence` | integer | Yes | The sequence number of the escrow creation transaction. |
| `condition` | string | No | Hex-encoded PREIMAGE-SHA-256 crypto-condition (if escrow uses condition). |
| `fulfillment` | string | No | Hex-encoded fulfillment matching the condition (required if condition was set). |
| `credentialIds` | array | No | Array of hex-encoded credential IDs (if escrow requires credentials). |


## Conditional escrow

If the escrow was created with a crypto-condition, you must provide both the `condition` and `fulfillment` parameters:


```json
{
  "operation": {
    "type": "EscrowFinish",
    "owner": {
      "address": "rOwnerAddress...",
      "type": "Address"
    },
    "offerSequence": 12345678,
    "condition": "A0258020E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855810100",
    "fulfillment": "A0028000"
  }
}
```

## Response

A successful request returns the transaction order with status `Pending`. After confirmation:

- The escrowed tokens are released to the destination address.
- The escrow object is removed from the ledger.
- Any XRP reserve held for the escrow is returned to the creator.


## Related topics

- [Multi-purpose tokens](/products/custody/accounts-and-assets/tokenization/xrpl-mpts#supported-operations) — Overview of MPT operations.
- [Create issuance](/products/custody/accounts-and-assets/tokenization/xrpl-mpts/issuer/create-issuance) — Create an MPT with the `tfMPTCanEscrow` flag.
- EscrowFinish — XRPL transaction reference.
- Escrow — XRPL escrow concepts.