← Protocols
MultiversX
01Description

MultiversX (formerly Elrond) is a sharded L1 with adaptive state sharding and a WASM smart-contract VM. `@multiversx/sdk-core` is the canonical TS/JS SDK for building, signing, and broadcasting transactions; `@multiversx/sdk-dapp` bundles wallet connectors (xPortal, Web Wallet, Ledger, WalletConnect) for React dapps.

02Best for
  • 01MultiversX dapps and ESDT token issuance
  • 02xPortal / Web Wallet / Ledger auth on MultiversX
  • 03WASM smart contracts (Rust mx-sdk-rs)
  • 04high-throughput sharded payments
  • 05guarded accounts and meta-transactions
03Install
  • pnpm add @multiversx/sdk-core @multiversx/sdk-network-providers @multiversx/sdk-dapp
04Environment variables
VariableScopeDescription
NEXT_PUBLIC_MVX_NETWORKClient`mainnet`, `devnet`, or `testnet` — selects API and chain ID.
NEXT_PUBLIC_MVX_API_URLClientMultiversX API endpoint, e.g. https://api.multiversx.com (mainnet) or https://devnet-api.multiversx.com.
NEXT_PUBLIC_MVX_GATEWAY_URLClientMultiversX gateway (proxy) endpoint, e.g. https://gateway.multiversx.com — used for low-level chain queries.
05Prompt snippet
Use `@multiversx/sdk-core` for tx construction and `@multiversx/sdk-dapp` for wallet UX. Build transactions with the factory pattern: `new TransferTransactionsFactory({ config }).createTransactionForNativeTokenTransfer({ sender, receiver, nativeAmount })` or `createTransactionForESDTTokenTransfer({...})`, then sign via the connected provider (`useGetAccountProvider()`) and broadcast through `ApiNetworkProvider` or `ProxyNetworkProvider`. For contract calls use `SmartContractTransactionsFactory` and decode results with `ResultsParser`. The `sdk-dapp` `<DappProvider>` exposes hooks like `useGetAccount()`, `useGetActiveTransactionsStatus()`, and `sendTransactions()` so the React tree never touches private keys directly.
06Gotchas
  • MultiversX is the rebrand of Elrond — many older packages live under `@elrondnetwork/*` and are deprecated; always use `@multiversx/*`. Mixing the two causes duplicate deps and signature mismatches.
  • The chain has 3 shards plus the metachain — cross-shard transactions are asynchronous and only finalize after the destination shard's notarization (typically 2 rounds, ~12s); a `success` status from the source shard is not final.
  • Native gas is EGLD; ESDT (fungible) and SFT/NFT tokens are first-class but transfers use a special `ESDTTransfer`/`MultiESDTNFTTransfer` builtin function, not a separate contract — fee estimation differs from EVM ERC-20 patterns.
  • Account nonces are per-shard and per-account; the SDK's `recallNonce()` must be called before each broadcast or you'll get `lower nonce in transaction` errors when sending bursts.
  • Address format is bech32 (`erd1...`) — converting to/from hex requires `Address.fromBech32(...)` / `.toHex()`; passing raw hex to APIs that expect bech32 is silently truncated.
  • Smart contract arguments are hex-encoded big-endian and typed (BigUInt, ManagedBuffer, …); use `Argument`/`AbiRegistry` from sdk-core rather than hand-rolling encodings.
07Alternatives