A comprehensive monorepo for decentralized identity management, featuring a web application, Chrome extension, and DID resolver. Decast uses a decentralized identity (DID) system to enable secure, user-controlled identity verification across multiple services.
decast/
βββ packages/
β βββ did-web/ # Nuxt.js web application
β βββ did-manager/ # Chrome extension
β βββ decast-did-resolver/ # DID resolver package
βββ docker-compose.yml # Docker orchestration
βββ Dockerfile # Root Docker build
βββ pnpm-workspace.yaml # pnpm workspace configuration
- Node.js: >= 22.0.0
- pnpm: >= 8.0.0
- Docker: >= 20.0.0 (optional)
-
Install pnpm globally:
npm install -g pnpm@8.15.0
-
Install dependencies:
pnpm install
-
Set up environment variables:
# Create .env file in the project root cp env-example .env -
Start development:
pnpm dev
decast-did-resolver
did:decast is a custom DID method that uniquely represents a user within the Decast ecosystem. It complies with the W3C DID specification and provides:
- Cryptographic key association (Ed25519 by default)
- Public verification methods
- Authentication support (JWT, DIDComm, etc.)
- Optional service endpoints (profile, storages, etc.)
A custom DID resolver for the did:decast method. It enables DID Document resolution from our registry.
The did-manager is a browser extension for Chrome that allows users to manage their decentralized identities using the custom DID method did:decast:publicKey. It serves as a secure wallet for Decast identities, enabling key management and secure DID-based authentication.
-
Generate new identities based on Ed25519 key pairs.
-
Restore identity using a private key (manual input or paste).
-
Remove identities from local storage.
-
Export private key securely for user backup.
-
Multiple identity support: switch between multiple DID profiles.
The extension also acts as a signer for authentication flows:
-
A verifier (e.g., Decast or did-front) sends a signing request to the extension, including a nonce and request metadata.
-
The extension shows a UI prompt asking the user to review and confirm the nonce.
-
If the user approves, the message is signed using the selected private key.
-
The extension returns the signature, nonce, and associated did:decast back to the requesting origin.
This flow is used to:
-
Log the user into Decast
-
Authorize verifiable credential issuance
-
Provide proof of key ownership
Nuxt.js web application for DID management and verification.
Features:
- DID service management
- Identity verification
- Condition-based verification
- Proof generation
Commands:
pnpm --filter did-web dev # Start development server
pnpm --filter did-web build # Build for production
pnpm --filter did-web preview # Preview production buildpnpm dev # Start did-web development server
pnpm build # Build all packages
pnpm build:web # Build only did-web
pnpm build:manager # Build only did-manager
pnpm build:resolver # Build only did-resolver
pnpm clean # Clean all build artifacts
pnpm install:all # Install dependencies for all packagesUse the Makefile for common workflows. List all targets:
make helpCommon targets:
- setup-env: copy
env-exampleto.envvia scriptmake setup-env
- validate-env: verify required env variables are set
make validate-env
- dev: start development environment (Docker profile
dev)make dev
- prod: start production environment
make prod
- build: build the
did-webDocker imagemake build
- build-all: build all Docker images
make build-all
- logs: follow container logs
make logs
- clean: stop and remove containers
make clean
- clean-all: stop and remove containers, volumes, and images
make clean-all
- test: simple health check against local service
make test - install: install dependencies locally with pnpm
make install
- build-local: build packages locally with pnpm
make build-local
# Run commands in specific packages
pnpm --filter did-web <command>
pnpm --filter did-manager <command>
pnpm --filter @decast/decast-did-resolver <command>
# Examples
pnpm --filter did-web dev
pnpm --filter did-manager build
pnpm --filter @decast/decast-did-resolver test-
Build and run all services:
docker-compose up -d
-
Build specific service:
docker-compose up -d did-web
-
View logs:
docker-compose logs -f did-web
-
Start development environment:
docker-compose --profile dev up -d
-
Build extension and resolver:
docker-compose --profile build up -d
# Build did-web
docker build -f packages/did-web/Dockerfile -t decast-did-web .
# Build did-manager
docker build -f packages/did-manager/Dockerfile -t decast-did-manager .
# Build did-resolver
docker build -f packages/decast-did-resolver/Dockerfile -t decast-did-resolver .-
Copy the example environment file:
cp env-example .env
-
Update the values in
.envwith your specific configuration.
| Variable | Description | Default Value | Required |
|---|---|---|---|
GOOGLE_CLIENT_ID |
Google OAuth Client ID for authentication | 1054183103777-7eqm2ddpdo6ok9b1cq4c350132mmiusr.apps.googleusercontent.com |
Yes |
DID_BASE_URL |
Base URL for the DID service | https://did.decast.live |
Yes |
DID_RESOLVER_BASE_URL |
Base URL for the DID resolver service | https://did.decast.live/api/v1/dids/resolver |
Yes |
EXTENSION_ID |
Extension ID for the DID Manager browser extension | algkhhfaciplhfnkmecpmdfampkppndj |
Yes |
NODE_ENV |
Node.js environment | production |
No |
HOST |
Host address for the web application | 0.0.0.0 |
No |
PORT |
Port for the web application | 8080 |
No |
-
Create environment file:
# In the project root directory cp env-example .env -
Start development server:
pnpm dev
-
Environment variables are automatically loaded by Nuxt.js from the
.envfile.
-
Method 1: Using .env file (Recommended)
# Copy example and update values cp env-example .env # Start containers (Docker Compose automatically loads .env) docker-compose up -d
-
Method 2: Using environment variables directly:
export GOOGLE_CLIENT_ID="your_google_client_id" export DID_BASE_URL="https://your-did-service.com" export EXTENSION_ID="your_extension_id" docker-compose up -d
-
Method 3: Using docker-compose override:
# Create docker-compose.override.yml version: '3.8' services: did-web: environment: - GOOGLE_CLIENT_ID=your_google_client_id - DID_BASE_URL=https://your-did-service.com - EXTENSION_ID=your_extension_id
- Root level:
.env(primary env file) - Example file:
env-example(template for setup)
- Never commit
.envfiles to version control - Use different values for development, staging, and production
- Rotate sensitive values regularly
- Use secrets management in production environments
- Validate environment variables at startup
-
Environment variables not loading:
# Check if .env file exists ls -la .env # Verify Docker Compose is loading the file docker-compose config
-
Nuxt.js not reading environment variables:
# Ensure .env exists at the project root ls -la .env # Check Nuxt configuration cat packages/did-web/nuxt.config.ts
-
Docker containers not using updated environment variables:
# Rebuild containers after changing .env docker-compose down docker-compose up -d --build
- did-web: 3000 (HTTP)
- did-manager: 8080 (Extension builder)
- did-resolver: 3001 (Package service)
- All containers run as non-root users
- Environment variables for sensitive configuration
- Health checks for production services
- Secure volume mounts
-
Local Development:
pnpm dev
-
Package Development:
pnpm --filter <package-name> dev
-
Testing:
pnpm test -
Building:
pnpm build
-
Build production images:
docker-compose build
-
Deploy with environment variables:
docker-compose up -d
-
Monitor services:
docker-compose ps docker-compose logs -f
-
Use development profile:
docker-compose --profile dev up -d
-
Build extension:
docker-compose --profile build up -d
-
Install dependencies:
pnpm install
-
Start development:
pnpm dev
-
Make changes in the appropriate package
-
Test changes:
pnpm test -
Build and verify:
pnpm build
-
pnpm not found:
npm install -g pnpm@8.15.0
-
Port conflicts:
- Check if ports 3000, 3001, 8080 are available
- Modify docker-compose.yml if needed
-
Build failures:
pnpm clean pnpm install pnpm build
-
Docker build issues:
docker system prune -a docker-compose build --no-cache
# View all logs
docker-compose logs
# View specific service logs
docker-compose logs did-web
# Follow logs in real-time
docker-compose logs -f did-web
# Check service status
docker-compose psDecast uses DID-linked storage to manage secure file and stream storage, allowing each user's content to be cryptographically tied to their identity.
Soon
Each service represents a specific type of identity claim that a user can verify and associate with their DID:
-
Apple Account Verification: Apple login mapped to a DID identity
-
Google Account Verification: Facebook login mapped to a DID identity
-
Facebook Account Verification: Facebook login mapped to a DID identity
-
Email Verification (via OTP): Email login backed by a DID document and JWT
-
Metamask Ownership Verification: Sign-in using Ethereum or EVM-compatible wallets (via nonce & signature)
-
Liveness Check (via camera): Face movement + image capture to ensure the user is present and human
- Add test suites for service integrations
- Support for additional DID methods
decast-did/
βββ packages/
β βββ did-resolver/ # NPM module to resolve `did:decast:*`
β βββ did-manager/ # Browser extension for managing DIDs
βββ README.md # This file
βββ ...
MIT
Decast DID Verification is a decentralized identity (DID) proof system designed for use within the Decast.live platform. It enables verifiers (such as Decast.live) to request specific identity credentials from users in a secure, privacy-preserving, and decentralized way using verifiable credentials and DID-based JWT proofs.
This module facilitates:
- Requesting verification from users via DID.
- Securely presenting only the required fields (
credentialSubject) defined by the credential schema. - Generating a verifiable proof (DID-JWT) and redirecting it to the verifier.
-
Verifier (e.g., Decast.live) initiates a verification request with:
- A credential schema that defines the structure of the credential.
- A list of requested credentialSubject fields (e.g.,
firstName,age,verifiedDate). - Its own verifier address.
-
did-front (Decast DID Frontend):
- Receives the verification query.
- Prompts the user to log in via:
- Metamask (wallet-based DID)
- Decast native DID
- Displays the request details:
- Requested credentialSubject fields
- Verifier information (e.g.,
Decast.live)
-
After login:
- The app checks if the authenticated DID has a valid credential that matches the requested schema and
credentialSubjectfields. - If a matching credential is found:
- The user is prompted to generate a verifiable proof (DID-JWT).
- The app redirects the user back to the verifier (e.g., Decast.live) with the signed proof.
- If no matching credential exists:
- The user is directed to complete the verification process with the appropriate credential issuer service for the schema.
- The app checks if the authenticated DID has a valid credential that matches the requested schema and
sequenceDiagram
participant V as Verifier (Decast.live)
participant F as DID Front (did-front)
participant U as User
participant W as Wallet/DID
participant C as Credential Storage
participant I as Issuer Service
V->>F: Request verification (schema, credentialSubject, verifierAddress)
F->>U: Prompt login
U->>W: Sign in (Metamask / Decast DID)
W-->>F: Authenticated session
F->>U: Show requested fields & verifier info
F->>C: Check for matching credential
alt Credential Found
C-->>F: Matching credential
F->>U: Prompt to generate proof
U->>F: Sign DID-JWT
F->>V: Redirect with proof (DID-JWT)
else No Credential Found
C-->>F: No credential
F->>U: Redirect to Issuer Service
U->>I: Complete verification
I->>C: Issue new credential
end