Skip to content

w3hc/wulong

Repository files navigation

Wulong

NestJS Test codecov TypeScript pnpm Node.js License: GPL v3

A NestJS API designed to run inside a Trusted Execution Environment (TEE) with quantum-resistant ML-KEM-1024 encryption and Web3 authentication (SIWE), giving users cryptographic guarantees that the operator cannot access their data during processing. Optimized for Phala Network deployment.

Features

Quick Start

Local Development (without Docker)

Mock TEE attestation - no real hardware security.

# Install dependencies
pnpm install

# Setup environment
cp .env.template .env

# Generate TLS certificates
mkdir -p secrets
openssl req -x509 -newkey rsa:4096 -keyout secrets/tls.key -out secrets/tls.cert -days 365 -nodes -subj "/CN=localhost"

# Generate ML-KEM keypair
pnpm ts-node scripts/generate-admin-keypair.ts
# Copy the output keys to your .env file

# Start development server
pnpm start:dev

# Test ML-KEM encryption (in another terminal)
pnpm test:mlkem              # Basic encryption test
pnpm test:store-access       # Full store+access flow with SIWE

Access at https://localhost:3000 (accept self-signed certificate warning)

Docker Development

Mock TEE attestation - no real hardware security.

docker compose -f docker-compose.dev.yml up

Access at https://localhost:3000

Phala Cloud (Production TEE)

# Build and push Docker image
docker buildx build --platform linux/amd64 -t YOUR_USERNAME/wulong:latest --push .

# Deploy to Phala Cloud
phala deploy --interactive

# Test against Phala deployment
WULONG_URL=https://your-app-id-3000.phala.network pnpm test:store-access

Docs

Setup & Deployment

API & Usage

Architecture & Security

License

GPL-3.0

Contact

Julien Béranger (GitHub)

built-with-ethereum-w3hc

About

Privacy-preserving API

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages