|
| 1 | +--- |
| 2 | +namespace-identifier: stellar-caip19 |
| 3 | +title: Stellar Namespace - Assets |
| 4 | +author: Pelle Braendgaard (@pelle) |
| 5 | +discussions-to: https://github.com/ChainAgnostic/namespaces/pull/157 |
| 6 | +status: Draft |
| 7 | +type: Standard |
| 8 | +created: 2025-11-06 |
| 9 | +requires: ["CAIP-2", "CAIP-10", "CAIP-19", "CAIP-20"] |
| 10 | +--- |
| 11 | + |
| 12 | +# CAIP-19 |
| 13 | + |
| 14 | +*For context, see the [CAIP-19][] specification.* |
| 15 | + |
| 16 | +## Rationale |
| 17 | + |
| 18 | +In the Stellar ecosystem, assets can be represented in several distinct formats. |
| 19 | +The native asset (lumens/XLM) is identified using the SLIP-44 coin type registry (coin type 148), while issued assets are uniquely identified by combining an asset code (1-12 characters) with an issuer account address, separated by a hyphen. |
| 20 | +Additionally, Protocol 18 introduced liquidity pool shares (defined in [CAP-38]) which represent fractional ownership in automated market maker pools, and Protocol 20 introduced Soroban smart contract tokens following the SEP-41 token interface standard. |
| 21 | + |
| 22 | +## Syntax |
| 23 | + |
| 24 | +After the [CAIP-2] namespace+chainID, a slash defines an `asset_namespace` and an `asset_reference`. |
| 25 | +Stellar supports multiple asset types with different identification schemes: |
| 26 | + |
| 27 | +### Asset Namespaces |
| 28 | + |
| 29 | +| Namespace | Description | Reference Format | |
| 30 | +| :--- | :--- | :--- | |
| 31 | +| `slip44` | Native lumens (XLM) via SLIP-44 | `148` (Stellar's coin type) | |
| 32 | +| `asset` | Issued asset with code and issuer | `{asset_code}-{issuer_address}` | |
| 33 | +| `cap38` | Liquidity pool shares (CAP-38) | `{pool_id}` (64-char hex hash) | |
| 34 | +| `sep41` | Soroban smart contract token (SEP-41) | `{contract_address}` (56-char strkey) | |
| 35 | + |
| 36 | +### Asset Code Requirements |
| 37 | + |
| 38 | +Asset codes for issued assets must: |
| 39 | + |
| 40 | +- Consist of printable ASCII characters (octets `0x21` through `0x7e`) |
| 41 | +- Be 1-12 characters in length |
| 42 | +- Be case-sensitive |
| 43 | +- Not contain the hyphen character (`-`) as it is used as the delimiter |
| 44 | + |
| 45 | +### Issuer Address |
| 46 | + |
| 47 | +The issuer address must be a valid Stellar G-address (56 characters, starting with `G`). |
| 48 | + |
| 49 | +### Liquidity Pool ID |
| 50 | + |
| 51 | +Liquidity pool IDs are deterministically calculated as: |
| 52 | + |
| 53 | +- SHA-256 hash of the liquidity pool parameters |
| 54 | +- Pool parameters include: pool type and both assets in lexicographical order |
| 55 | +- Represented as a 64-character lowercase hexadecimal string |
| 56 | +- Only one pool can exist for a given asset pair |
| 57 | + |
| 58 | +### Contract Address |
| 59 | + |
| 60 | +Soroban contract addresses are: |
| 61 | + |
| 62 | +- Stellar `strkey`-encoded contract addresses (56 characters, starting with `C`) |
| 63 | +- For Stellar Asset Contracts (SAC), the address can be derived from the classic asset identifier |
| 64 | +- Can be obtained using: `stellar contract id asset --asset {code}:{issuer} --network {network}` |
| 65 | + |
| 66 | +## RegEx |
| 67 | + |
| 68 | +The RegEx validation strings are as follows: |
| 69 | + |
| 70 | +```sh |
| 71 | +asset_id: asset_type |
| 72 | +asset_type: chain_id + "/" + asset_namespace + ":" + asset_reference |
| 73 | +chain_id: namespace + ":" + blockchain_id (as defined in [CAIP-2]) |
| 74 | + |
| 75 | +asset_namespace: "slip44" | "asset" | "cap38" | "sep41" |
| 76 | + |
| 77 | +asset_reference: slip44_ref | asset_ref | cap38_ref | sep41_ref |
| 78 | +slip44_ref: "148" |
| 79 | +asset_ref: asset_code + "-" + issuer_address |
| 80 | +asset_code: [!-,.-~]{1,12} |
| 81 | +issuer_address: G[A-Z2-7]{55} |
| 82 | +cap38_ref: [0-9a-f]{64} |
| 83 | +sep41_ref: C[A-Z2-7]{55} |
| 84 | +``` |
| 85 | + |
| 86 | +Note: The `asset_code` regex `[!-,.-~]` excludes the hyphen character (ASCII 0x2D) from the printable ASCII range (0x21-0x7E) since hyphen is used as the delimiter. |
| 87 | + |
| 88 | +## Semantics |
| 89 | + |
| 90 | +### Native Asset (XLM/Lumens) |
| 91 | + |
| 92 | +The native asset is identified using the `slip44` namespace with coin type `148` as registered in the SLIP-44 registry. |
| 93 | +The native asset is unique and does not require an issuer. |
| 94 | +It is used for: |
| 95 | + |
| 96 | +- Transaction fees (which are burned/destroyed) |
| 97 | +- Minimum account balance requirements (base reserves) |
| 98 | +- Bridge currency for cross-asset transactions |
| 99 | + |
| 100 | +Example: `stellar:pubnet/slip44:148` |
| 101 | + |
| 102 | +### Issued Assets |
| 103 | + |
| 104 | +Issued assets are created by issuers and must be explicitly trusted by recipients before they can be received. |
| 105 | +The combination of asset code (1-12 characters) and issuer address uniquely identifies an asset. |
| 106 | +On the Stellar network, asset codes of 1-4 characters are stored as `AlphaNum4`, while codes of 5-12 characters are stored as `AlphaNum12`, but both use the same `asset` namespace in [CAIP-19]. |
| 107 | + |
| 108 | +Examples: |
| 109 | + |
| 110 | +- USDC issued by Circle: `asset:USDC-{issuer_address}` |
| 111 | +- Custom 8-character code: `asset:MYTOKEN8-{issuer_address}` |
| 112 | + |
| 113 | +### Liquidity Pool Shares (CAP-38) |
| 114 | + |
| 115 | +Liquidity pool shares represent fractional ownership in constant product automated market maker pools (CPAMM) as defined in [CAP-38]. These shares: |
| 116 | + |
| 117 | +- Are non-transferable (cannot be sent between accounts) |
| 118 | +- Can be minted by depositing assets into the pool |
| 119 | +- Can be redeemed for the underlying assets |
| 120 | +- Are identified by a deterministic pool ID hash |
| 121 | +- Use the `cap38` namespace |
| 122 | + |
| 123 | +### Soroban Contract Tokens (SEP-41) |
| 124 | + |
| 125 | +Soroban contract tokens follow the [SEP-41] token interface standard and include: |
| 126 | + |
| 127 | +- Stellar Asset Contracts (SAC): Wrapped versions of classic Stellar assets with smart contract functionality |
| 128 | +- Custom [CAP-46-6] -compliant tokens: Fully custom tokens implemented as Soroban smart contracts |
| 129 | +- All tokens use the `sep41` namespace and are identified by their contract address |
| 130 | + |
| 131 | +## Examples |
| 132 | + |
| 133 | +```sh |
| 134 | +# Native asset (lumens/XLM) on Pubnet |
| 135 | +stellar:pubnet/slip44:148 |
| 136 | + |
| 137 | +# Native asset on Testnet |
| 138 | +stellar:testnet/slip44:148 |
| 139 | + |
| 140 | +# USDC (4-character code) on Pubnet |
| 141 | +stellar:pubnet/asset:USDC-GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN |
| 142 | + |
| 143 | +# Custom token with 8-character code on Pubnet |
| 144 | +stellar:pubnet/asset:MYCOIN88-GDQP2KPQGKIHYJGXNUIYOMHARUARCA7DJT5FO2FFOOKY3B2WSQHG4W37 |
| 145 | + |
| 146 | +# Single character asset code on Testnet |
| 147 | +stellar:testnet/asset:X-GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ |
| 148 | + |
| 149 | +# Liquidity pool (XLM-USDC pool) on Pubnet |
| 150 | +stellar:pubnet/cap38:67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9 |
| 151 | + |
| 152 | +# Soroban token contract (USDC) on Pubnet |
| 153 | +stellar:pubnet/sep41:CCW67TSZV3SSS2HXMBQ5JFGCKJNXKZM7UQUWUZPUTHXSTZLEO7SJMI75 |
| 154 | + |
| 155 | +# Custom Soroban token contract on Testnet |
| 156 | +stellar:testnet/sep41:CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABSC4 |
| 157 | +``` |
| 158 | + |
| 159 | +## Backwards Compatibility |
| 160 | + |
| 161 | +Issued Stellar assets (represented here as the `asset` namespace) correspond to the native Stellar `alphanum4` and `alphanum12` asset types, which have been supported since the genesis of the Stellar network and maintain full backward compatibility. |
| 162 | + |
| 163 | +Liquidity pool shares were introduced in Protocol 18 (November 2021) and may not be supported by older clients. |
| 164 | + |
| 165 | +Soroban contract tokens were introduced in Protocol 20 (February 2024) and require Soroban-aware clients and tooling. |
| 166 | + |
| 167 | +## References |
| 168 | + |
| 169 | +- [Stellar Assets Overview][] - Overview of asset types on Stellar |
| 170 | +- [SLIP-44][] - Registered coin types for HD wallets |
| 171 | +- [CAIP-20][] - Asset Reference for the SLIP44 Asset Namespace |
| 172 | +- [CAP-38: Automated Market Makers][CAP-38] - Liquidity pools specification |
| 173 | +- [CAP-46-6: Smart Contract Standardized Asset][CAP-46-6] - Soroban token standard |
| 174 | +- [SEP-41: Token Interface][SEP-41] - Standard token interface for Soroban |
| 175 | +- [Stellar Asset Contract][] - Documentation for Stellar Asset Contracts |
| 176 | +- [Liquidity Pools Guide][] - Guide to using liquidity pools on Stellar |
| 177 | + |
| 178 | + |
| 179 | +[CAIP-2]: ./caip2.md |
| 180 | +[CAIP-10]: ./caip10.md |
| 181 | +[CAIP-19]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-19.md |
| 182 | +[CAIP-20]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-20.md |
| 183 | +[SLIP-44]: https://github.com/satoshilabs/slips/blob/master/slip-0044.md |
| 184 | +[Stellar Assets Overview]: https://developers.stellar.org/docs/learn/fundamentals/stellar-data-structures/assets |
| 185 | +[CAP-38]: https://github.com/stellar/stellar-protocol/blob/master/core/cap-0038.md |
| 186 | +[CAP-46-6]: https://github.com/stellar/stellar-protocol/blob/master/core/cap-0046-06.md |
| 187 | +[SEP-41]: https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0041.md |
| 188 | +[Stellar Asset Contract]: https://developers.stellar.org/docs/tokens/stellar-asset-contract |
| 189 | +[Liquidity Pools Guide]: https://developers.stellar.org/docs/learn/encyclopedia/sdex/liquidity-on-stellar-sdex-liquidity-pools |
| 190 | + |
| 191 | +## Copyright |
| 192 | + |
| 193 | +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). |
0 commit comments