How-To GuidesSmart Contracts
Advanced

How to Use Smart Contracts

Escrow, payment channels, and multi-signature on XRPL

30-40 minutes
6 steps
6 screenshots
Your Progress0 of 6 complete
Navigate to Smart Contracts
Access the Smart Contracts module from your dashboard
1 min

The Smart Contracts module provides access to advanced XRPL features including escrow, payment channels, and multi-signature transactions.

Smart Contracts Dashboard

Available Smart Contract Features

Escrow

Lock XRP with time-based or condition-based release

Payment Channels

High-speed micropayments with minimal fees

Multi-Signature

Require multiple approvals for transactions

Trust Lines

Enable token holding and trading

Note: Smart contracts on XRPL are native protocol features, not Turing-complete programs. They're highly efficient and gas-free.

Use the Cost Calculator
Compare XRPL costs vs other blockchains
3 min

The Cost Calculator helps you understand the significant cost savings of using XRPL for smart contract operations compared to Ethereum and other chains.

Cost Calculator Interface

How to Use the Calculator

  1. 1
    Select Operation Type
    Choose from Escrow, Payment Channel, Multi-sig, or Token Creation
  2. 2
    Enter Transaction Amount
    Specify the value in XRP or USD
  3. 3
    View Cost Comparison
    See side-by-side costs for XRPL vs Ethereum

Cost Comparison Example:

XRP LedgerRecommended
Transaction Fee0.00001 XRP
USD Equivalent~$0.000005
Settlement Time3-5 seconds
Reserve (Escrow)2 XRP
EthereumHigh Gas
Gas Fee (avg)~0.003 ETH
USD Equivalent~$7.50
Settlement Time12-60 seconds
Contract Deploy~$50-200
99.9% Cost Savings on XRPL

Pro Tip: XRPL reserves are returned when escrows are finished or payment channels are closed, making them essentially free.

Create an Escrow
Lock XRP with time-based or conditional release
10 min

Escrow allows you to lock XRP that can only be released when certain conditions are met, such as a specific time or a cryptographic condition.

Escrow Creation Form

Escrow Configuration

Destination Address
Recipient's XRPL address
Who receives the XRP when released
Amount (XRP)
XRP to lock in escrow
Minimum: 1 XRP
Finish After
Earliest release time
Escrow can be finished after this
Cancel After (Optional)
Expiration time
Funds return to sender if not claimed

EscrowCreate Transaction

{
  "TransactionType": "EscrowCreate",
  "Account": "rN7n3473SaZBCG4dFL83w7a1RXtXtbk2D9",
  "Destination": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
  "Amount": "10000000", // 10 XRP in drops
  "FinishAfter": 789014400, // Ripple Epoch
  "CancelAfter": 789019600
}

Escrow Use Cases:

Vesting Schedules
Release tokens over time to team members
Secure Payments
Hold funds until conditions are met
Delayed Distributions
Schedule future dividend payments
Conditional Release
Use crypto-conditions for complex logic

Important: Escrow locks 2 XRP as a reserve. This is returned when the escrow is finished or cancelled.

Create a Payment Channel
Set up high-speed micropayment channels
10 min

Payment channels enable high-speed, off-ledger transactions with minimal fees. Perfect for streaming payments, subscriptions, and micropayments.

Payment Channel Creation

Payment Channel Configuration

Destination
Recipient address
Who can claim from this channel
Channel Amount
Total XRP to allocate
Maximum claimable amount
Settle Delay
Seconds before close
Dispute resolution window
Public Key
For claim authorization
Signs off-ledger claims

PaymentChannelCreate Transaction

{
  "TransactionType": "PaymentChannelCreate",
  "Account": "rN7n3473SaZBCG4dFL83w7a1RXtXtbk2D9",
  "Destination": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
  "Amount": "100000000", // 100 XRP
  "SettleDelay": 86400, // 24 hours
  "PublicKey": "023693F15967AE357D..."
}

How Payment Channels Work:

Sender
Off-ledger claims (instant)
Final settlement (on-ledger)
Receiver
1000+
Claims/second
$0
Per claim fee
1
Final transaction

Pro Tip: Payment channels are perfect for API metering, content streaming, and any scenario requiring many small payments.

Set Up Multi-Signature
Configure multiple approvers for transactions
8 min

Multi-signature (multi-sig) accounts require approval from multiple parties before transactions can be executed, providing enhanced security for high-value assets.

Multi-Signature Configuration

Multi-Sig Configuration

Signer List SetupSignerListSet
Signer 1 (Admin)
rN7n3473SaZ...k2D9
Weight: 2
Signer 2 (Finance)
rfkE1aSy9G8...KTy
Weight: 1
Signer 3 (Operations)
rPT1Sjq2YGr...7m4
Weight: 1
Quorum Required3 of 4 weight

SignerListSet Transaction

{
  "TransactionType": "SignerListSet",
  "Account": "rN7n3473SaZBCG4dFL83w7a1RXtXtbk2D9",
  "SignerQuorum": 3,
  "SignerEntries": [
    { "SignerEntry": { "Account": "...", "SignerWeight": 2 } },
    { "SignerEntry": { "Account": "...", "SignerWeight": 1 } },
    { "SignerEntry": { "Account": "...", "SignerWeight": 1 } }
  ]
}

Common Multi-Sig Configurations:

2-of-3
Standard security
Partners, small teams
3-of-5
Enterprise
Board approvals
M-of-N
Custom
Up to 32 signers

Security Tip: Multi-sig is essential for treasury management, token issuance controls, and any high-value operations.

Deploy & Monitor Contracts
Execute and track your smart contract operations
5 min

Once configured, deploy your smart contracts to the XRP Ledger and monitor their status through the dashboard.

Active Contracts Dashboard

Deployment Process

  1. 1
    Review Configuration
    Verify all contract parameters are correct
  2. 2
    Connect Wallet
    Ensure your Xaman wallet is connected
  3. 3
    Click Deploy
    Submit the transaction to XRPL
  4. 4
    Sign with Xaman
    Authorize the transaction on your device
  5. ✓
    Contract Live!
    View on XRPL Explorer and in your dashboard

Monitoring Dashboard:

Escrow #1
Created 2 hours ago
100 XRP
Active
Payment Channel #1
147 claims processed
500/1000 XRP
Open
Multi-Sig Vault
2/3 signatures required
10,000 XRP
Configured

Congratulations!

You've mastered XRP Ledger smart contracts! You can now create escrows, payment channels, and multi-signature accounts for enterprise-grade asset management.

Open Contracts
View Dashboard
More Learning