Skip to content

BrandynHamilton/domain-resolve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

domain_resolve

domain_resolve is a Python library and REST API that resolves human-readable Web3 domain names into blockchain addresses across multiple domain name systems:

  • .eth domains via ENS
  • .bnb, .arb, .sol, .lens, and 20+ others via SPACE ID
  • All other custom domains via 3DNS

The system can be used as a Python SDK, a Flask-powered HTTP service, or embedded in applications to resolve wallet addresses from domain names.


Features

  • Multi-system resolution: ENS, SPACE ID, 3DNS
  • REST API with GET/POST endpoints
  • Python client to interact with resolution service
  • Domain normalization and zero-address checks

Installation

pip install -e .

Make sure you also have a .env file:


Domain Resolution Priority

Resolution is attempted in this order:

  1. .eth → via ENS
  2. Known SPACE ID TLDs (e.g. .bnb, .arb, .sol) → via SpaceID API
  3. Fallback to → 3DNS resolver

Example CLI App

from domain_resolve import DomainResolveClient

domains = ["example.eth", "allen.bnb", "custom.3dns"]

client = DomainResolveClient()
for domain in domains:
    if client.does_resolve(domain):
        print(client.resolve_domain(domain))
        print(client.get_resolved_data(domain))

Flask API

Start the Flask server:

python app.py

Endpoints

POST /api/resolve

{
  "domain": "allen.bnb"
}

Response:

{
  "code": 0,
  "data": {
    "name": "allen.bnb",
    "address": "0x...",
    "chainID": 56,
    "errMsg": ""
  }
}

GET /api/resolve/<domain>

GET /api/resolve/example.eth

Supported TLDs (via SPACE ID)

Domain Chain ID
.bnb 56
.arb 42161
.sol 900
.manta 169
.mode 34443
.zfk 42766
.ll 1890
.zeta 7000
.merlin 4200
.gno 100
.taiko 167000
.alien 10241024
.mint 185
.ail 2649
.mph 2818
.duck 5545
.g 1625
.ip 1514
.inj 901
.sei 902
.lens 903
.crypto 904

Project Structure

domain_resolve/
├── utils.py                   # normalization helpers
├── services/
│   ├── ens.py                 # resolves ENS domains
│   └── three_dns.py          # resolves 3DNS domains
├── __init__.py                # exposes `get_resolved_address`
app.py                         # Flask server exposing resolve API

Environment Variables

DOMAIN_RESOLVE_URL=
THREEDNS_TOKEN_ADDRESS=

Credits

  • spaceid_py for SpaceID API wrapper
  • web3.py for ENS resolution
  • 3DNS team for custom domain resolution backend

About

Python library and REST API to resolve human-readable Web3 domain names

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages