
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@unruggable/ens-7828-resolver
Advanced tools
A fully-featured TypeScript library for parsing, resolving and displaying EIP-7828-style human-readable, chain-specific ENS names
npm install
npx tsx test-resolver.js
Run these commands to install dependencies and quickly verify the library resolves EIP-7828 names across multiple chains.
A fully-featured TypeScript library for parsing, resolving and displaying EIP-7828-style human-readable, chain-specific ENS names.
This library implements the EIP-7828 specification for human-readable, chain-specific ENS names. It supports parsing and resolving names like:
alice.eth@basevitalik.eth@1bob.app.eth@optimismtest.eth@base#abcd1234npm install @unruggable-labs/ens-7828-resolver
import { resolve7828 } from "@unruggable-labs/ens-7828-resolver";
// Resolve an ENS name on a specific chain
const result = await resolve7828("vitalik.eth@ethereum");
console.log(result);
// {
// address: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
// chainId: 1,
// chainName: 'Ethereum Mainnet',
// caip10: 'eip155:1:0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
// coinType: 60
// }
resolve7828(input: string, options?: ResolveOptions): Promise<ResolvedAddress>Resolves an EIP-7828 formatted name to an address.
Parameters:
input: EIP-7828 formatted name (e.g., "alice.eth@base")options: Optional configuration
provider: ethers.js provider instancerpcUrl: RPC URL for the providerReturns: Promise resolving to ResolvedAddress
Example:
const result = await resolve7828("ndeto.eth@solana");
// {
// address: 'GwjiVpwPmfmh8T4EXqtsiuU1YoYknxAKLe6ujMDgLgmV',
// chainId: 'So11111111111111111111111111111111111111112',
// chainName: 'Solana',
// caip10: 'solana:So11111111111111111111111111111111111111112:GwjiVpwPmfmh8T4EXqtsiuU1YoYknxAKLe6ujMDgLgmV',
// coinType: 501
// }
parse7828Name(input: string): Parsed7828NameParses an EIP-7828 name without resolving it.
Parameters:
input: EIP-7828 formatted nameReturns: Parsed7828Name object
Example:
const parsed = parse7828Name("alice.eth@base#abcd1234");
// {
// ensName: "alice.eth",
// chainSpec: "base",
// checksum: "abcd1234"
// }
validate7828Name(input: string): booleanValidates an EIP-7828 name format.
Parameters:
input: EIP-7828 formatted nameReturns: boolean indicating if the name is valid
resolveChain(chainSpec: string): ResolvedChainResolves a chain specification to chain information.
Supported formats:
1, 8453, 10base, oeth, arb1ethereum, optimism, arbitrum, polygonFuture EIP-7785 Support:
base.l2.eth, optimism.l2.eth (planned)format7828Name(address: ResolvedAddress): stringFormats a resolved address as an EIP-7828 name string (e.g., <address>@<chainName>).
The library includes pre-compiled chain mappings for popular networks:
| Chain | Chain ID | Short Name | Display Name | Coin Type |
|---|---|---|---|---|
| Ethereum | 1 | eth | ethereum | 60 |
| Base | 8453 | base | base | 2147492101 |
| Optimism | 10 | oeth | optimism | 2147483658 |
| Arbitrum One | 42161 | arb1 | arbitrum | 2147525809 |
| Polygon | 137 | pol | polygon | 966 |
| BNB Smart Chain | 56 | bnb | bnb | 714 |
| Avalanche | 43114 | avax | avalanche | 9000 |
| Fantom | 250 | ftm | fantom | 250 |
| Celo | 42220 | celo | celo | 2147525868 |
| Chain | Short Name | Display Name | Coin Type | Namespace |
|---|---|---|---|---|
| Solana | solana | solana | 501 | solana |
| Bitcoin | bitcoin | bitcoin | 0 | bip122 |
# Chain ID format
alice.eth@1
vitalik.eth@8453
# Display name format
bob.eth@ethereum
test.eth@base
clowes.eth@solana
# Short name format
user.eth@oeth
app.eth@arb1
# Full CAIP-2 in chainSpec (not supported)
alice.eth@eip155:1
test.eth@solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d
# Invalid ENS name
invalid@1
no-at-symbol.eth
For the long-term vision of decentralized multi-chain ENS resolution—including how ERC-7930 and ERC-7785 mapping will work together, see ARCHITECTURE.md for details on the end-state and technical flow.
# Install dependencies
npm install
# Build the library
npm run build
# Run tests
npm test
To add a new EVM chain to the pre-populated list:
Edit scripts/chains.ts:
export const MAJOR_CHAINS = [
// ... existing chains
{ chainId: YOUR_CHAIN_ID, identifier: "your-chain" },
];
Regenerate chain mapping:
npm run prepare
To add a new non-EVM chain:
Edit scripts/chains.ts:
export const MANUAL_CHAINS: ChainInfo[] = [
// ... existing chains
{
chainId: "your-chain", // String identifier
shortName: "your-chain",
name: "Your Chain",
slip44: YOUR_COIN_TYPE, // From SLIP-44 standard
namespace: "your-namespace", // e.g., "solana", "bip122"
reference: "your-genesis-hash-or-identifier",
},
];
Regenerate chain mapping:
npm run prepare
The library uses the following rules for coin type derivation:
(chainId | 0x80000000) >>> 0 (i.e., 0x80000000 + chainId)Note: Coin type is always represented as a uint (unsigned integer), and is the value used by ENS contracts and multicoin records. For EVM chains, ENSIP-11 is the source of truth; for non-EVM chains, SLIP-44 is the source of truth.
MAJOR_CHAINS in scripts/chains.tsMANUAL_CHAINS in scripts/chains.tsnpm run prepare to update mappingstest-library.jsnpm run prepare && npm run build# Run the test suite
npx tsx test-resolver.js
MIT
FAQs
A fully-featured TypeScript library for parsing, resolving and displaying EIP-7828-style human-readable, chain-specific ENS names
We found that @unruggable/ens-7828-resolver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.