SDK Documentation
Multi-language SDKs for blockchain-powered MiFID II compliance.
One line of code to make any API call compliance-ready.
Multi-Platform Support
PROOF Protocol provides native SDKs for all major programming languages, enabling compliance anywhere:
Web & Server
JavaScript, TypeScript, Node.js for backend APIs and web applications
Data Science & ML
Python for data pipelines, machine learning, and automation
Enterprise & Mobile
Java for enterprise systems, Android apps, and microservices
IoT & Embedded
C/C++ for IoT devices, embedded systems, and edge computing
Cloud Infrastructure
Go for microservices, containers, and cloud-native applications
High Performance
Rust for systems programming, WebAssembly, and critical workloads
Quick Start Examples
Choose your language and start recording compliance data in minutes:
Installation
npm install @proof-protocol/sdkExample
import { ProofClient } from '@proof-protocol/sdk';
const proof = new ProofClient({
privateKey: process.env.PROOF_PRIVATE_KEY,
network: 'polygon'
});
// Record an API call
const response = await proof.record(
fetch('https://api.example.com/trade', {
method: 'POST',
body: JSON.stringify({ amount: 1000, asset: 'EUR' })
}),
{ visibility: VisibilityLevel.PRIVATE, metadata: { userId: 'user_123' } }
);
console.log('Record ID:', response.proof.recordId);
console.log('Transaction:', response.proof.transactionHash);
console.log('IPFS:', response.proof.ipfsUrl);✓ Works with Node.js 16+, TypeScript 4.5+
✓ Full TypeScript support with type definitions
✓ Compatible with Express, Next.js, Nest.js
Configuration
Initialize the PROOF Protocol client with your credentials in your preferred language:
Client Configuration
import { ProofClient } from '@proof-protocol/sdk';
const proof = new ProofClient({
privateKey: process.env.PROOF_PRIVATE_KEY, // Required
network: 'polygon', // 'polygon' (mainnet) or 'amoy' (testnet)
contractAddress: '0x...', // Optional: custom contract
ipfsGateway: 'https://ipfs.io' // Optional: custom IPFS gateway
});privateKey: Ethereum private key for signing transactions (keep secure!)
network: 'polygon' for mainnet, 'amoy' for Polygon testnet
contractAddress: Override default ProofRegistry contract (advanced)
ipfsGateway: Custom IPFS gateway URL
Privacy Levels
PROOF Protocol supports three privacy levels for your compliance records:
PUBLICFull transparency
Both the hash and metadata are stored on-chain. Anyone can verify the record.
Use case: Public transactions, regulatory filings, transparency reports
PRIVATEEncrypted
Only the hash is stored on-chain. Full data is encrypted and stored on IPFS.
Use case: Client data, proprietary trades, sensitive information
SHAREDMulti-party
Multiple parties can access the record. Granular permission control.
Use case: Consortium data, regulator access, auditor sharing
SHARED Privacy (Professional+ Only)
SHARED privacy level requires Professional or Enterprise plan. Contact sales for details.
Core API Methods
Record, verify, and batch process compliance data in your preferred language:
record()
Wrap any API call and create an immutable blockchain record
import { VisibilityLevel } from '@proof-protocol/sdk';
const response = await proof.record(
fetch('/api/trade', { method: 'POST', body: '...' }),
{ visibility: VisibilityLevel.PRIVATE, metadata: { userId: 'user_123' } }
);
// Response includes blockchain proof
console.log(response.proof.transactionHash); // Transaction hash
console.log(response.proof.ipfsUrl); // IPFS URL
console.log(response.proof.recordId); // Unique IDverify()
Verify an existing record on the blockchain
const verification = await proof.verify(recordId);
console.log(verification.valid); // true/false
console.log(verification.timestamp); // Record creation timebatchRecord()
Record multiple API calls in a single transaction (80% gas savings)
const records = [
{ request: { url: '/api/trade1', ... }, response: { status: 200, ... } },
{ request: { url: '/api/trade2', ... }, response: { status: 200, ... } },
// ... up to 1000 records per batch
];
const receipt = await proof.batchRecord(records, VisibilityLevel.PRIVATE);
console.log('Batch ID:', receipt.recordId);
console.log('Records stored:', records.length);Error Handling
Handle errors gracefully in your preferred language:
try {
const response = await proof.record(fetch('/api/trade'));
} catch (error) {
if (error instanceof ProofNetworkError) {
console.error('Network error:', error.message);
} else if (error instanceof ProofValidationError) {
console.error('Validation error:', error.message);
} else if (error instanceof ProofStorageError) {
console.error('Storage error:', error.message);
}
}Ready to Build?
Check out our integration examples or join the beta program for support.