# CAIP Standards ## Overview Vilna API implements Chain Agnostic Improvement Proposals (CAIP) for consistent cross-chain identification. These standards provide a universal way to identify blockchains, accounts, and assets across different blockchain ecosystems. ## CAIP-2: Blockchain Identification Provides a way to identify any blockchain in a human-readable, developer-friendly format. ### Format ``` : ``` ### Components - **namespace**: Identifies the blockchain namespace (e.g., `eip155` for EVM chains, `bip122` for Bitcoin) - **reference**: Chain-specific identifier (chain ID for EVM, genesis block hash for Bitcoin) ### Examples #### EVM Chains - `eip155:1` - Ethereum Mainnet - `eip155:56` - BNB Smart Chain (BSC) - `eip155:137` - Polygon - `eip155:43114` - Avalanche C-Chain - `eip155:42161` - Arbitrum One - `eip155:10` - Optimism #### Non-EVM Chains - `bip122:000000000019d6689c085ae165831e93` - Bitcoin Mainnet - `bip122:00000000001a91e3dace36e2be3bf030` - Dogecoin - `cosmos:cosmoshub-4` - Cosmos Hub - `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` - Solana Mainnet ## CAIP-10: Account Identification Identifies blockchain accounts across different chains with a unified format. ### Format ``` : ``` ### Components - **blockchain_gid**: CAIP-2 blockchain identifier - **account_address**: Chain-specific address format ### Examples #### Ethereum Accounts ``` eip155:1:0x742d35Cc6634C0532925a3b844Bc9e7595f7B123 ``` #### Bitcoin Accounts ``` bip122:000000000019d6689c085ae165831e93:1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa ``` #### Solana Accounts ``` solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM ``` ## CAIP-19: Asset Identification Provides a universal way to identify any digital asset on any blockchain. ### Format ``` /: ``` ### Components - **blockchain_gid**: CAIP-2 blockchain identifier - **asset_namespace**: Type of asset (`slip44` for native, `erc20`/`erc721` for tokens) - **asset_reference**: Asset-specific identifier ### Asset Types #### Native Currencies Use `slip44` namespace with the coin type from SLIP-44 registry: ``` /slip44: ``` **Examples:** - `eip155:1/slip44:60` - ETH on Ethereum - `eip155:56/slip44:60` - BNB on BSC - `eip155:137/slip44:60` - MATIC on Polygon - `bip122:000000000019d6689c085ae165831e93/slip44:0` - BTC on Bitcoin #### ERC-20 Tokens Use `erc20` namespace with the contract address: ``` /erc20: ``` **Examples:** - `eip155:1/erc20:0xdAC17F958D2ee523a2206206994597C13D831ec7` - USDT on Ethereum - `eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48` - USDC on Ethereum - `eip155:56/erc20:0x55d398326f99059fF775485246999027B3197955` - USDT on BSC #### NFTs (ERC-721) Use `erc721` namespace with the contract address and token ID: ``` /erc721:/ ``` **Example:** - `eip155:1/erc721:0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D/101` - BAYC #101 ## Transaction GID (Vilna Extension) Vilna extends CAIP standards to provide transaction identification. ### Format ``` : ``` ### Components - **blockchain_gid**: CAIP-2 blockchain identifier - **transaction_hash**: Native transaction hash ### Examples - `eip155:1:0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef` - Ethereum transaction - `eip155:56:0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890` - BSC transaction - `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:3Ux7YJz3Fqx8hKzJH...` - Solana transaction ## Benefits 1. **Universal Identification**: One format works across all blockchains 2. **No Ambiguity**: Each identifier is globally unique 3. **Human Readable**: Easy to understand and debug 4. **Tool Agnostic**: Works with any blockchain tool or service 5. **Future Proof**: Extensible for new blockchains and asset types ## References - [CAIP-2 Specification](https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md) - [CAIP-10 Specification](https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md) - [CAIP-19 Specification](https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-19.md) - [SLIP-44 Registry](https://github.com/satoshilabs/slips/blob/master/slip-0044.md) *CAIP standards ensure consistent asset identification across all supported blockchains.*