Integrating decentralized domain name registration into your platform has never been easier. SPACE ID offers a powerful, developer-friendly solution for partners looking to provide seamless .bnb, .arb, and .eth domain registration directly within their applications. By leveraging the web3-name-sdk, developers can embed full-featured domain registration functionality using custom front-end interfaces—giving users a smooth, branded experience while unlocking new revenue opportunities.
Qualified partners can earn commission fees when users register .bnb and .arb domains through their integrated portals—making this not just a utility upgrade, but a monetization opportunity.
Whether you're building a wallet, DeFi platform, or NFT marketplace, adding web3 domain support enhances user identity, improves address readability, and strengthens your platform’s ecosystem.
Getting Started: SDK Installation
To begin integrating domain registration, install the @web3-name-sdk/register package alongside ethers.js v5. While ethers v6 introduces breaking changes, v5 remains stable and widely supported across current tooling.
Use npm or yarn to add the required dependencies:
npm install @web3-name-sdk/register [email protected]yarn add @web3-name-sdk/register [email protected]👉 Discover how easy it is to integrate web3 identity tools into your app today.
If you're using Next.js, ensure proper transpilation of CommonJS modules by updating your next.config.js:
const nextConfig = {
transpilePackages: ['@web3-name-sdk/register'],
}This configuration ensures compatibility and smooth bundling during build time.
Understanding the 3-Step Registration Process
Domain registration via the SDK follows a clear, three-step workflow designed for reliability and transparency:
- Check Availability
The first step validates whether the desired domain label (e.g.,mywallet) is available for registration under the target TLD (.bnb,.arb, or.eth). Fetch Registration Fee
Once confirmed available, the system calculates the registration cost based on two key factors:- Length of the domain label
- Chosen registration duration (in years)
This allows users to make informed decisions before committing funds.
- Execute Registration
After reviewing price and availability, users sign a transaction to finalize registration. The SDK handles all underlying smart contract interactions, including gas estimation and wallet approval prompts.
This streamlined process ensures a frictionless user journey—from search to ownership—without requiring deep blockchain expertise.
Code Implementation Examples
Registering a .bnb Domain
The following example demonstrates how to register a .bnb domain using Binance Smart Chain (BSC):
import SIDRegister from '@web3-name-sdk/register'
import { providers } from 'ethers'
async function registerDomain(label: String) {
if (window.ethereum) {
const provider = new providers.Web3Provider(window.ethereum)
// Switch to BSC
await provider.send('wallet_switchEthereumChain', [{ chainId: '0x38' }])
// Connect wallet
await provider.send('eth_requestAccounts', [])
const signer = provider.getSigner()
const address = await signer.getAddress()
// Initialize SDK
const register = new SIDRegister({ signer, chainId: 56 })
// Check availability
const available = await register.getAvailable(label)
if (!available) throw new Error('Domain unavailable')
// Get rental price for 1 year
const price = await register.getRentPrice(label, 1)
// Register with options
await register.register(label, address, 1, {
setPrimaryName: true, // Set as primary identity
referrer: 'partner.bnb' // Earn commission via referral
})
}
}Registering an .arb Domain on Arbitrum
For Arbitrum One integration:
const register = new SIDRegister({ signer, chainId: 42161 })
await provider.send('wallet_switchEthereumChain', [{ chainId: '0xA4B1' }])
const price = await register.getRentPrice(label, 1, {
setPrimaryName: true,
referrer: 'referral.bnb'
})
await register.register(label, address, 1)Note that referral commissions apply only to .bnb and .arb registrations when a valid referrer domain is specified.
Registering an .eth Domain (Ethereum Mainnet)
Ethereum-based .eth domains require an additional commitment step due to backend mechanics:
const register = new SIDRegister({ signer, chainId: 1 })
await provider.send('wallet_switchEthereumChain', [{ chainId: '0x1' }])
await register.register(label, address, 1, {
onCommitSuccess: (waitTime) => {
return new Promise(resolve => {
setTimeout(resolve, waitTime * 1000) // Wait 60 seconds
})
}
})👉 Start enabling users to claim their web3 identity now.
This callback ensures compliance with Ethereum’s registration delay rules, abstracting complexity from end users.
Key Concepts & Best Practices
- Label: Refers to the name portion before the TLD (e.g.,
aliceinalice.eth). Do not include the suffix during API calls. Chain IDs:
- BNB Chain:
56 - Arbitrum One:
42161 - Ethereum Mainnet:
1
- BNB Chain:
- Primary Name: When set (
setPrimaryName: true), the registered domain becomes the default display name across dApps using SPACE ID’s resolution SDK. - Referral System: Only applicable for
.bnband.arb. Revenue is sent to the Ethereum address linked to the referrer domain—ensure resolution is properly configured beforehand.
Frequently Asked Questions
Q: Can I use ethers.js v6 with the web3-name-sdk?
A: Not currently. Due to breaking changes in ethers v6, the SDK is built on v5 for stability and broad compatibility.
Q: How do I earn referral commissions?
A: Qualified partners can earn fees by setting a valid referrer domain (e.g., yourbrand.bnb) during .bnb or .arb registration. Earnings go to the resolved address of that domain.
Q: Why does .eth registration take longer?
A: Ethereum enforces a mandatory 60-second waiting period after commitment to prevent front-running. The SDK automates this with onCommitSuccess.
Q: Is there a minimum or maximum registration duration?
A: Domains can typically be registered for 1 to 10 years. Pricing scales with length and character count.
Q: Can I customize the user interface?
A: Yes! The SDK is headless—fully compatible with any UI framework or design system.
Q: Where can I find full SDK documentation?
A: Visit the official npm package page for detailed method references and updates.
👉 Unlock next-gen web3 identity features for your users now.
Final Thoughts
By integrating SPACE ID’s domain registration SDK, developers empower users to claim human-readable web3 identities across multiple chains—enhancing usability, security, and personalization. With built-in support for referrals and cross-chain functionality, this toolset is ideal for wallets, exchanges, and decentralized platforms aiming to deliver superior user experiences.
As digital identity becomes central to the decentralized web, early adoption of easy-to-integrate solutions like this positions your platform at the forefront of innovation.
Last updated: March 2025