Deploy Your Own dotNS Instance¶
Introduction¶
dotNS is published as source in the paritytech/dotns repository. Parity does not deploy it: every dotNS registry, including the ones on public networks, is an instance someone deployed from that source with their own parameters. See One Deployment per Network for what that means for names and deposits.
This page deploys the full contract set to a local Revive Dev node through its Ethereum JSON-RPC adapter, explains which values you choose as the deployer, and shows how to point the dotNS CLI at the result. The same pipeline targets any chain that runs pallet-revive and exposes an ETH-RPC adapter; the repository's DEPLOYMENT_CHECKLIST.md covers remote chains.
Unaudited reference code
The dotNS repository describes its code as unaudited and experimental, provided for research, experimentation, and developer education. Before you deploy it for real use, review the code, check its dependencies, and secure your own keys and environment, as the repository's Security section describes.
Prerequisites¶
Before you start, make sure you have the following:
- A running Revive Dev node and ETH-RPC adapter, with the adapter listening at
http://127.0.0.1:8545. Follow Local Development Node to build and start both. - Foundry, for
forgeandcast. - Bun 1.2.6 or later, which runs the deploy pipeline.
- Git.
The repository's own checklist also lists Docker. Docker runs a containerized ETH-RPC adapter for remote chains; with the local adapter from the dev node guide you do not need it.
Get the Source¶
Clone the repository and check out a release tag. This page uses v1.1.0:
bun install also runs setup.bash, which fetches the pinned Solidity dependencies (forge-std and the OpenZeppelin libraries) into lib/.
Deploying from a release tag matters: the last pipeline stage declares the release on chain as protocolVersion() on the protocol registry, and the runner reads it from the tag the checkout sits on. From any other commit, export DOTNS_RELEASE_TAG (bare semver such as 1.1.0), or the run aborts before deploying anything.
Choose the Deployment Parameters¶
A dotNS instance has a handful of values its deployer decides. Some are fixed at deploy time, some can be changed afterwards by the contract owner, and some need a Substrate Root origin:
| Parameter | Where it is set | Default in v1.1.0 | Changing it later |
|---|---|---|---|
| TLD | DOTNS_TLD in .env | dot in .env.example | Not possible. The protocol registry is initialized with it and has no setter. |
| Registration deposit | BASE_DEPOSIT in contracts/utils/DotnsConstants.sol, passed to the DotnsFlatPricing constructor | 10 ether (10 tokens at the 18-decimal EVM scale) | Deploy a new pricing model and register it on DotnsCostModelRegistry with register, or switch versions with setCurrentVersion. Both are owner-only. |
| Release cooldown | ESCROW_COOLDOWN in DotnsConstants.sol | 15 minutes | updateCooldown on DotnsNameEscrow. |
| Redeem window | ESCROW_REDEEM_WINDOW in DotnsConstants.sol | 1 day | updateRedeemWindow on DotnsNameEscrow. |
| Short-name switch | PopRules state | Off | setShortNamesEnabled(bool) on PopRules, Root origin only. |
| Name whitelist limits | Defaults in DotnsConstants.sol | See the source | Setters on DotnsNameWhitelist, Root origin only. |
Pick the TLD before you deploy, because a wrong TLD can only be fixed by deploying again. The TLD is a bare label without the leading dot, such as dot, paseo, or test. To deploy with a different deposit amount, edit BASE_DEPOSIT before you build. For what the deposit, the length bands, and the short-name switch do, see PopRules and Pricing and Escrow and Deposits.
Configure the Deployer¶
The pipeline signs with a Foundry keystore account. On the first run it imports a private key from a one-off .env file into the keystore, then deletes .env after a successful deploy.
-
Create the bootstrap file:
-
Set these values in
.env:PRIVATE_KEY: A funded key on the target chain. The Revive Dev node's development genesis funds and maps the Alith development account, whose private key is0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133(thealithkey in thesubxt-signercrate'seth::devmodule). Use it on a local dev node only.ACCOUNT_PASSWORD: Any password. It encrypts the imported keystore account.RPC_URL: Leave it aspaseo_local. The alias resolves tohttp://127.0.0.1:8545infoundry.toml, which is the local adapter.-
DOTNS_TLD: The bare TLD label for your instance. -
DEPLOYMENT_NETWORK: Set it topaseo-local, the manifest folder the pipeline uses for the Revive Dev node's chain ID420420420, or to another folder name of your choice.
Do not leave
DEPLOYMENT_NETWORKempty. The runner treats an empty value as unset and falls back to the chain-ID folder, butforgeloads.envitself and the deploy scripts read the empty string, so they write the manifest todeployments//. The runner then stops withManifest missing after stageand restores the previous manifest.
Build, Test, and Deploy¶
-
Build the contracts and run the tests that do not need a live chain:
-
Run the deploy pipeline with the runner script, passing
--skip-simulationthrough to eachforge scriptstage:bun run deployruns the same script without extra flags. Onpallet-revive, a transaction costs far more gas than Foundry's local EVM simulation predicts, so with simulation the stages send gas limits the node rejects withInvalid Transaction(error1010). With--skip-simulation, Foundry takes each transaction's gas limit from the node'seth_estimateGasinstead.The runner imports the key, then runs five stages in order, each as a separate
forge scriptinvocation:DeployCore,DeployRecords,DeployPolicy,DeployPopSystem, andWireDeployments. After each stage it checks that every address in the manifest has bytecode; on a failure it restores the previous manifest and stops. A successful run ends with=== Pipeline complete ===andDeleted one-off env file: .env.The runner already submits transactions one at a time with
--slow. If transactions time out, add a longer timeout:After a stage fails partway, Foundry refuses to broadcast that stage again until you add
--resumeto continue the earlier broadcast or--start-freshto discard it. On a dev node, restarting the node and deleting thebroadcast/folder also gives you a clean run. -
Read the addresses from the manifest:
The manifest lists every contract:
DotnsProtocolRegistry,DotnsRegistrar,DotnsRegistry,DotnsRegistrarController,DotnsPopController,DotnsPopLens,PopRules, the four resolvers,DotnsNameEscrow,DotnsNameWhitelist,StoreFactorywith itsUserStoreBeaconandLabelStoreBeacon,Multicall3,DotnsCostModelRegistry,DotnsFlatPricing, and theCreate3Factorythe pipeline deploys through. For their roles, see Architecture. -
Confirm the escrow's redeem window is set, since a zero value makes every release revert:
With the default constants, the call returns
86400.
For the remaining post-deploy checks, including the release metadata verification, see DEPLOYMENT_CHECKLIST.md.
Dispatch Root-Only Calls¶
Opening the short-name band, issuing name grants, and changing whitelist settings check for a Substrate Root origin rather than an EVM caller. The contracts read it from the pallet-revive System precompile, so a signed EVM transaction reverts with NotRoot or NotGovernance, the deployer included.
A Root call is a Revive.call extrinsic, carrying the contract address and the EVM calldata, dispatched with a Root origin. The Revive Dev node's development genesis sets //Alice as the sudo key, so on a dev node you wrap the call in Sudo.sudo. Encode the calldata with cast. For example, to open the short-name band on PopRules:
Then submit Sudo.sudo(Revive.call { dest: INSERT_POP_RULES_ADDRESS, value: 0, data: INSERT_CALLDATA, ... }) signed by //Alice, for example from the Polkadot.js Apps Sudo page connected to ws://127.0.0.1:9944. The gas and storage-deposit limits belong to the Revive.call extrinsic, not to the contract call; dry-run the call to size them. The repository's Name Grants section gives the calldata for grants. On a network with governance instead of sudo, the same call is put up as a referendum.
Known Limits on a Dev Node¶
PopRules reads each account's personhood status from a Proof of Personhood precompile at 0x000000000000000000000000000000000a010000, backed by the alias-accounts pallet in the Asset Hub runtime. The Revive Dev node runtime does not include that pallet, so anything that reads personhood status, including pricing a public registration, does not get the answer it would get on Asset Hub. A dev node is suited to testing the deployment pipeline, record management, and Root dispatches. To exercise the registration paths, deploy to a chain whose runtime provides the precompile.
The personhood gateway path also needs the dotNS gateway pallet in the chain's runtime; see DotnsPopController in the repository README.
Point the dotNS CLI at Your Deployment¶
The dotNS CLI resolves a network from a stack descriptor: a document listing the network's chain endpoints, genesis hashes, and dotNS contract addresses. Its --env values select descriptors bundled with the CLI, so they never reach your instance. To use your own instance, write a descriptor for it and pass it with --stack, or set DOTNS_STACK:
The descriptor follows the Trinity stack descriptor format. For a custom stack, the CLI (@parity/dotns-cli 2.0.0) requires:
- An
AssetHubchain entry with aparaId, the chain where you deployed the contracts. ItsgenesisHashmust match the chain's block 0 hash. - Exactly one
Relaychain entry. The descriptor format requires it even for a solo dev chain; the dotNS commands that do not use the relay chain never connect to it. - A
dotnsaddress for each of these keys:registrar,controller,registry,resolver,reverseResolver,popResolver,contentResolver,storeFactory,popRules,popController,nameEscrow, andmulticall3. Take them from your deployment manifest and write them in lowercase. The manifest uses mixed-case checksummed addresses, which the CLI rejects withdotns is not 20 bytes of lowercase 0x-prefixed hex.
The following descriptor works with a Revive Dev node. Fill in the genesis hash, which chain_getBlockHash with block 0 returns, the TLD you deployed with, and the addresses from your manifest:
{
"$v": 1,
"id": "local-dotns",
"name": "Local dotNS",
"network": "local",
"tld": "INSERT_TLD",
"generation": "2026-01-01T00:00:00.000Z",
"sequence": 1,
"chains": [
{
"role": "Relay",
"genesisHash": "0x1111111111111111111111111111111111111111111111111111111111111111",
"rpc": ["ws://127.0.0.1:9945"]
},
{
"role": "AssetHub",
"paraId": 1000,
"genesisHash": "INSERT_GENESIS_HASH",
"rpc": ["ws://127.0.0.1:9944"]
}
],
"services": [],
"dotns": {
"registrar": "INSERT_DOTNS_REGISTRAR_ADDRESS",
"controller": "INSERT_DOTNS_REGISTRAR_CONTROLLER_ADDRESS",
"registry": "INSERT_DOTNS_REGISTRY_ADDRESS",
"resolver": "INSERT_DOTNS_RESOLVER_ADDRESS",
"reverseResolver": "INSERT_DOTNS_REVERSE_RESOLVER_ADDRESS",
"popResolver": "INSERT_DOTNS_POP_RESOLVER_ADDRESS",
"contentResolver": "INSERT_DOTNS_CONTENT_RESOLVER_ADDRESS",
"storeFactory": "INSERT_STORE_FACTORY_ADDRESS",
"popRules": "INSERT_POP_RULES_ADDRESS",
"popController": "INSERT_DOTNS_POP_CONTROLLER_ADDRESS",
"nameEscrow": "INSERT_DOTNS_NAME_ESCROW_ADDRESS",
"multicall3": "INSERT_MULTICALL3_ADDRESS"
}
}
The relay chain values are placeholders. Commands that read the registry, such as dotns lookup name and dotns lookup owner-of, work against this stack. Commands that read personhood status, such as dotns pop info and dotns register domain, fail on a Revive Dev node, as described in Known Limits on a Dev Node.
A stack without a Bulletin or People chain entry still runs the other commands; commands that need the missing chain fail and name it. A descriptor file is used as is, without a signature check. --stack cannot be combined with --env, and --rpc changes only the endpoint, not the contract addresses.
Before it reads or signs, the CLI checks the release the instance declares through protocolVersion() and refuses an unsupported one; 2.0.0 accepts 0.8.0, 1.0.0, and 1.1.0. It also compares the chain's genesis hash with the descriptor. Set DOTNS_SKIP_VERSION_CHECK=1 or DOTNS_SKIP_CHAIN_CHECK=1 to skip either check. For the full environment variable list, see the @parity/dotns-cli README.
Where to Go Next¶
-
Learn Architecture
What each deployed contract is responsible for and how the protocol registry ties them together.
-
Learn PopRules and Pricing
The length bands, the deposit, and the short-name switch your instance enforces.
-
Learn CLI
The commands you can run against your instance once the CLI points at it.
-
Learn dotNS Overview
How dotNS resolves
.dotnames and why each network has its own deployment.
| Created: November 17, 2026