Account IDs (CAIP-10)
A plain address like 0xab16... does not identify which chain it belongs to. The same address can
exist on Ethereum, Polygon, and other EVM chains. In a multichain context, you need to know which
account on which chain the user authorized.
Account IDs solve this by combining a scope with an address. After a user connects, the session returns account IDs, so you know which chain each address belongs to.
Format and examples
An account ID uses namespace:reference:address format, as defined by
CAIP-10.
| Ecosystem | Example |
|---|---|
| EVM | eip155:1:0xab16a96D359eC26a11e2C2b3d8f8B8942d5Bfcdb |
| Solana | solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:7S3P4HxJpyyigGzodYwHtCxZyUQe9JiBMHyRWXArAaKv |
Account IDs appear in the sessionScopes returned by
getSession. To extract the address from a CAIP-10
account ID:
const accountId = 'eip155:1:0xab16a96D359eC26a11e2C2b3d8f8B8942d5Bfcdb'
const address = accountId.split(':')[2]