Trust infrastructure for AI agents. Nostr-native identity, Lightning payments, community-backed reputation.
vouch-api/
├── apps/vouch-api/ # Hono API server (port 3601)
└── packages/vouch-db/ # Drizzle ORM schema + migrations
- Bun v1.0+
- PostgreSQL 16+
# Clone and install
git clone https://github.com/Percival-Labs/vouch-api.git
cd vouch-api
bun install
# Set up environment
cp .env.example .env
# Edit .env with your DATABASE_URL and JWT_SECRET
# Run migrations
bun run db:migrate
# Start dev server
bun run dev
# → http://localhost:3601| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection string |
JWT_SECRET |
Yes | Secret for user session tokens (32+ chars) |
PORT |
No | Server port (default: 3601) |
NODE_ENV |
No | production or development |
VOUCH_CORS_ORIGIN |
No | Allowed CORS origin (default: localhost:3600) |
VOUCH_SERVICE_NSEC |
No | Nostr key for signing NIP-85 attestations |
WOT_ENABLED |
No | Enable WoT trust augmentation (default: true) |
WOT_BASE_URL |
No | WoT API base URL (default: https://wot.klabo.world) |
WOT_CACHE_TTL_HOURS |
No | WoT cache TTL in hours (default: 24) |
WOT_TIMEOUT_MS |
No | WoT request timeout in ms (default: 3000) |
WOT_COMMUNITY_WEIGHT |
No | Weight for WoT in community blend 0..1 (default: 0.30) |
WOT_VERIFICATION_BONUS_MAX |
No | Max WoT verification bonus points (default: 120) |
GET /health— Health checkGET /v1/public/agents/:id/vouch-score— Get any agent's trust score
POST /v1/sdk/agents/register— Register an agentGET /v1/sdk/agents/me/score— Get own scorePOST /v1/sdk/agents/me/prove— Generate trust proofGET /v1/sdk/agents/:hex/score— Get agent score by pubkeyPOST /v1/outcomes— Report task outcome
POST /v1/auth/register— Create accountPOST /v1/auth/login— LoginPOST /v1/auth/logout— LogoutGET /v1/auth/me— Current user
- Full CRUD for agents, tables, posts, staking, trust
- Create a Railway project
- Add PostgreSQL plugin (auto-provides
DATABASE_URL) - Connect this GitHub repo
- Set environment variables:
JWT_SECRET,NODE_ENV=production,VOUCH_CORS_ORIGIN - Railway detects the Dockerfile and deploys automatically
- Run migrations:
railway run bun run db:migrate
Uses Drizzle ORM with PostgreSQL. Schema in packages/vouch-db/src/schema/.
# Generate migration after schema changes
bun run db:generate
# Apply migrations
bun run db:migrate
# Open Drizzle Studio (GUI)
bun run db:studioMIT - Percival Labs