Skip to content
Learn the Ledger poster: Payments with conditions. Kev and two koala friends gather around a glowing XRP Escrow vault filled with coins, surrounded by clocks, gears and an hourglass, with the line Native XRP escrow can lock funds until a set time or cryptographic condition is met.

Lesson 14

Payments with conditions

Native XRP escrow can lock funds until a set time or cryptographic condition is met. Build time-based releases directly on the ledger.

Kev’s team is paying a designer 50 XRP for a night-market poster. They’ve agreed the designer can collect from Friday. Kev uses XRP escrow to lock up the 50 XRP now. Once the escrow is created, that XRP is out of Kev’s spendable balance while the designer waits for the release.

How does a timed release work?

Kev submits an EscrowCreate transaction with the amount, the designer’s address and the earliest release time, called FinishAfter. When Friday comes, someone still needs to submit an EscrowFinish transaction. Any account can submit it, and the XRP goes to the designer’s address that Kev set when he created the escrow.

What if the payment needs a condition too?

Kev could also require a matching secret, called a fulfilment. For example, his team’s app could reveal the secret after someone approves the final poster. The ledger checks that the secret matches the condition set when Kev created the escrow. The app handles the approval. If Kev sets both an earliest release time and a cryptographic condition, the finish transaction has to satisfy both.

What happens if the deadline passes?

Kev can set a separate expiry called CancelAfter. If the escrow expires before it’s finished, anyone can submit EscrowCancel to return the XRP to Kev. Like the release, the refund needs its own transaction. Without a CancelAfter time, that cancellation route is unavailable.

Kev’s tip: Check the recipient address and both times before locking the XRP. FinishAfter opens the window to release it. CancelAfter sets the deadline for that release.

Sources

#XRPLEducationMonth

XRPL Foundation