ens:register
Register a .eth name via the controller's commit/reveal flow (commits, waits and reveals in one go by default).
Smart blocks: build-time inputs only. Commitment hashing and rent quotes require concrete registration inputs.
Syntax
Section titled “Syntax”ens:register <name> <owner> <duration>Arguments
Section titled “Arguments”| Name | Type | Evaluation | Description |
|---|---|---|---|
name | string | Build time | .eth name or label (e.g. mydao.eth or mydao) |
owner | address | Build time | Owner of the name |
duration | number | Build time | Registration duration, in time units (e.g. 1y) |
Options
Section titled “Options”| Name | Type | Evaluation | Description |
|---|---|---|---|
--secret | bytes32 | Build time | Commitment secret; must be identical across the commit and reveal steps |
--resolver | address | Build time | Resolver to set at registration (defaults to the chain's Public Resolver) |
--reverse-record | bool | Build time | Also set the owner's primary ENS name |
--step | string | Build time | Which part of the flow to run: commit-wait-reveal (default), only-commit, only-reveal, only-commit-and-wait, only-wait-and-reveal |
Examples
Section titled “Examples”load ens
# Commit, wait ~60s and reveal in one script (default)ens:register mydao @me 1y --secret @hash("my registration secret") --resolver 0xF29100983E058B709F3D539b0c765937B804AC15 --reverse-record true
# Split the flow across two scripts (e.g. two DAO votes)ens:register mydao @me 1y --secret @hash("my registration secret") --step only-commitens:register mydao @me 1y --secret @hash("my registration secret") --step only-reveal- Registration is a commit/reveal flow. By default the command emits the commit transaction, a real-time wait for the controller's minimum commitment age (plus a small margin), and the reveal transaction. In fork simulations the wait is instant — the fork's clock is warped instead.
--stepselects which part runs:commit-wait-reveal(default),only-commit,only-reveal,only-commit-and-wait,only-wait-and-reveal. All steps must use identical arguments and--secret, otherwise the reveal won't find the commitment.- The reveal sends the rent price plus a 2% buffer; the controller refunds any excess.
--reverse-recordalso sets the owner's primary ENS name.
See Also
Section titled “See Also”- @ens:rentPrice — price a registration
- @ens:available — check availability first