L2ReverseRegistrar is a specialized reverse registrar designed for Layer 2 networks. It combines resolver and registrar functionality into a standalone contract that doesn’t require the ENS registry, making it efficient for L2 deployment.
Overview
The L2ReverseRegistrar provides reverse resolution capabilities on L2 networks with key features:- Standalone operation - Works without ENS registry dependency
- Signature-based setting - Enables gasless name updates via meta-transactions
- Multi-chain support - Unified validator addresses across L2s
- Contract ownership - Supports reverse records for Ownable contracts
Contract Details
Inherits:IL2ReverseRegistrar, ERC165, StandaloneReverseRegistrar
Key Storage:
coinType- Immutable coin type for the chain (derived from chain ID)
Constructor
The coin type for the chain this contract is deployed to, converted from the chain ID
Functions
setName
Sets the caller’s reverse record name.The ENS name to set for the caller’s address
msg.sender (automatically true)
Example:
setNameForAddr
Sets the reverse record name for a specific address (requires authorization).The address to set the reverse record for
The ENS name to set for the address
- The address itself (
addr == msg.sender), or - Owner of the contract at
addr(via Ownable pattern)
setNameForAddrWithSignature
Sets the reverse record name using a signature, enabling gasless transactions.The address to set the reverse record for
Unix timestamp when the signature expires (maximum 1 hour in the future)
The ENS name to set for the address
Array of coin types where this name should be set (must include this chain’s coin type)
EIP-191 signature from the address owner
- Mainnet:
0xa4a5CaA360A81461158C96f2Dbad8944411CF3fd - Testnet:
0xAe91c512BC1da8B00cd33dd9D9C734069e6E0fcd
- Signature must be valid for
addr signatureExpirymust be in the future but within 1 hourcoinTypesarray must include this chain’scoinType
setNameForOwnableWithSignature
Sets the reverse record for an Ownable contract using the owner’s signature.The contract address to set the reverse record for
The owner of the contract (signature will be verified against this address)
Unix timestamp when the signature expires (maximum 1 hour in the future)
The ENS name to set for the contract
Array of coin types where this name should be set (must include this chain’s coin type)
EIP-191 signature from the contract owner, supporting ERC-1271 and ERC-6492
- Mainnet:
0xa4a5CaA360A81461158C96f2Dbad8944411CF3fd - Testnet:
0xAe91c512BC1da8B00cd33dd9D9C734069e6E0fcd
contractAddrmust be a contractownermust be the owner ofcontractAddr(via Ownable pattern)- Signature must be valid for
owner(supports ERC-1271/ERC-6492) signatureExpirymust be in the future but within 1 hourcoinTypesarray must include this chain’scoinType
NotOwnerOfContract()- Ifowneris not the owner ofcontractAddrCoinTypeNotFound()- If this chain’s coin type is not incoinTypesarray
Multi-Chain Deployment
The L2ReverseRegistrar is designed to be deployed at the same address across multiple L2 networks. This enables powerful multi-chain capabilities:Unified Signatures
A single signature can authorize name changes across multiple L2s by including multiple coin types:Deployment Process
Consistent addresses are achieved through:-
Safe multisigs - Control deployment across chains
- Testnet:
0x343431e9CEb7C19cC8d3eA0EE231bfF82B584910 - Mainnet:
0x353530FE74098903728Ddb66Ecdb70f52e568eC1
- Testnet:
- CREATE3 - Deterministic deployment helper
- UniversalSigValidator - Dependency deployed alongside
Validator Address
The validator address (contract address) is embedded in signatures per EIP-191:- Mainnet:
0xa4a5CaA360A81461158C96f2Dbad8944411CF3fd - Testnet:
0xAe91c512BC1da8B00cd33dd9D9C734069e6E0fcd
Authorization Model
The contract uses a simple authorization model:Direct Calls
- Caller is the address itself, or
- Caller owns the contract at the address (via Ownable)
Signature-Based Calls
For signature-based functions:- EOA addresses: Standard ECDSA signature validation
- Contract addresses: ERC-1271 signature validation (with ERC-6492 support)
Coin Type Validation
ThevalidCoinTypes modifier ensures the chain’s coin type is included:
Integration Examples
Basic Usage
Gasless Meta-Transactions
Multi-Chain Name Setting
Safe/Multisig Contract Names
See Also
- ReverseRegistrar - L1 implementation
- Reverse Registrar Overview - Core concepts