How to Build a Multi-Chain Crypto Wallet Backend with RPC Nodes

blog_author_logo
GETBLOCK

May 25, 2026

9 min read

How to Build a Multi-Chain Crypto Wallet Backend with RPC Nodes

A crypto wallet is only as good as the data behind it. Users expect to open their wallet and see accurate balances instantly, across every chain they use, including tokens they received five seconds ago. They expect their transaction history to be complete. They expect sends to go through reliably. And they expect all of this to work the same whether they hold assets on Ethereum, Solana, Base, or all three.

Behind that seamless experience is a backend that constantly queries blockchains via RPC endpoints, checking balances, scanning for transfers, detecting new tokens, and submitting transactions.

This guide covers how to architect that backend for multi-chain support, real-time responsiveness, and scalable performance.

The Core Pattern: One Backend, Many Chains

Every multi-chain wallet follows the same fundamental architecture. A mobile or web app communicates with your backend server through REST or GraphQL endpoints. Your backend maintains a separate RPC connection for each supported blockchain, plus a caching layer (typically Redis) that reduces redundant RPC calls and keeps response times fast.

The key design principle is that your frontend never communicates directly with the blockchain. All RPC calls route through your backend. This serves two purposes: it keeps your API tokens secure (they never appear in client-side code) and provides a single layer for implementing caching, rate limiting, and error handling.

GetBlock supports over 130+ chains from a single dashboard, so you manage one set of API keys and one billing account, regardless of how many chains your wallet supports. This becomes a meaningful operational advantage as you add chains, and wallets always end up adding chains.

EVM Balance and Token Aggregation

The most fundamental wallet operation is showing the user what they own. On EVM chains, this means fetching the native token balance (ETH, MATIC, BNB, etc.) and then querying each known ERC-20 contract for the user's token balance.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

import { JsonRpcProvider, Contract, formatEther, formatUnits } from "ethers";
const ERC20_ABI = [
  "function balanceOf(address) view returns (uint256)",
  "function decimals() view returns (uint8)",
"function symbol() view returns (string)",
];
async function getWalletBalances(address, chainConfig) {
  const provider = new JsonRpcProvider(chainConfig.rpc);
 // Native balance (ETH, MATIC, BNB, etc.)
  const nativeBalance = await provider.getBalance(address);
  // Token balances from a known token list
  const tokenBalances = await Promise.all(
    chainConfig.tokens.map(async (tokenAddr) => {
      const contract = new Contract(tokenAddr, ERC20_ABI, provider);
      const [balance, decimals, symbol] = await Promise.all([
        contract.balanceOf(address),
        contract.decimals(),
        contract.symbol(),
      ]);
      return {
        token: tokenAddr,
        symbol,
        balance: formatUnits(balance, decimals),
      };
    })
  );
  return {
    chain: chainConfig.name,
    native: formatEther(nativeBalance),
    tokens: tokenBalances,
  };
}

The Promise.all pattern is critical here. For each token, you need three pieces of data: the balance, the decimal precision, and the symbol. Fetching these sequentially would triple your response time. Parallelizing them means making all three calls simultaneously and waiting for the slowest one, which is usually under 200ms on a good RPC endpoint.

Now scale this across all supported chains:

const chains = [
  { name: "Ethereum", rpc: "https://go.getblock.io/<ETH_TOKEN>/",
    tokens: [USDT, USDC, DAI] },
  { name: "Polygon",  rpc: "https://go.getblock.io/<POL_TOKEN>/",
    tokens: [USDT, USDC] },
  { name: "BSC",      rpc: "https://go.getblock.io/<BSC_TOKEN>/",
    tokens: [BUSD, USDT] },
  { name: "Base",     rpc: "https://go.getblock.io/<BASE_TOKEN>/",
    tokens: [USDC] },
  { name: "Arbitrum", rpc: "https://go.getblock.io/<ARB_TOKEN>/",
    tokens: [USDC, USDT] },
];
// Fetch all chains simultaneously
const allBalances = await Promise.all(
  chains.map((chain) => getWalletBalances(userAddress, chain))
);

Every chain query runs in parallel, so a five-chain balance check completes in the time it takes the slowest chain to respond, not five times that. This is the pattern that lets wallets show "all your assets" in under a second.

Ready to access blockchain data with flexible pricing? Sign up for GetBlock and start building with our RPC endpoints today.

Solana Token Portfolio

Solana works differently from EVM chains. Instead of querying individual token contracts, you fetch all SPL token accounts owned by a wallet in a single call. This is actually more efficient: a single RPC request returns everything.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

from solana.rpc.api import Client
from solders.pubkey import Pubkey

client = Client("https://go.getblock.io/<SOL_TOKEN>/")
def get_solana_portfolio(wallet_address: str):
    pubkey = Pubkey.from_string(wallet_address)
    # SOL balance
  sol_balance = client.get_balance(pubkey).value / 1e9
    # All SPL token accounts in one call
    token_accounts = client.get_token_accounts_by_owner(
        pubkey,
        {"programId": Pubkey.from_string(
            "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
)},
        encoding="jsonParsed",
)
tokens = []
    for account in token_accounts.value:
        info = account.account.data.parsed["info"]
        tokens.append({
            "mint": info["mint"],
            "amount": info["tokenAmount"]["uiAmountString"],
            "decimals": info["tokenAmount"]["decimals"],
        })
    return {"sol": sol_balance, "tokens": tokens}

The getTokenAccountsByOwner call with jsonParsed encoding returns pre-parsed token data, including the mint address, balance, and decimal precision. On EVM chains, you'd need a separate balanceOf call for every token on Solana, one call covers everything. This architectural difference is worth understanding because it affects your caching strategy and CU budget calculations.

Real-Time Balance Updates with WebSockets

Nobody wants to manually refresh their wallet to see a new transfer. WebSocket subscriptions let your backend receive transfer events as soon as they occur on-chain, so you can push updates to the user's app immediately.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

const { WebSocketProvider, ethers } = require("ethers");
const wsProvider = new WebSocketProvider(
  "wss://go.getblock.io/<YOUR_ACCESS_TOKEN>/"
);

// Listen for any ERC-20 transfer TO the user's address
const incomingFilter = {
  topics: [
    ethers.id("Transfer(address,address,uint256)"),
    null,                  // from: any sender
    ethers.zeroPadValue(userAddress, 32),  // to: this user
],
};
wsProvider.on(incomingFilter, (log) => {
  const decoded = erc20Interface.parseLog(log);
  notifyUser({
   type: "incoming_transfer",
    token: log.address,
    from: decoded.args.from,
    amount: decoded.args.value.toString(),
  });
  // Trigger a balance refresh in the UI
refreshBalance(log.address);
});

This is the pattern behind the "You received 100 USDC" push notification that appears seconds after someone sends you tokens. The WebSocket filter is scoped to the specific user's address, so you're only receiving events relevant to that wallet — not every Transfer event on the network.

For a wallet with many users, you'd run one WebSocket connection per chain that monitors a broad set of addresses, then route incoming events to the right user session. This is more efficient than maintaining a separate WebSocket subscription per user.

Caching: The Most Important Optimization

Wallets generate an enormous number of repeated queries. A user opens the app, sees their balances, switches to another app, comes back, and sees their balances again; that's two identical sets of RPC calls within seconds. Without caching, every app open triggers a full balance refresh across all chains.

1

2

3

4

5

6

7

8

9

10

11

12

13

import Redis from "ioredis";
const redis = new Redis();
async function getBalanceCached(address, chain) {
  const cacheKey = `balance:${chain}:${address}`;
  // Check cache first (15-second TTL for active users)
  const cached = await redis.get(cacheKey);
  if (cached) return JSON.parse(cached);
  // Cache miss: fetch from RPC
  const balance = await fetchBalance(address, chain);
  // Store in cache
  await redis.set(cacheKey, JSON.stringify(balance), "EX", 15);
  return balance;
}

A 15-second TTL on balance data is a reasonable default. It means balances update within 15 seconds of any on-chain change (and faster if your WebSocket listener triggers an immediate cache invalidation on incoming transfers). Most users won't notice a 15-second lag, and the RPC savings are dramatic. If a user checks their balance 10 times in a minute, you make one RPC call instead of 10.

For less time-sensitive data like transaction history, you can cache for longer, 60 seconds or more. For highly dynamic data like gas prices, cache for at most 5 seconds.

Security: Keep Your RPC Tokens on the Server

This is non-negotiable. Your RPC endpoint tokens must never appear in frontend code not in JavaScript bundles, not in mobile app binaries, not in environment variables that get compiled into the client.

The correct pattern is simple: your frontend calls your backend API, and your backend calls GetBlock's RPC endpoints. The API token lives on your server and never leaves it.

1

2

3

4

5

6

7

8

9

10

11

12

13

❌ Frontend → GetBlock RPC directly (token exposed in browser)
✅ Frontend → Your Backend API → GetBlock RPC (token stays on server)

Additionally, rate-limit your own backend API to prevent abuse. Without rate limiting, a single malicious user or bot can burn through your entire monthly RPC budget in hours:

import rateLimit from "express-rate-limit";

const limiter = rateLimit({

  windowMs: 60 * 1000,  // 1-minute window
  max: 60,              // 60 requests per minute per IP
});
app.use("/api/", limiter);

Always validate wallet addresses on the server side before making RPC calls, too. An invalid address means a wasted RPC call, and at scale, malformed inputs from bots can add up to real CU costs.

Deploying Globally for Low Latency

Wallet users are everywhere. A user in Singapore shouldn't wait 200ms for a round trip to a Frankfurt server when checking their balance. The solution is to deploy your wallet backend across multiple regions, each connected to a geographically close GetBlock endpoint.

GetBlock operates RPC infrastructure in three regions: Frankfurt, New York, and Singapore- covering the major user geographies. Your deployment architecture looks like this: EU users hit your EU backend, which connects to GetBlock Frankfurt; US users hit your US backend, which connects to GetBlock New York; and Asia-Pacific users hit your APAC backend, which connects to GetBlock Singapore.

This multi-region setup reduces round-trip latency from hundreds of milliseconds to tens of milliseconds for most users worldwide. For a wallet, where every interaction starts with a balance check, shaving 150ms off every request makes the app feel noticeably snappier.

Scaling With Your User Base

Wallet infrastructure scales predictably with user count because the per-user RPC footprint is fairly consistent. Each user session typically involves balance checks across several chains, a few transaction history queries, and the occasional send.

At the hobby stage, a few hundred daily active users — GetBlock's free tier handles everything. As you grow into thousands of daily users, the Starter plan provides the headroom you need. At tens of thousands of daily users, the Advanced plan keeps pace. And once you're building a serious consumer wallet with hundreds of thousands or millions of users, dedicated nodes and enterprise-tier support ensure that your infrastructure meets your users' expectations.

The most important thing at every stage is the caching layer. A well-implemented cache can reduce your actual RPC call volume by 80–90%, which means your effective capacity is 5–10x higher than your raw plan limits suggest. Build the caching layer early — it's far easier to add at 1,000 users than to retrofit at 100,000.

Conclusion

Building a multi-chain wallet backend is fundamentally about two things: querying multiple blockchains efficiently and presenting that data to users with minimal latency. The RPC operations themselves, balance checks, token queries, transfer monitoring, and transaction submission are well-standardized across chains. The challenge is orchestrating them across five, ten, or twenty chains simultaneously while keeping response times under a second.

GetBlock's multi-chain support from a single dashboard, three-region global deployment, and plans that scale from free to enterprise make it a natural fit for wallet infrastructure at every stage of growth.

Ready to start building? Get your free API key and connect your wallet to 100+ blockchains.

blog_author_logo
GETBLOCK

May 25, 2026

9 min read

twittertwittertelegramtelegramLinkedinLinkedin