Validate addresses and memos locally
multichain-memo-address-validator is AllSwap's open source (MIT) address checker. It tells you whether a mainnet address is well formed for its chain, whether its checksum is right, which common mistake it shows, and whether that kind of address usually needs a memo or destination tag at an exchange. It has no dependencies, makes no network calls and needs no API key. It runs in Node.js 20 or later and in browsers.
It checks the text of an address only. It cannot tell whether an address exists on chain, who controls it, or whether funds sent to it could be recovered, and it does not check memo text.
Install
npm install multichain-memo-address-validatorThe package is an ES module with TypeScript types included. Import it with import; there is no CommonJS build.
Check your first address
isValidAddress(chain, address) answers yes or no. inspectAddress(chain, address) returns a small report. Both are async. Save this as check.mjs next to the installed package:
import { inspectAddress, isValidAddress } from "multichain-memo-address-validator";
const address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
console.log(await isValidAddress("eth", address));
console.log(await inspectAddress("eth", address));node check.mjstrue
{
valid: true,
family: 'evm',
checksum: 'verified',
pitfall: 'none',
memoSensitive: false
}The address is mixed case, so the package verified its EIP-55 checksum. The first argument names the chain: a short name such as eth or a CAIP-2 chain ID such as eip155:1 (see Chain names).
Read the result
For a chain it recognizes, inspectAddress returns an object with five fields:
Scroll the table sideways to view more columns.
| Field | Type | Description |
|---|---|---|
validrequired | boolean | true when the address passes the format and checksum rules of its chain. |
familyrequired | string | The address family the chain name resolved to: evm, btc, ltc, doge, bch, zec, sol, tron, near, ton, xrp or stellar. |
checksumrequired | string | What the checksum check found; values below. |
pitfallrequired | string | The common mistake detected, or none; values below. |
memoSensitiverequired | boolean | true for families where exchanges and other shared accounts usually need a memo or destination tag besides the address (near, ton, xrp, stellar). It describes the chain, not this address. |
For a chain name it does not recognize, inspectAddress returns null and isValidAddress returns false. Treat null as “not checked”, not as “invalid”.
checksum values
Scroll the table sideways to view more columns.
| Value | Meaning |
|---|---|
verified | The address carries a checksum and it matches. |
unchecked-case | An EVM address written all in lowercase or all in uppercase. It is valid, but there is no checksum to catch a typo. |
invalid-checksum | The address carries a checksum and it does not match (an EVM address in mixed case, or a Stellar key). |
not-applicable | The format has no checksum (Solana, NEAR, raw TON 0:…), or the address was refused before a checksum could be checked. |
skipped | A Base58Check checksum could not be computed because Web Crypto (crypto.subtle) is unavailable; valid then reflects the format only. Node.js 20 or later and browsers on HTTPS pages provide it. |
pitfall values
Scroll the table sideways to view more columns.
| Value | Meaning |
|---|---|
none | No problem found. |
empty | The address is empty. |
whitespace | The address has spaces or line breaks, often left by copy and paste. |
evm-zero-address | The EVM zero address 0x000…000, which nobody controls. |
evm-bad-checksum | An EVM address in mixed case whose EIP-55 checksum does not match: most likely a typo. |
ltc-legacy-3-prefix | A Litecoin address starting with 3. Bitcoin uses the same prefix, so the package refuses it; ask for the M… or ltc1… form. |
bch-legacy-base58 | A Bitcoin Cash address in the legacy 1… or 3… form; only CashAddr (bitcoincash:q… or p…) is accepted. |
xrp-x-address | An XRP X-address, which packs the destination tag into the address; ask for the classic r… address and the tag separately. |
ton-testnet-or-masterchain | A TON testnet address (kQ… or 0Q…) or a masterchain address (-1:…); only basechain mainnet addresses are accepted. |
zec-shielded-unsupported | A shielded or unified Zcash address (zs1…, u1…, zc…); only transparent t1… and t3… addresses are accepted. |
invalid-format | Anything else that does not match the chain's format or checksum. |
Common cases
This script runs the mistakes that come up most often when users paste a recipient address:
import { inspectAddress } from "multichain-memo-address-validator";
const cases = [
// One letter in the wrong case breaks the EIP-55 checksum
{ label: "EVM, one case typo", chain: "eth", address: "0xd8da6BF26964aF9D7eEd9e03E53415D37aA96045" },
// All lowercase is valid, but there is no checksum to verify
{ label: "EVM, all lowercase", chain: "eth", address: "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" },
// A classic XRP address; an exchange deposit usually also needs a destination tag
{ label: "XRP, classic r...", chain: "xrp", address: "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh" },
// An X-address packs the tag into the address; it is refused
{ label: "XRP, X-address", chain: "xrp", address: "X7AcgcsBL6XDcUb289X4mJ8djcdyKaB5hJDWMArnXr61cqZ" },
// A user-friendly TON address on the basechain; exchanges usually need a memo
{ label: "TON, EQ...", chain: "ton", address: "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs" },
// A legacy 3... address collides with Bitcoin P2SH; it is refused
{ label: "Litecoin, legacy 3...", chain: "ltc", address: "3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy" },
// The native SegWit form is accepted
{ label: "Litecoin, ltc1...", chain: "ltc", address: "ltc1qw508d6qejxtdg4y5r3zarvary0c5xw7kgmn4n9" },
// A trailing newline from copy and paste
{ label: "Tron, trailing newline", chain: "tron", address: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t\n" },
];
for (const { label, chain, address } of cases) {
const r = await inspectAddress(chain, address);
if (!r) continue;
console.log(
`${label.padEnd(23)} valid=${String(r.valid).padEnd(5)} checksum=${r.checksum.padEnd(16)} pitfall=${r.pitfall.padEnd(19)} memoSensitive=${r.memoSensitive}`,
);
}node cases.mjsEVM, one case typo valid=false checksum=invalid-checksum pitfall=evm-bad-checksum memoSensitive=false
EVM, all lowercase valid=true checksum=unchecked-case pitfall=none memoSensitive=false
XRP, classic r... valid=true checksum=verified pitfall=none memoSensitive=true
XRP, X-address valid=false checksum=not-applicable pitfall=xrp-x-address memoSensitive=true
TON, EQ... valid=true checksum=verified pitfall=none memoSensitive=true
Litecoin, legacy 3... valid=false checksum=not-applicable pitfall=ltc-legacy-3-prefix memoSensitive=false
Litecoin, ltc1... valid=true checksum=verified pitfall=none memoSensitive=false
Tron, trailing newline valid=false checksum=not-applicable pitfall=whitespace memoSensitive=false- EVM checksum. One letter in the wrong case makes a mixed-case address fail (
evm-bad-checksum). The all-lowercase form of the same address is valid butunchecked-case: a typo in it would go unnoticed, so prefer the checksummed form the wallet shows. - XRP and TON. Both addresses are valid and
memoSensitiveistrue. An X-address is refused withxrp-x-address. - Litecoin
3…. Refused withltc-legacy-3-prefix, because a Bitcoin P2SH address looks the same. The native SegWitltc1…form passes. - Whitespace. A trailing newline is reported as
whitespaceinstead of being trimmed silently. Trim the input or ask the user to fix it.
Memo-sensitive chains
On NEAR, TON, XRP and Stellar, an exchange or custodial wallet often gives every customer the same address and tells deposits apart by a memo or destination tag. A valid address with memoSensitive: true is a cue to ask whether a memo is needed. The package does not check the memo itself. AllSwap payouts do not attach a recipient memo or tag, so a swap's recipient on these chains should be a self-custody address.
Chain names
The first argument accepts short names and CAIP-2 chain IDs, so you can pass the chainId of an asset from AllSwap's public asset catalog as it is. resolveAddressFamily shows what a name resolves to:
import { inspectAddress, isValidAddress, resolveAddressFamily } from "multichain-memo-address-validator";
// Short aliases and CAIP-2 chain IDs both work
console.log(resolveAddressFamily("base"), resolveAddressFamily("eip155:8453"), resolveAddressFamily("tron:mainnet"));
// A chain the package does not cover
console.log(resolveAddressFamily("cardano"));
console.log(await inspectAddress("cardano", "addr1..."));
console.log(await isValidAddress("cardano", "addr1..."));node chains.mjsevm evm tron
null
null
falseWhen this guide was written, every chainId in the asset catalog resolved to a family. Still handle null: the catalog can add chains before the package covers them.
Supported families
Scroll the table sideways to view more columns.
| Family | Chain names | Accepted forms | Memo-sensitive |
|---|---|---|---|
evm | eth, base, bsc, arb, op, pol, avax, eip155:<id> | 0x<40 hex> | No |
btc | btc, bitcoin, bip122:000000000019d6689c085ae165831e93 | 1…, 3…, bc1q…, bc1p… | No |
ltc | ltc, litecoin, bip122:12a765e31ffd4059bada1e25190f6e98 | L…, M…, ltc1q…, ltc1p… | No |
doge | doge, dogecoin, bip122:1a91e3dace36e2be3bf030a65679fe82 | D…, 9…, A… | No |
bch | bch, bip122:000000000000000000651ef99cb9fcbe | bitcoincash:q…, bitcoincash:p… | No |
zec | zec, zcash, bip122:0007104ccda289427919efc39dc9e4d4 | t1…, t3… | No |
sol | sol, solana, solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp | <base58, 32 bytes> | No |
tron | tron, trx, tron:mainnet | T… | No |
near | near, near:mainnet | name.near, <64 hex>, 0x<40 hex> | Yes |
ton | ton, ton:mainnet | EQ…, UQ…, 0:<64 hex> | Yes |
xrp | xrp, ripple, xrpl, ripple:0 | r… | Yes |
stellar | stellar, xlm, stellar:public | G… | Yes |
TypeScript
The package ships src/index.d.ts with the types AddressInspectionResult, AddressFamily, ChecksumStatus and AddressPitfallCode. A typed helper that turns the report into a message:
import { inspectAddress, type AddressInspectionResult } from "multichain-memo-address-validator";
// null: this chain is not covered, so the address was not checked
async function describe(chain: string, address: string): Promise<string | null> {
const r: AddressInspectionResult | null = await inspectAddress(chain, address);
if (!r) return null;
if (!r.valid) return `rejected: ${r.pitfall}`;
return r.memoSensitive ? "valid; exchanges on this chain usually need a memo or tag" : "valid";
}
console.log(await describe("tron:mainnet", "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"));
console.log(await describe("ton:mainnet", "EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs"));
console.log(await describe("eip155:1", "0xd8da6BF26964aF9D7eEd9e03E53415D37aA96045"));
console.log(await describe("cardano", "addr1..."));node check-recipient.mtsvalid
valid; exchanges on this chain usually need a memo or tag
rejected: evm-bad-checksum
nullNode.js 22.18 or later runs a .mts file directly; on older versions use npx tsx check-recipient.mts or compile it with tsc.
Limits
- Mainnet only. Testnet addresses are refused.
- A valid result says the text is well formed. It does not prove the address belongs to the person you expect; for large amounts, a small test transfer is still the only proof.
- Some chains have no checksum (Solana, NEAR, raw TON
0:…); a typo there can still produce a valid-looking address.
Related
- Multichain Address & Memo Validator: the same rules in your browser, with no install. AllSwap's test suite checks that the website tool and the package give the same results on a shared set of test addresses.
- Read the public asset catalog: list the assets and chain IDs AllSwap supports, without a key.
- MCP server: let an AI assistant look up the asset catalog and official channels.
- multichain-memo-address-validator on npm