A decentralized naming service (DNS) protocol on the CORE blockchain, inspired by Ethereum Name Service (ENS). This project lets users register human-readable .core domains, map them to on-chain and off-chain resources, and manage ownership through smart contracts.
👉 Live App: CoreDns
- Domain Registry: Store and manage ownership, registration, and expiration of
.coredomains. - Resolver: Associate domains with detailed records (wallet address, IPFS hash, email, social media link).
- Registrar: Handle domain registration and renewal with a configurable fee and period.
- Front-end dApp: Next.js application for users to connect wallets, register domains, view public registry, and manage personal domains.
dns-protocol/
├── contracts/ # Solidity smart contracts
│ ├── ENS-Registry.sol # Core registry contract
│ ├── ResolverContract.sol# Enhanced resolver for domain records
│ └── RegistrationContract.sol # Registrar for registration logic
├── scripts/ # Deployment scripts
│ └── deploy.js # Deploy registry & registrar
├── test/ # Hardhat tests (sample Lock contract)
│ └── Lock.js
├── Frontend/ # Next.js front-end application
├── hardhat.config.js # Hardhat configuration (CORE testnet)
├── package.json
└── README.md # This file
- Blockchain: EVM-compatible CORE chain (testnet RPC at
https://rpc.test2.btcs.network). - Smart Contracts: Solidity 0.8.x, Hardhat, Ethers.js.
- Front-end: Next.js, TypeScript, Tailwind CSS, Ethers.js.
- Node.js (v16+)
- npm or Yarn
- Hardhat CLI
- A CORE testnet wallet and a funded account private key
git clone https://github.com/coredao-org/dapp-tutorial.git
cd dapp-tutorial/15-dns-protocolnpm installCreate a .env file in the root folder with:
PRIVATE_KEY=your_core_testnet_private_key
RPC_URL=https://rpc.test2.btcs.networkCompile contracts:
npx hardhat compileDeploy to CORE testnet:
npx hardhat run scripts/deploy.js --network coreNote the deployed addresses printed in console.
-
Navigate to the
Frontendfolder:cd Frontend -
Install front-end dependencies:
npm install
-
Open the config.json file located in the constants folder within the Frontend directory:
Frontend/constants/config.json
Update the contract addresses as follows:
Contract One Address: Replace with the deployed address of the ENS Registry contract. Contract Two Address: Replace with the deployed address of the Registrar contract. Ensure that the addresses are correctly formatted as strings. For example:{ "contractOneAddress": "0xYourENSRegistryAddress", "contractTwoAddress": "0xYourRegistrarAddress" }
npm run devOpen your browser at http://localhost:3000 to interact with the DNS dApp.
- Public Registry Page: View all registered
.coredomains and their owners. - Search: Filter domains by name to see owner details.
- Connect Wallet: Use MetaMask or other EVM wallet to connect.
- Register Domain: Type your desired name (without
.core), the suffix is added automatically. If available, confirm transaction. If taken, an error displays the current owner. - My Domains: In your dashboard, view domains owned by your connected wallet.
- Resolver Management: (Optional) Update domain records (wallet, IPFS, email, social) via the resolver interface.
The provided tests cover the sample Lock contract.
Run Hardhat tests:
npx hardhat testContributions are welcome! Please:
- Fork the repo
- Create a new branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -m "Add awesome feature") - Push to your branch (
git push origin feature/YourFeature) - Open a Pull Request