Pular para o conteúdo

Finish an escrow that holds Multi-Purpose Tokens on the XRP Ledger.

Ripple Custody (Vault) supports finishing MPT escrows with EscrowFinish. It doesn't support creating them: there is no EscrowCreate operation.

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
  • An escrow that holds the MPT exists on the ledger, and you know its owner and the sequence number of the transaction that created it
  • Sufficient XRP for transaction fees and reserves

Finish an escrow

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

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

Parameters

FieldTypeRequiredDescription
ownerobjectYesThe account that created the escrow.
owner.typestringYesOne of: Account (internal account UUID), Address (XRPL address), or Endpoint (endpoint UUID).
owner.addressstringConditionalThe XRPL address that created the escrow. Required when owner.type is Address.
owner.accountIdstringConditionalInternal account UUID. Required when owner.type is Account.
owner.endpointIdstringConditionalEndpoint UUID. Required when owner.type is Endpoint.
offerSequenceintegerYesThe sequence number of the escrow creation transaction.
conditionstringNoHex-encoded PREIMAGE-SHA-256 crypto-condition (if escrow uses condition).
fulfillmentstringNoHex-encoded fulfillment matching the condition (required if condition was set).
credentialIdsarrayNoArray 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:

{
  "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.