|
| 1 | +--- |
| 2 | +namespace-identifier: xrpl-caip19 |
| 3 | +title: XRP Ledger Namespace - Assets |
| 4 | +author: Pelle Braendgaard (@pelle) |
| 5 | +discussions-to: https://github.com/ChainAgnostic/namespaces/pull/158/ |
| 6 | +status: Draft |
| 7 | +type: Standard |
| 8 | +created: 2023-02-23 |
| 9 | +updated: 2025-11-06 |
| 10 | +requires: ["CAIP-2", "CAIP-10", "CAIP-19", "CAIP-20"] |
| 11 | +--- |
| 12 | + |
| 13 | +# CAIP-19 |
| 14 | + |
| 15 | +*For context, see the [CAIP-19][] specification.* |
| 16 | + |
| 17 | +## Rationale |
| 18 | + |
| 19 | +The XRP Ledger supports multiple types of digital assets beyond its native XRP token. |
| 20 | +These include fungible tokens (issued currencies via trust lines), non-fungible tokens (NFTokens via XLS-20), AMM liquidity pool tokens, and the newer Multi-Purpose Tokens (MPTs). |
| 21 | +This specification defines how to identify each asset type using the [CAIP-19] standard. |
| 22 | + |
| 23 | +## Asset Types |
| 24 | + |
| 25 | +The XRP Ledger has the following asset types: |
| 26 | + |
| 27 | +1. **Native XRP** - The native digital asset of the XRP Ledger, used for transaction fees and as a bridge currency |
| 28 | +2. **Trust Line Tokens (Issued Currencies)** - Fungible tokens issued by accounts, representing any asset (fiat currencies, commodities, other tokens) |
| 29 | +3. **NFTokens** - Non-fungible tokens following the [XLS-20] standard, representing unique digital or physical assets |
| 30 | +4. **AMM LP Tokens** - Liquidity provider tokens from Automated Market Makers (XLS-30), representing shares in liquidity pools |
| 31 | +5. **Multi-Purpose Tokens (MPTs)** - Next-generation fungible tokens with improved efficiency (currently in development) |
| 32 | + |
| 33 | +## Syntax |
| 34 | + |
| 35 | +The asset identification follows the CAIP-19 standard with the chain ID from [CAIP-2][] followed by a slash, an asset namespace, a colon, and an asset reference. |
| 36 | + |
| 37 | +``` |
| 38 | +asset_id: chain_id + "/" + asset_namespace + ":" + asset_reference |
| 39 | +chain_id: See [CAIP-2][] |
| 40 | +asset_namespace: "slip44" | "token" | "xls20" | "xls30" | "xls33" |
| 41 | +asset_reference: slip44_ref | token_ref | xls20_ref | xls30_ref | xls33_ref |
| 42 | +
|
| 43 | +slip44_ref: "144" |
| 44 | +token_ref: currency_code + "." + issuer_address |
| 45 | +currency_code: standard_code | nonstandard_code |
| 46 | +standard_code: [A-Za-z0-9?!@#$%^&*<>(){}[\]|]{3} |
| 47 | +nonstandard_code: [0-9A-F]{40} |
| 48 | +issuer_address: r[1-9a-hj-zA-HJ-NP-Z]{24,34} |
| 49 | +xls20_ref: [0-9A-F]{64} |
| 50 | +xls30_ref: [0-9A-F]{40} + "." + amm_address |
| 51 | +amm_address: r[1-9a-hj-zA-HJ-NP-Z]{24,34} |
| 52 | +xls33_ref: [0-9A-F]{64} |
| 53 | +``` |
| 54 | + |
| 55 | +## Semantics |
| 56 | + |
| 57 | +### Native Asset (`slip44`) |
| 58 | + |
| 59 | +The native XRP token uses the SLIP-44 coin type as defined in [CAIP-20][]. |
| 60 | +XRP has coin type 144 in the SLIP-44 registry. |
| 61 | + |
| 62 | +**Reference format:** `144` |
| 63 | + |
| 64 | +### Trust Line Tokens (`token`) |
| 65 | + |
| 66 | +Issued currencies on the XRP Ledger are fungible tokens that exist in trust lines between accounts. |
| 67 | +Each token is identified by a currency code and an issuer address. |
| 68 | + |
| 69 | +**Currency codes** can be: |
| 70 | + |
| 71 | +- **Standard format:** 3-character ASCII string (typically ISO 4217 codes like USD, EUR, but can include symbols) |
| 72 | +- **Nonstandard format:** 40-character (160-bit) hexadecimal string for custom identifiers |
| 73 | + |
| 74 | +**Reference format:** `{currency_code}.{issuer_address}` |
| 75 | + |
| 76 | +The currency code and issuer address are separated by a period (`.`). |
| 77 | + |
| 78 | +### NFTokens (`xls20`) |
| 79 | + |
| 80 | +NFTokens follow the [XLS-20] standard and are identified by their unique 64-character hexadecimal NFTokenID. |
| 81 | +The NFTokenID encodes multiple pieces of information including flags, transfer fee, issuer address, taxon, and sequence number. |
| 82 | + |
| 83 | +**Reference format:** `{nftoken_id}` |
| 84 | + |
| 85 | +### AMM LP Tokens (`xls30`) |
| 86 | + |
| 87 | +Automated Market Maker liquidity provider tokens (specified in [XLS-30]) represent ownership shares in AMM pools. |
| 88 | +LP token currency codes always start with `03` followed by 38 hex characters (a truncated SHA-512 hash of the asset pair). |
| 89 | +The issuer is the AMM account address. |
| 90 | + |
| 91 | +**Reference format:** `{lp_currency_code}.{amm_address}` |
| 92 | + |
| 93 | +### Multi-Purpose Tokens (`xls33`) |
| 94 | + |
| 95 | +Multi-Purpose Tokens (specified in [XLS-33]) are next-generation fungible tokens designed for improved efficiency. |
| 96 | +Each MPT is identified by a unique 64-character hexadecimal identifier. |
| 97 | + |
| 98 | +**Reference format:** `{mpt_id}` |
| 99 | + |
| 100 | +Note: MPTs are currently in development and not yet available on mainnet. |
| 101 | + |
| 102 | +## Test Cases |
| 103 | + |
| 104 | +```sh |
| 105 | +# Native XRP on Livenet |
| 106 | +xrpl:0/slip44:144 |
| 107 | + |
| 108 | +# RLUSD issued currency on Livenet (Ripple USD stablecoin) |
| 109 | +xrpl:0/token:RLUSD.rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De |
| 110 | + |
| 111 | +# USD issued by Bitstamp on Livenet |
| 112 | +xrpl:0/token:USD.rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B |
| 113 | + |
| 114 | +# SOLO token with nonstandard currency code on Livenet (Sologenic) |
| 115 | +xrpl:0/token:534F4C4F00000000000000000000000000000000.rsoLo2S1kiGeCcn6hCUXVrCpGMWLrRrLZz |
| 116 | + |
| 117 | +# NFToken on Livenet |
| 118 | +xrpl:0/xls20:000B013A95F14B0044F78A264E41713C64B5F89242540EE208C3098E00000D65 |
| 119 | + |
| 120 | +# AMM LP token on Livenet (XRP/TST pool) |
| 121 | +xrpl:0/xls30:039C99CD9AB0B70B32ECDA51EAAE471625608EA2.rE54zDvgnghAoPopCgvtiqWNq3dU5y836S |
| 122 | + |
| 123 | +# NFToken on Testnet |
| 124 | +xrpl:1/xls20:00081388C47ABB000CAFAF6F89F18D4E5F6A3377E340DA2C09999E250000001F |
| 125 | + |
| 126 | +# Multi-Purpose Token on Devnet (hypothetical - MPTs not yet on mainnet) |
| 127 | +xrpl:2/xls33:000000000A1B2C3D4E5F6789ABCDEF0123456789ABCDEF0123456789ABCDEF01 |
| 128 | +``` |
| 129 | + |
| 130 | +## References |
| 131 | + |
| 132 | +- [XRPL Tokens Documentation][] - Overview of token types on XRP Ledger |
| 133 | +- [XRPL Fungible Tokens][] - Trust line tokens and issued currencies |
| 134 | +- [XRPL NFTokens (XLS-20)][] - Non-fungible token standard |
| 135 | +- [XRPL AMM (XLS-30)][] - Automated market maker specification |
| 136 | +- [XRPL Currency Formats][] - Standard and nonstandard currency code formats |
| 137 | +- [NFToken Object][] - NFTokenID structure and encoding |
| 138 | +- [SLIP-44][] - Registered coin types for BIP-0044 |
| 139 | + |
| 140 | +[CAIP-2]: ./caip2.md |
| 141 | +[CAIP-10]: ./caip10.md |
| 142 | +[CAIP-19]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-19.md |
| 143 | +[CAIP-20]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-20.md |
| 144 | +[XRPL Tokens Documentation]: https://xrpl.org/docs/concepts/tokens |
| 145 | +[XRPL Fungible Tokens]: https://xrpl.org/docs/concepts/tokens/fungible-tokens |
| 146 | +[XRPL NFTokens (XLS-20)]: https://xrpl.org/docs/concepts/tokens/nfts |
| 147 | +[XRPL AMM (XLS-30)]: https://xrpl.org/docs/concepts/tokens/decentralized-exchange/automated-market-makers |
| 148 | +[XRPL Currency Formats]: https://xrpl.org/docs/references/protocol/data-types/currency-formats |
| 149 | +[NFToken Object]: https://xrpl.org/docs/references/protocol/data-types/nftoken |
| 150 | +[SLIP-44]: https://github.com/satoshilabs/slips/blob/master/slip-0044.md |
| 151 | +[XLS-20]: https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0020-non-fungible-tokens |
| 152 | +[XLS-30]: https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0030-automated-market-maker |
| 153 | +[XLS-33]: https://github.com/XRPLF/XRPL-Standards/tree/master/XLS-0033-multi-purpose-tokens |
| 154 | + |
| 155 | +## Copyright |
| 156 | + |
| 157 | +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
0 commit comments