Address-to-shard derivation
Every MultiversX address maps to exactly one shard. The Gateway computes the shard assignment locally using this process:- Decode the bech32 address (
erd1...) to its raw public key bytes. - Take the last byte of the public key.
- Compute
lastByte % numberOfShards. The mainnet currently runs 3 shards (0, 1, 2).
/address/{address}/shard endpoint returns the computed shard for any address without contacting an observer. This is a local computation that completes in microseconds.
Metachain
The metachain (shard ID4294967295) handles protocol-level operations. These endpoints target metachain observers:
- ESDT role queries:
/address/{address}/esdts-with-role/{role},/address/{address}/esdts/roles,/address/{address}/registered-nfts - Network economics:
/network/economics - Staking info:
/network/direct-staked-info,/network/delegated-info - Validator data:
/validator/statistics,/validator/auction - Hyperblocks:
/hyperblock/by-hash/{hash},/hyperblock/by-nonce/{nonce}
Observer selection
Within each shard, the Gateway selects observers using round-robin load balancing. This distributes requests evenly across all available observers in the target shard. If the primary observer fails, the Gateway falls back to backup observers marked as fallback in the configuration. For historical queries (requests withblockNonce, blockHash, or similar parameters), the Gateway skips snapshotless observers that lack full history. The Gateway prefers full-history observers for block and hyperblock queries to ensure data availability.
Fan-out patterns
Some endpoints query multiple shards in parallel and aggregate the results:
These fan-out requests run concurrently across shards. The Gateway merges the results into a single response.
The forced-shard-id override
Add?forced-shard-id={shardId} to any request to bypass automatic shard routing and direct the request to a specific shard observer.

