A decentralized identity and domain name registration system built on the Miden blockchain. This frontend application allows users to register .miden domains, manage their digital identity, and connect their social profiles in a Web3 environment.
Miden ID is a blockchain-based naming service that enables users to:
- Register and manage
.midendomain names - Create decentralized identity profiles linked to their domains
- Connect social media accounts (Twitter, GitHub, Discord, Telegram)
- Manage multiple domains with wallet integration
- Sign profile data with cryptographic verification
- Real-time Domain Search: Instant availability checking for
.midendomains - Multi-step Registration Flow: Clear visual feedback throughout the registration process
- Domain Validation: Supports 1-20 character alphanumeric domain names
- Profile Customization: Add bio (up to 280 characters), social links, and profile images
- Wallet-based Authentication: Cryptographic signature verification for profile updates
- Multi-domain Support: Switch between and manage multiple registered domains
- Profile Privacy: Delete profile data while retaining domain ownership
- Responsive Design: Mobile-first approach with adaptive layouts
- Dark/Light Theme: System-aware theme with manual toggle
- Real-time Notifications: Toast notifications for user actions and feedback
- Loading States: Clear indicators for async operations
- Error Handling: Comprehensive error messages and recovery options
- React 19.1.1 - Modern UI framework with hooks
- TypeScript 5.8.3 - Type-safe development
- Vite 7.1.2 - Fast build tool and dev server
- React Router 7.9.3 - Client-side routing
- Miden SDK 0.12.5 - Miden protocol integration
- Miden Wallet Adapter - Wallet connectivity and transaction signing
- MASM Smart Contracts - On-chain domain registration logic
- shadcn/ui - High-quality React component library
- Radix UI - Accessible headless UI primitives
- Tailwind CSS 3.4.13 - Utility-first styling
- Lucide React - Icon library
- Framer Motion - Smooth animations
- React Hook Form 7.64.0 - Performant form handling
- Zod 4.1.12 - TypeScript-first schema validation
- @hookform/resolvers - Validation integration
- Vitest - Fast unit testing
- Playwright - End-to-end testing
- ESLint - Code quality and linting
- Husky - Git hooks for pre-commit checks
src/
├── api/ # Backend API integration
│ ├── accounts.ts # Account and domain lookups
│ ├── domains.ts # Domain resolution
│ ├── profile.ts # Profile CRUD operations
│ ├── metadata.ts # Domain metadata management
│ └── types.ts # API response interfaces
├── components/ # Reusable React components
│ ├── ui/ # shadcn/ui components
│ ├── register-modal/ # Domain registration workflow
│ ├── site-header.tsx # Navigation header
│ └── theme-provider.tsx # Theme management
├── contexts/ # React Context providers
│ ├── WalletAccountContext.tsx # Wallet and account state
│ └── DomainRegistrationContext.tsx # Registration callbacks
├── hooks/ # Custom React hooks
├── lib/ # Utility libraries
│ ├── midenClient.ts # Miden client management
│ └── transactionCreator.ts # Transaction signing
├── pages/ # Route components
│ ├── home/ # Domain search/registration
│ ├── identity/ # Profile management
│ ├── myDomains/ # Domain listing
│ └── not-found/ # 404 page
├── shared/ # Shared constants and contracts
│ ├── constants.ts # Contract addresses, API endpoints
│ ├── pricing.ts # Domain pricing config
│ ├── contracts/ # MASM smart contracts
│ └── notes/ # Transaction note scripts
└── utils/ # Helper functions
├── encode.ts # Domain name encoding
├── decode.ts # Domain name decoding
└── format.ts # Formatting utilities
- Node.js 18+ and npm
- Miden wallet (for blockchain interactions)
- Access to Miden testnet
- Clone the repository:
git clone <repository-url>
cd midenid-frontend- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser and navigate to
http://localhost:5173
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm run lint |
Run ESLint |
npm run test |
Run tests in watch mode |
npm run test:ui |
Open Vitest UI dashboard |
npm run test:run |
Run tests once (CI mode) |
The application connects to:
- Miden Testnet RPC:
https://rpc.testnet.miden.io
- Miden ID Contract:
0xf090f55f132c11405c162476ac8469 - Miden Faucet:
0x54bf4e12ef20082070758b022456c7
Update these in src/shared/constants.ts if needed.
The application uses React Context for state management:
- WalletAccountContext: Manages wallet connection, account ID, and owned domains
- DomainRegistrationContext: Handles registration completion callbacks
Client-side routing powered by React Router v7:
| Route | Component | Description |
|---|---|---|
/ |
Home | Domain search and registration |
/identity |
Identity | Profile editor (requires domain) |
/my-domains |
MyDomains | List of owned domains |
/* |
NotFound | 404 error page |
Domain names are encoded into Miden's Word format (4 Felts) for blockchain storage:
- Characters
a-zmap to values 1-26 - Characters
0-9map to values 27-36 - Maximum 20 characters supported
- Packed efficiently for on-chain storage
- User initiates domain registration
- Frontend creates MASM transaction note with domain data
- Miden wallet signs and approves the transaction
- Transaction submitted to Miden blockchain
- Frontend polls for confirmation (up to 75 seconds)
- On success, domain metadata is saved to backend database
- Wallet context refreshes to include new domain
The frontend communicates with a backend API for:
| Endpoint | Method | Purpose |
|---|---|---|
/accounts/{id} |
GET | Get active domain for account |
/accounts/{id}/domains |
GET | Get all domains for account |
/domains/{domain} |
GET | Resolve domain to account ID |
/metadata/domains/{domain}/profile |
GET/POST/DELETE | Profile CRUD |
/metadata/domains/{domain}/enriched |
GET | Get domain with profile data |
All profile modifications require cryptographic signatures for verification.
- TypeScript for type safety
- ESLint for code quality
- Husky for pre-commit hooks
- Consistent component structure (functional components with hooks)
# Run unit tests
npm run test
# Run with UI
npm run test:ui
# Run in browser mode
npm run test:browserTests are located in src/utils/__tests__/ and cover:
- Domain encoding/decoding
- Formatting utilities
- Domain registry functions
Components follow shadcn/ui conventions:
- Use Tailwind CSS for styling
- Radix UI for accessible primitives
- TypeScript interfaces for props
- React Hook Form for forms
npm run buildOutput is generated in the dist/ directory with:
- Optimized bundles
- Code splitting (react, miden-wallet, ui, form vendors)
- Minified assets
- Tree-shaking applied
npm run previewDomain pricing is character-based:
| Characters | Price/Year |
|---|---|
| 1 char | $375 |
| 2 chars | $250 |
| 3 chars | $125 |
| 4 chars | $50 |
| 5+ chars | $20 |
Prices are configured in src/shared/pricing.ts.
- Modern browsers with ES2020+ support
- IndexedDB for Miden client state
- LocalStorage for theme preferences
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use conventional commits format
- Run linting before committing
- Ensure tests pass
- Wallet Signatures: All profile updates require cryptographic signatures
- Input Validation: Zod schemas validate all form inputs
- XSS Prevention: React's built-in escaping
- HTTPS: Production should use HTTPS for API calls
- Ensure Miden wallet extension is installed
- Check that you're on Miden testnet
- Refresh the page and reconnect
- Verify wallet has sufficient balance
- Check domain availability before registration
- Ensure domain name follows validation rules (1-20 alphanumeric chars)
- Confirm wallet is connected
- Check that you own the domain
- Verify signature approval in wallet
For issues and questions:
- Open an issue on GitHub
- Check documentation at [docs]
- Contact the development team
- Miden blockchain team for the SDK
- shadcn for the UI component library
- Radix UI for accessible primitives
- The React and TypeScript communities
Built with ❤️ for the Miden ecosystem.