Getting Started
Get up and running with ProjectZero Prompt Mining in under 10 minutes.
Prerequisites
Before you begin, ensure you have:
- Node.js 18+ installed
- A ProjectZero account (sign in with OAuth at pm.projectzero.io)
- An API key created from the ProjectZero dashboard
New to ProjectZero? The onboarding process is simple:
- Sign in via OAuth (Google or GitHub) at pm.projectzero.io
- Navigate to the Dashboard and create a new API key
- Use that API key to configure the boilerplate (see below)
Authenticate & Create API Keys
Access is OAuth-only. Launch the sign-in modal (Google, GitHub, or email link) and you will land in the dashboard immediately—no manual registration review.
1. Authenticate
Visit pm.projectzero.io/login and choose an OAuth provider. A short-lived session cookie is created after OAuth completes.
2. Run the API key wizard
The wizard captures reward strategy (Activity Points vs custom token), permissions (MINTER_ROLE acknowledgments), network scope, and an onboarding checklist before alias/environment selection.
You can rotate keys per environment. Each key is shown once—copy it into your secret manager as soon as it appears.
Quick Setup
1. Clone
Clone the boilerplate repository
2. Configure
Set up environment variables
3. Test
Mint your first prompt
Step 1: Clone the Boilerplate
git clone https://github.com/projectzero-io/prompt-mining-boilerplate.git
cd prompt-mining-boilerplate
npm installStep 2: Configure Environment
Copy the example environment file and configure your credentials:
cp .env.example .envEdit .env with your ProjectZero credentials:
# ProjectZero API Configuration
PZERO_API_URL=https://pm-gateway.projectzero.io/v1
PZERO_API_KEY=pzero_live_your_api_key_here
# Blockchain Configuration
CHAIN_ID=7358
RPC_URL=https://rpc.nexera.org
PROMPT_MINER_ADDRESS=0x...
ACTIVITY_POINTS_ADDRESS=0x...
DATA_INDEX_ADDRESS=0x...
# Your Backend Wallet (for backend-signed mode)
PRIVATE_KEY=0x... # Keep this secret!
# Application Settings
NODE_ENV=development
PORT=3001Security Note: Never commit your .env file or expose your API keys and private keys. Add .env to your .gitignore.
Step 3: Verify Configuration
Run the configuration test to ensure everything is set up correctly:
npm run test:configYou should see output confirming all required variables are set:
✓ PZERO_API_KEY is set
✓ PZERO_API_URL is set
✓ RPC_URL is set
✓ PROMPT_MINER_ADDRESS is set
✓ ACTIVITY_POINTS_ADDRESS is set
✓ All required configuration is valid!Mint Your First Prompt
Start the development server:
npm run devThe server will start on http://localhost:3001
Test with cURL
Test the authorization endpoint:
curl -X POST http://localhost:3001/api/prompts/authorize \
-H "Content-Type: application/json" \
-H "x-api-key: pzero_live_your_api_key_here" \
-d '{
"prompt": "What is quantum computing?",
"author": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"activityPoints": 25
}'Expected response:
{
"success": true,
"data": {
"promptHash": "0x1a2b3c...",
"author": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"activityPoints": 25,
"signature": "0xabcdef...",
"nonce": 1,
"expiresAt": "2024-12-25T12:00:00Z"
}
}Success! You've authorized your first prompt. This signature can now be used to mint the prompt on-chain.
Health Check
Verify your service is running correctly:
curl http://localhost:3001/api/healthExpected response:
{
"status": "ok",
"timestamp": "2024-12-25T10:30:00Z",
"version": "1.0.0",
"services": {
"pzeroGateway": "connected",
"blockchain": "connected"
}
}Next Steps
Now that your environment is configured, you can:
Integration Guide
Learn how to integrate prompt mining into your AI service with backend-signed transactions.
Read Integration Guide →Security Best Practices
Understand the privacy-first architecture and security guarantees.
Learn About Security →