Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article examines ERC-2390, which proposes geographic name resolution for ENS (Ethereum Name Service).
This article translates, summarizes, and supplements the material linked below.
I have also covered other EIPs.
Overview
GeoENS introduces the concept of geographic split-horizon resolution to ENS, enabling name resolution based on geographic information. This resembles GeoDNS in conventional DNS, where different IP addresses can be returned depending on geographic location.
ERC-2390 defines a new ENS resolver interface for returning different resource information, such as IP addresses or IPFS content hashes, according to geographic location. The proposal discusses DNS resource records defined by EIP-1185, and the approach can also be applied to other interfaces, such as IPFS content hashes defined by ERC-1062.
See the following article for EIP-1185.
[ERC-1185] Storing DNS Information in ENS
See the following article for ERC-1062.
[ERC-1062] Registering IPFS Hashes in ENS
Geohashes allow resources such as IP addresses, IPFS hashes, and smart contract addresses to be registered and retrieved by location, making ENS capable of GeoDNS-like resolution.
This enables services to return resources appropriate to a user's location or a specified region, supporting geographically aware decentralized websites, IoT applications, and local services.
Motivation
Conventional web services widely use GeoDNS systems such as Amazon Route 53 for purposes including:
- Directing requests to nearby content caches for load balancing.
- Delivering region-specific content according to language or legal requirements.
Conventional ENS resolution does not provide geographic resolution of this kind. For example, ERC-1185 allows ENS to return IP addresses, but does not specify which geographic region an address serves.
GeoENS addresses this limitation and opens up several possibilities:
- Discovering smart contracts and digital resources associated with physical locations.
- Access control for physical objects at particular locations.
- Geographic and language-specific web hosting using ENS and IPFS.
- Issuing tokens associated with physical locations.
Compared with conventional GeoDNS, GeoENS offers the following properties:
- Queries directly include location information, avoiding dependence on GeoIP databases that infer location from IP addresses.
- Queries can target arbitrary locations, not only the user's own location.
- Multiple resources, such as a list of IP addresses, can be retrieved within a geographic region.
- Geohashes of up to eight characters allow geographic resolution at approximately ±20-meter precision, depending on location.
These properties enable flexible geographic name resolution through decentralized ENS infrastructure.
Specification
ERC-2390 proposes a new ENS resolver interface for storing and retrieving geospatial information on-chain.
Its primary target is the address resolver defined by EIP-137, but the concept can be applied to other resource types, including DNS records under EIP-1185 and IPFS content hashes under EIP-1062.
See the following article for EIP-137.
[ERC-137] Understanding the Ethereum Name Service
What Is a Geohash?
A geohash interleaves bits representing latitude and longitude and encodes them as a Base32 string.
Longer strings represent smaller geographic cells. An eight-character geohash provides approximately ±20-meter precision, varying with latitude and cell dimensions.
Interface
setGeoAddr
function setGeoAddr(bytes32 node, string calldata geohash, address addr) external authorised(node)Registers a resource address for a specified ENS node and geohash. The proposal uses fixed eight-character geohashes for precise resource registration and requires the relevant address association to be unique.
To remove a resource, set its address to address(0).
geoAddr
function geoAddr(bytes32 node, string calldata geohash) external view returns (address[] memory ret)Retrieves all resource addresses matching the specified ENS node and geohash.
An eight-character geohash selects its corresponding geographic cell. A shorter geohash, such as three to seven characters, allows resources in a larger rectangular region to be retrieved together.
Implementation Notes
Alternative spatial indexing schemes, such as Z-order curves, Hilbert curves, or Google's S2 geometry library, may also be considered in designs based on this concept.
Geohash queries fundamentally identify rectangular regions. Multiple geohashes can be combined to approximate circular regions, although this requires several queries and additional implementation logic.
GeoENS thus provides a flexible mechanism for geographically aware name resolution and resource management using ENS.
Additional Notes
Storing and Retrieving IPFS Hashes
To reference IPFS content through ENS, an IPFS content identifier can be stored in a smart contract. The legacy approach described here converts a Base58-encoded identifier into bytes represented in hexadecimal for contract interaction.
The ENS public resolver interface discussed in the original ERC-1062 example provides two methods for storing and retrieving IPFS hashes.
function setMultihash(bytes32 node, bytes hash) public only_owner(node);This function stores the converted IPFS hash for the specified ENS node.
function multihash(bytes32 node) public view returns (bytes);This function retrieves the stored hash. It can then be converted back into Base58 to access the associated IPFS content.
These are historical ERC-1062 examples; they should not be confused with the interface used by every current ENS resolver.
Test Cases
The JavaScript multihashes library can convert IPFS multihashes between Base58 and hexadecimal representations.
Library:
https://www.npmjs.com/package/multihashes
Base58 to Hexadecimal
import multihash from 'multihashes'
export const toHex = function(ipfsHash) {
let buf = multihash.fromB58String(ipfsHash);
return '0x' + multihash.toHexString(buf);
}This function accepts a Base58-formatted IPFS identifier and converts it into a hexadecimal string suitable for the ENS example. The result is passed to setMultihash for on-chain storage.
Hexadecimal to Base58
import multihash from 'multihashes'
export const toBase58 = function(contentHash) {
let hex = contentHash.substring(2) // '0x'を除去
let buf = multihash.fromHexString(hex);
return multihash.toB58String(buf);
}This function converts the hexadecimal hash retrieved from multihash back into Base58, enabling access to the associated IPFS content.
These conversions facilitate integration between ENS and IPFS and allow developers to reference decentralized websites and other resources on Ethereum.
Reference Implementation
The article discusses a browser extension as an example use case for GeoENS and IPFS-enabled ENS resources.
Such an extension allows users to enter an ENS name to access decentralized web resources, including websites hosted on IPFS.
The objective is to address the lack of native access to ENS websites in ordinary browsers, offering a DNS-like experience without requiring extensive configuration or specialized knowledge.
Implementation Repository
The original article references the following repository.
It includes ENS name resolution, IPFS hash retrieval and display, and functionality for accessing ENS websites through the browser's address bar.
Main Features
- Enter
.ethnames in the browser address bar. - Automatically resolve IPFS hashes retrieved through ENS.
- Display decentralized websites hosted on IPFS similarly to conventional websites.
- Install the browser extension through a straightforward setup process.
Citation
Phyrex Tsai phyrex@portal.network, Portal Network Team, "ERC-1062: Formalize IPFS hash into ENS(Ethereum Name Service) resolver [DRAFT]," Ethereum Improvement Proposals, no. 1062, May 2018. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-1062.
The citation in the Japanese source concerns ERC-1062 rather than ERC-2390. The ERC-2390 specification is linked at the beginning of the article.
Conclusion
ERC-2390 proposes adding geographically aware name resolution to ENS through GeoENS.
If you have questions, feel free to contact me on Twitter.
I also publish articles on the following platforms.



