Back to Home

Developer Documentation

Complete API reference, SDKs, and integration examples to get started with ProofPass

Quick Start

Get up and running in 5 minutes

Installation & Basic Usage
npm install @proofpass/sdk

import { ProofPass } from '@proofpass/sdk'

// Initialize client
const proofpass = new ProofPass({
  apiKey: 'YOUR_API_KEY'
})

// Create an attestation
const attestation = await proofpass.attestations.create({
  type: 'quality_check',
  data: {
    productId: 'BAT-2024-001',
    result: 'PASSED',
    inspector: 'John Doe',
    timestamp: new Date().toISOString()
  }
})

console.log('Attestation created:', attestation.id)
1.

Get API Key

Sign up and get your API key from the dashboard

2.

Install SDK

Install the SDK for your language (JS/Python/Go)

3.

Create Attestation

Start creating verifiable attestations

API Reference

RESTful API endpoints

POST/v1/attestations

Create a new attestation

// POST /v1/attestations
const response = await fetch('https://api.proofpass.com/v1/attestations', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    type: 'shipment',
    data: {
      productId: 'PROD-123',
      origin: 'Factory A',
      destination: 'Warehouse B',
      timestamp: '2024-10-28T10:00:00Z'
    }
  })
})

const attestation = await response.json()
// Returns: { id, type, data, signature, blockchain_tx }
GET/v1/attestations/:id/verify

Verify an attestation

// GET /v1/attestations/:id/verify
const response = await fetch('https://api.proofpass.com/v1/attestations/att_abc123/verify', {
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
})

const verification = await response.json()
console.log('Valid:', verification.valid)
console.log('Blockchain confirmed:', verification.blockchain_confirmed)

Advanced Features

Zero-Knowledge Proofs & Product Passports

Zero-Knowledge Proofs

Prove claims without revealing underlying data

// Create Zero-Knowledge Proof
const zkProof = await proofpass.zkproofs.create({
  type: 'range_proof',
  claim: 'carbon_footprint_below_threshold',
  privateData: {
    actualValue: 3.2,  // This stays private
    threshold: 5.0     // Prove: actualValue < threshold
  }
})

// Verifier can confirm the claim without seeing actualValue
const isValid = await proofpass.zkproofs.verify(zkProof.id)
console.log('Claim verified:', isValid)  // true, but 3.2 remains secret

Product Passports

Aggregate multiple attestations into a digital passport

// Create Product Passport with multiple attestations
const passport = await proofpass.passports.create({
  productId: 'BATTERY-EV-2024-001',
  attestations: [
    'att_mining_001',    // Mining attestation
    'att_refining_002',  // Refining attestation
    'att_assembly_003'   // Assembly attestation
  ],
  metadata: {
    manufacturer: 'EuroPower Systems',
    model: 'EV-500',
    serialNumber: 'EP-2024-12345'
  }
})

// Generate QR code for product
const qrCode = await passport.generateQRCode()
console.log('Passport URL:', passport.publicUrl)

SDKs & Libraries

Official client libraries

Python

from proofpass import ProofPass

# Initialize
client = ProofPass(api_key='YOUR_API_KEY')

# Create attestation
attestation = client.attestations.create(
    type='temperature_log',
    data={
        'productId': 'FOOD-123',
        'temperature': 4.2,
        'location': 'Truck-442',
        'timestamp': '2024-10-28T10:00:00Z'
    }
)

print(f'Attestation ID: {attestation.id}')
View on GitHub

Go

package main

import (
    "github.com/proofpass/proofpass-go"
)

func main() {
    client := proofpass.NewClient("YOUR_API_KEY")

    attestation, err := client.Attestations.Create(&proofpass.AttestationRequest{
        Type: "inspection",
        Data: map[string]interface{}{
            "productId": "PHARMA-456",
            "result": "PASSED",
            "inspector": "Jane Smith",
        },
    })

    if err != nil {
        panic(err)
    }

    fmt.Printf("Attestation: %s\n", attestation.ID)
}
View on GitHub

Webhooks

// Configure webhook to receive events
const webhook = await proofpass.webhooks.create({
  url: 'https://your-api.com/webhooks/proofpass',
  events: ['attestation.created', 'attestation.verified']
})

// Your webhook endpoint receives:
// POST /webhooks/proofpass
{
  "event": "attestation.created",
  "data": {
    "id": "att_abc123",
    "type": "quality_check",
    "created_at": "2024-10-28T10:00:00Z"
  }
}
Configure Webhooks

Ready to Integrate?

Get your API key and start building with ProofPass today