A NestJS-based backend service for managing attestations and proof-carrying data (PCDs) with Zupass integration. This service provides endpoints for creating and verifying attestations, handling PCDs, and integrating with various blockchain-based verification systems.
- Attestation creation and verification
- PCD (Proof Carrying Data) validation
- Zupass ticket verification
- EAS (Ethereum Attestation Service) integration
- CORS-enabled API endpoints
- Privy authentication integration
- Node.js (v16 or higher)
- pnpm
- Access to EAS infrastructure
- Zupass integration credentials
- Clone the repository
- Install dependencies:
pnpm install
Create a .env
file in the root directory with the following variables:
# EAS Configuration
PRETRUST_SCHEMA=your_pretrust_schema
VOUCH_SCHEMA=your_vouch_schema
GRAPHQL_URL=your_graphql_url
# Privy Configuration
PRIVY_APP_ID=your_privy_app_id
PRIVY_APP_SECRET=your_privy_secret
# Server Configuration
PORT=8000
# Development
pnpm run start:dev
# Production
pnpm run start:prod
# Testing
pnpm run test
POST /attestation
Authorization: Bearer <token>
{
"platform": "string",
"recipient": "string",
"attester": "string",
"signature": "string",
"category": "string",
"subcategory": "string"
}
Response:
{
"newAttestationUID": "string"
}
GET /attestation/nonce?attester=<address>
Response:
{
"easNonce": "number"
}
POST /attestation/revoke
Authorization: Bearer <token>
{
"signature": "string",
"uid": "string",
"address": "string"
}
POST /pcds
x-privy-app-id: <app_id>
{
"pcds": [
{
"pcd": {
"claim": {
"partialTicket": {
"productId": "string",
"eventId": "string"
}
}
}
}
],
"user": {
"wallet": {
"address": "string"
}
}
}
POST /pod/create
x-privy-app-id: <app_id>
{
"wallet": "string",
"AgoraScore": "string"
}
The service implements several security measures:
- Authorization headers required for sensitive endpoints
- Privy authentication guard for protected routes
- CORS configuration for allowed origins
- Input validation and sanitization
The service is built using NestJS and follows a modular architecture:
AttestationModule
: Handles attestation-related operationsPCDsModule
: Manages PCD validation and processingPODModule
: Handles POD-related operationsPrivyModule
: Manages authentication and authorization
The project includes unit tests and e2e tests:
# Run unit tests
pnpm run test
# Run e2e tests
pnpm run test:e2e
# Generate test coverage
pnpm run test:cov
The service supports various ticket types including:
- Zuzalu
- ZuConnect
- Devcon
- MegaZu24
- AgoraCore
- Esmeralda
Each ticket type has specific validation rules and configurations defined in the system.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is MIT licensed.
For support and questions:
- Create an issue in the repository
- Contact the development team
- Check the documentation for more details