XRPL Payments (Devnet) — Quick Start
Audience: Operators and developers running demos/verification Prerequisites: tflow-server / tflow-client running, Devnet environment
This document walks you through the end-to-end demo procedure on the /projects/:id/payment screen (ProjectPayment), step by step: creating a milestone → depositing → locking escrow → settlement. It also summarizes where to look when a screen is empty or stuck.
0. Pre-checks — Operator Checklist
| Item | How to check | Healthy state |
|---|---|---|
| Devnet activation | cd tflow-xrpl-payment/server && node scripts/tus-ops.js balance <TFlow address> | XRP > 10, TUS TrustLine exists |
| TUS Issuer flag | Query the Issuer address with the same command | allowTrustLineLocking: true |
| TFlow Wallet → Issuer TrustLine | Same as above | TUS entry shown |
If inactive → run setup with tflow-xrpl-payment/server/scripts/tus-ops.js, or see the Phase 1 README.
1. Project-side Preparation
1-1. Register Buyer / Seller in ProjectShare
In the /projects/:id/share menu, add two users, each with a different actor_type:
- User A →
actor_type = 'buyer' - User B →
actor_type = 'seller'
⚠️ If Buyer/Seller are not registered, the case is created with
seller_user_idas NULL. The case itself is created, but during escrow the wallet address is empty, solock-fundsfails. You can still add milestones, but the actual payment flow is only possible after both roles are registered.
1-2. Activate each user's XRPL wallet (Devnet)
Each demonstrator, in a separate browser / incognito window:
- Install the Crossmark extension (crossmark.io)
- Create a new wallet → obtain the address (e.g.,
r9uEmgPLHMNZS8AHH62zm5whEVYXRn5vPJ) - Activate with the Devnet faucet:
→ 100 XRP deposited + account activatedcurl -X POST https://faucet.devnet.rippletest.net/accounts \ -H "Content-Type: application/json" \ -d '{"destination":"<wallet address>"}'
1-3. Register the wallet in the host UI
Each demonstrator goes to /projects/:id/payment → Verification (Request) or Verification (Issue) tab → Connect Wallet button:
- Approve sign-in in the Crossmark popup
- The system automatically opens a TUS TrustLine setup popup → sign (one time)
- "Wallet registered" toast
1-4. Issue TUS tokens to the Buyer (operator)
The operator runs a one-line command:
cd tflow-xrpl-payment/server
node scripts/tus-ops.js issue <Buyer address> 1000
→ Issues 1000 TUS to the Buyer wallet. Check the balance:
node scripts/tus-ops.js balance <Buyer address>
⚠️ Issuance must happen only after 1-3 (Buyer sets up the TrustLine) is complete. If it isn't finished, the issuance transaction is rejected with tecPATH_DRY or similar.
2. Payment Demo Flow
2-1. Create a milestone (case)
/projects/:id/payment → Settlement Dashboard tab:
- Click the "Add Milestone" button in the center of the empty screen
- Modal: enter milestone name (e.g., "Advance 30%"), amount (e.g., 100), ratio (30), date
- Create → first case registered, status =
DRAFT
2-2. Buyer deposits (Deposit)
Verification (Issue) tab (automatic if you have Buyer permission) → "Deposit Tokens" action:
- Crossmark popup → sign the Payment transaction (Buyer → TFlow Escrow Agent)
- Server: calls the
confirm-fundingAPI → statusDRAFT→FUNDED - Verify the transaction on devnet.xrpl.org (the TX hash is shown in the UI)
2-3. Automatic escrow lock (Lock)
The XrplEscrowJob worker runs every 30 seconds, finds FUNDED cases, and automatically runs EscrowCreate:
- Within 30 seconds, status
FUNDED→ESCROW_OPEN - The TFlow Oracle wallet locks the IOU into escrow (Crypto-Condition security)
- Stores
escrow_sequence,escrow_condition,escrow_fulfillmentin the DB
To lock immediately without waiting (optional):
curl -X POST http://localhost:3000/api/payment/cases/<case-uuid>/lock-funds \
-H "Authorization: Bearer <token>"
2-4. Seller uploads documents + Buyer approves → Release
Verification (Request) tab (Seller) → upload documents → AI verification → "Request Approval"
Verification (Issue) tab (Buyer) → "Approve" → server runs EscrowFinish:
- status
ESCROW_OPEN→RELEASED - IOU deposited to the Seller wallet (check the balance:
node scripts/tus-ops.js balance <Seller address>)
2-5. (Optional) Refund demo
By default cancelAfterSeconds = 7 days, so immediate refunds are not possible. For a demo:
# tflow-server/.env
XRPL_ESCROW_CANCEL_AFTER_SECONDS=60
After restarting, create a new case → after 60 seconds click the "Refund" button → EscrowCancel → funds recovered to TFlow → Payment to the Buyer.
3. Cleanup after the demo (operator)
The TUS held by each demonstrator is a temporary Devnet token, so it can safely be discarded. But if you want to reuse the same wallet for the next demo, you can recover it to the Issuer:
node scripts/tus-ops.js return <holder-seed> <amount>
→ The holder's TUS is sent to the Issuer and automatically burned.
4. Common Sticking Points — Troubleshooting
| Symptom | Cause | Resolution |
|---|---|---|
Column 'seller_user_id' cannot be null when adding a milestone | Migration not applied | Apply migration 20260507-01. Or register a seller in ProjectShare |
tecPATH_DRY on Deposit | Buyer TrustLine not set up, or TUS balance is 0 | Redo in the order 1-3 then 1-4 |
tecNO_PERMISSION or temMALFORMED on EscrowCreate | Issuer flag not set | Check allowTrustLineLocking with tus-ops.js balance <Issuer> |
| Seller balance unchanged after EscrowFinish | Seller TrustLine missing | Re-enter the host UI from the Seller wallet → triggers automatic TrustLine setup |
| Automatic lock doesn't happen even after waiting 30 seconds | XrplEscrowJob worker not running | Check for [AutoLock] Job started in the tflow-server logs. If absent, restart the worker process |
| Crossmark popup doesn't appear | Extension disabled, or the session is held by another tab | Click the Crossmark extension again → refresh the tab |
| Screen shows "T FLOW Network" / "Global Traders Ltd." | You entered the mock demo screen (/demo/payment) | Go to the /projects/:id/payment production screen |
5. Mainnet Transition is Separate
This guide is for Devnet only. Mainnet RLUSD escrow becomes possible only after Ripple enables the asfAllowTrustLineLocking flag on the RLUSD issuer account (currently inactive). For preparation items, see 260506-xrpl-스타일링/README.md Phase 4.
6. Related Tools / Files
- Operations script:
tflow-xrpl-payment/server/scripts/tus-ops.js - e2e dry-run:
tflow-xrpl-payment/server/scripts/dry-run.js - Demo screens (mock):
/demo/payment,/demo/pof(hidden routes) - Production screen:
/projects/:id/payment