XRPL Trust Lines Explained
Trust lines are the foundation of the XRPL token system. Every token on the XRP Ledger -- stablecoins, meme coins, wrapped assets -- depends on trust lines. Here is how they work and how to use them.
What is a trust line
A trust line is an explicit opt-in relationship between an XRPL account and a token issuer. Before you can hold any token on the XRP Ledger (other than XRP itself), you must create a trust line to the issuer of that token. This is fundamentally different from Ethereum where any ERC-20 token can be sent to your address without consent.
Think of it like this: on Ethereum, anyone can airdrop random tokens to your wallet. On the XRPL, you choose which tokens you are willing to hold by creating trust lines. This prevents spam tokens and gives users control over their account.
How trust lines work
A trust line has three key properties:
- Currency code: The token identifier (e.g., USD, EUR, SOLO, CSC). Can be a 3-character code or a 40-character hex string for longer names.
- Issuer: The XRPL account address that issues the token. The same currency code from different issuers are different tokens.
- Limit: The maximum amount of this token you are willing to hold. Can be set to any value. Setting a limit creates the trust line.
When you create a trust line, you are telling the network "I trust this issuer for this currency up to this limit." The issuer can then send you tokens or you can receive them through DEX trades and payments.
Creating a trust line
To create a trust line, you submit a TrustSet transaction specifying the currency, issuer, and limit. This costs the standard transaction fee (about 0.00001 XRP) plus a 0.2 XRP reserve increase on your account. The reserve is not a fee -- it is held in your account and released when you remove the trust line.
Most XRPL wallets (Xaman, Crossmark, GemWallet) have built-in trust line management. You can also create trust lines programmatically using xrpl.js, xrpl-py, or any XRPL client library.
Issuer controls
Token issuers on the XRPL have powerful control over their tokens through trust line features:
- Authorized trust lines: Require explicit approval before anyone can hold your token. Used for securities, regulated assets, and KYC-gated tokens.
- Global freeze: Freeze all trust lines for a token simultaneously. Used for emergency compliance actions.
- Individual freeze: Freeze a specific account's trust line. Used for targeted enforcement.
- Clawback: Recover tokens from a holder's account. Required by some regulatory frameworks.
- Transfer fee: Charge a percentage on every transfer of your token between third parties.
- No Ripple flag: Controls whether your token can be used in cross-currency payment paths.
Trust line reserves
Each trust line increases your account's reserve requirement by 0.2 XRP. If you have 10 trust lines, that is 2 XRP reserved (plus the 1 XRP base reserve = 3 XRP total). The reserve prevents ledger bloat by making it costly to create millions of empty trust lines.
You can recover the reserve by removing trust lines you no longer need. To remove a trust line, set its limit to 0 and ensure the balance is also 0 (sell or send any remaining tokens first).
Querying trust lines via API
XRPL Stream provides several API methods for working with trust lines:
- account_lines: List all trust lines for an account, including balances and limits
- account_currencies: List which currencies an account can send and receive
- account_info: Check the account's owner count (which determines total reserve)
- gateway_balances: For issuers -- see total amounts outstanding across all holders
Large issuers like GateHub (rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq) can have tens of thousands of trust lines. XRPL Stream handles paginated queries with full history, so you can enumerate all holders of any token at any point in time.
Common use cases
- Stablecoins: USD, EUR, and other fiat-pegged tokens issued by regulated entities. Trust lines enable compliance controls.
- Community tokens: SOLO, CSC, CORE, and other XRPL community tokens. Users opt in by creating trust lines.
- Wrapped assets: BTC, ETH, and other assets bridged to the XRPL as issued tokens.
- Loyalty points: Businesses issue reward tokens that customers hold via trust lines.