A web-based DID (Decentralized Identifier) service built with Veramo and Express.js. This service provides a REST API for managing Web DIDs and their associated services.
Important Note: This open-source version has authentication removed to keep it simple. Users must apply their own business logic and security measures. Reach out to 1EdTech if you need assistance with enterprise-grade authentication and security.
- Create and manage Web DIDs
- Add and remove DID services
- Manage DID aliases (AlsoKnownAs)
- DID document resolution
- Support for multiple database backends (SQLite, MySQL, PostgreSQL)
- Docker and Kubernetes support
- Node.js 20 or later
- npm or yarn
- Docker (optional)
- Kubernetes (optional)
The easiest way to get started is using Docker Compose with MariaDB:
- Start the development environment (with hot-reloading):
docker-compose up registrar-dev- Or start the production build:
docker-compose up registrarBoth services run on port 3000. The development version is recommended for local development as it provides hot-reloading and detailed logging.
- Install dependencies:
npm install- Configure environment variables:
cp .env.example .envEdit the .env file with your configuration.
- Start the development server:
npm run dev- Build and start production:
npm run build
npm startYou can run the registrar using Docker with the following command:
docker run -p 3000:3000 \
--name uniformid-registrar \
-e PORT=3000 \
-v ~/.uniformid-data:/data \
uniformid-registrar:localThe service can be configured using environment variables:
# Database Type (sqlite, mysql, or postgres)
DB_TYPE=sqlite
# Database Synchronization
DB_SYNCHRONIZE=true
# Database Logging
DB_LOGGING=false
# SQLite Configuration
DB_DATABASE=veramo.sqlite
# MySQL Configuration
DB_HOST=localhost
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=your_password
DB_DATABASE=veramo
# PostgreSQL Configuration
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=your_password
DB_DATABASE=veramo# Port to run the server on
PORT=3000
# DID Web Configuration
DID_WEB_HTTP=true
DID_WEB_PORT=3000GET /.well-known/did.json- Resolve the domain's DID documentGET /:id/did.json- Resolve a specific DID document
POST /:encodedDid- Create a new DIDGET /:encodedDid- Get a DID documentDELETE /:encodedDid- Delete a DID
POST /:encodedDid/services- Add a service to a DIDDELETE /:encodedDid/services/:serviceName- Remove a service from a DID
POST /:encodedDid/aliases- Add an alias to a DIDDELETE /:encodedDid/aliases/:alias- Remove an alias from a DID
Since Web DIDs require HTTPS/TLS, you can use ngrok for local development:
- Install ngrok:
npm install -g ngrokor download from ngrok.com - Start your registrar service on port 3000
- Create a tunnel:
ngrok http 3000 - Use the provided HTTPS URL as your domain for DID creation
Example: did:web:abc123.ngrok.dev:user:bob resolves to https://abc123.ngrok.dev/user/bob.json
Import the Postman collection from the postman/ directory to test the APIs:
UniformIDOpenSource.postman_collection.json- Complete API test collectionLocalDev.postman_environment.json- Environment configuration for local development
- Port already in use: Change the PORT environment variable or stop other services using port 3000
- Database connection issues: Check your database configuration and ensure the database is running
- TLS/HTTPS requirements: Use ngrok or a proper domain with SSL for Web DID resolution
The service uses Winston for logging. Check the console output for detailed error messages and debugging information.
For enterprise support, authentication integration, or custom implementations, please reach out to 1EdTech.