The XRP Ledger (XRPL) operates through two primary interaction types: transactions, which modify the ledger state, and requests, which retrieve data without altering the ledger. This guide explores both mechanisms, their structures, and use cases.
How Transactions Work
Transactions are the backbone of the XRPL, enabling actions like:
- Transferring XRP and tokens
- Minting/burning NFTs
- Creating/deleting decentralized exchange offers
Transaction Structure
Every transaction follows a consistent JSON format with these required fields:
TransactionType(e.g.,Payment,NFTokenMint)Account(sender’s public address)Fee(transaction cost in drops)Sequence(unique number per account)
Example: Payment Transaction
{
"TransactionType": "Payment",
"Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn",
"Amount": "1000000",
"Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX"
}Execution Flow
- Submission: Send the transaction via JavaScript, Python, or CLI.
- Validation:
rippledservers propose it to the network. - Consensus: 80% validator approval finalizes the transaction.
- Confirmation: The ledger updates irreversibly.
👉 Learn more about XRP Ledger transactions
How Requests Work
Requests fetch ledger data without modifying it. Common use cases include:
- Checking account balances
- Verifying transaction status
- Querying NFT ownership
Request Structure
Requests typically require:
command(e.g.,account_info)- Identifier fields (e.g.,
accountaddress)
Example: Account Info Request
{
"command": "account_info",
"account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn"
}Response Data
Responses include:
- Account balances
- Transaction history
- Metadata (e.g.,
LedgerEntryType)
Servers Handling Requests:
rippled: General-purpose serversClio: Optimized for historical data queries
Key Differences
| Feature | Transactions | Requests |
|---|---|---|
| Purpose | Modify ledger | Retrieve data |
| Signing | Requires signature | No signature needed |
| Cost | Fee in XRP drops | Free |
FAQ
Q: Can I cancel a submitted transaction?
A: Only if it hasn’t been finalized. Use LastLedgerSequence to set a timeout.
Q: Why do some requests return unvalidated data?
A: For speed, Clio may return provisional data. Check validated: true for finality.
Q: How do I track NFT transfers?
A: Use the nft_info request with the NFT ID.
👉 Explore advanced XRPL features
Next Steps:
- Dive into the XRPL Software Ecosystem
- Experiment with the Interactive Tutorials