Getting Started

1

Create Your Account

Sign up for a Data Proof Labs account to get your API credentials.

Visit: https://app.dataprooflabs.com/signup
Or use the CLI:
npx @dataprooflabs/cli signup
2

Install the SDK

Choose your preferred SDK and install it using your package manager.

npm install @dataprooflabs/sdk
dotnet add package DataProofLabs.SDK
pip install dataprooflabs
3

Initialize the Client

Configure the SDK with your API credentials.

import { DataProofClient } from '@dataprooflabs/sdk';

const client = new DataProofClient({
    apiKey: 'your-api-key',
    environment: 'production' // or 'sandbox' for testing
});

// Test the connection
const status = await client.getStatus();
console.log('Connected:', status.connected);
4

Create Your First Proof

Submit data to create an immutable blockchain proof.

// Single proof creation
const proof = await client.createProof({
    data: 'Your important data here',
    blockchain: 'ethereum',
    metadata: {
        description: 'My first proof',
        tags: ['test', 'demo']
    }
});

console.log('Proof created:', proof.transactionHash);
console.log('View on explorer:', proof.explorerUrl);
5

Verify a Proof

Verify the authenticity and integrity of your proof.

const verification = await client.verifyProof({
    proofId: proof.id
});

console.log('Valid:', verification.isValid);
console.log('Timestamp:', verification.timestamp);
console.log('Block number:', verification.blockNumber);

Authentication

API Key Authentication

The simplest way to authenticate is using your API key in the request headers:

X-API-Key: your-api-key-here

JWT Authentication (Advanced)

For enhanced security, use JWT tokens with short expiration times:

const token = await client.auth.getToken({
    clientId: 'your-client-id',
    clientSecret: 'your-client-secret'
});

// Token automatically refreshed by SDK
client.setAuthToken(token);

Batch Processing

Save up to 95% on transaction costs by batching multiple proofs:

// Batch multiple proofs into one transaction
const batch = await client.createBatchProof({
    proofs: [
        { data: 'Document 1', metadata: { id: 'doc1' } },
        { data: 'Document 2', metadata: { id: 'doc2' } },
        { data: 'Document 3', metadata: { id: 'doc3' } }
    ],
    blockchain: 'ethereum'
});

console.log('Batch transaction:', batch.transactionHash);
console.log('Merkle root:', batch.merkleRoot);

// Verify individual proof from batch
const proofVerification = await client.verifyBatchProof({
    batchId: batch.id,
    proofIndex: 0
});

Environment Configuration

Important Note

Always use the sandbox environment for development and testing. Production usage will incur blockchain transaction fees.

Available Environments

Configuration Options

const client = new DataProofClient({
    apiKey: process.env.DPL_API_KEY,
    environment: process.env.DPL_ENV || 'sandbox',
    
    // Optional configurations
    timeout: 30000,           // Request timeout in ms
    retryAttempts: 3,         // Number of retry attempts
    webhookUrl: 'https://your-app.com/webhook',
    
    // Blockchain preferences
    defaultBlockchain: 'ethereum',
    confirmationBlocks: 12    // Blocks to wait for confirmation
});

Next Steps