How-to for developers · Payments

Send a Timed Escrow

In plain words

This tutorial shows how to send an escrow whose only condition for release is that a specific time has passed. You can use it to set aside money for yourself or others so that it cannot be used until that time.

Written by zerps in plain words, from the source linked below.
Section
Tutorials

What you will do

You convert a timestamp into the XRP Ledger's native format, then create and finish an escrow. The tutorial escrows XRP. If the TokenEscrow amendment is enabled, you can also escrow tokens.

What you need

You need a basic understanding of the XRP Ledger and a client library, such as xrpl.js, installed. You need one account, which you can get from the faucet, and the address of another account to send the escrow to. The examples come in JavaScript and Python.

The steps in short

Install the dependencies and set up a client. Calculate the maturity time, the moment after which the escrow can be finished, by adding a delay to the current time. Convert it to seconds since the Ripple Epoch with the client library's conversion function. Send an EscrowCreate transaction with that time in the FinishAfter field, and save the transaction's sequence number. Wait until the escrow is mature, then send an EscrowFinish transaction that uses the saved sequence number.

Waiting for maturity

Once the escrow is created, the funds are locked up until the maturity time. Whether the escrow is mature depends on the official close time of the previous ledger. Ledger close times can vary and are rounded by up to 10 seconds. So the tutorial checks the close time of the latest validated ledger, waits for the difference and repeats until the escrow is mature.

Good to know

If you use a UNIX time without converting it to Ripple time first, the maturity time lands an extra 30 years in the future. To add an expiration time, after which the escrow can only be canceled, add a CancelAfter field. It is optional for timed XRP escrows but required for token escrows, and it must be after the FinishAfter time. Anyone can finish a timed escrow when it is ready. The funds always go to the intended recipient.

Source: xrpl.org. Read 6 December 2026.

Zerpedia states what the source says, in plain words, and gives no opinion. How Zerpedia is made

zerps Trading tokens on the XRP Ledger carries risk, including total loss. zerps is a self-custodial interface; it does not hold funds, give advice, or execute trades on your behalf.