Back

DOCUMENTATION

Getting Started

ShardProof provides cryptographically verified on-chain data through a simple API. Connect to the network, subscribe to proof streams, and consume trust-minimal truth in real time.

npm install @shardproof/client

Core Concepts

Proof Streams

Real-time feeds of verified on-chain data. Each stream emits proofs at block-level granularity. Subscribers receive reconstructed states with full cryptographic attestation.

• Latency: 200-800ms from block finalization

• Proof size: 2-8 KB per event

• Retention: 90 days (historical queries supported)

Reconstructed States

Fragmented on-chain data aggregated into verified snapshots. States include merkle proofs, ZK attestations, and reconstruction metadata. Every state is independently verifiable.

• Verification method: SNARK-based proof aggregation

• Confidence threshold: 3+ validator confirmations

• Failure mode: Reject on proof mismatch

API Endpoints

GET/v1/proofs/:chain/:block

Retrieve verified proof for specific block on target chain.

POST/v1/streams/subscribe

Subscribe to real-time proof stream for specified chain and filter criteria.

GET/v1/state/:chain/:address

Query reconstructed state for contract address with proof attestation.

POST/v1/verify

Submit proof for independent verification against integrity mesh.

Integration Guide

Basic Connection

import { ShardProofClient } from '@shardproof/client'

const client = new ShardProofClient({
  apiKey: process.env.SPRF_API_KEY,
  network: 'mainnet'
})

// Query single proof
const proof = await client.getProof('ethereum', 19234567)
console.log(proof.verified) // true

Stream Subscription

// Subscribe to proof stream
const stream = client.subscribeToStream({
  chain: 'ethereum',
  filter: { contract: '0x...' }
})

stream.on('proof', (proof) => {
  console.log('New verified state:', proof.data)
  console.log('Validator signatures:', proof.attestations)
})

stream.on('error', (err) => {
  console.error('Stream error:', err)
})

Developer Notes

Rate Limits

Free tier: 100 queries/minute. Staked tier (10K+ $SPRF): 1000 queries/minute. Enterprise: Unlimited (custom $SPRF stake required).

Proof Verification

All proofs include SNARK verification parameters. Client SDK verifies locally by default. Disable with verifyLocal: false to trust network consensus.

Error Handling

Network rejects invalid queries immediately. Failed proofs return verified: false with detailed rejection reason. Never trust unverified data.