Skip to main content

Overview

This guide provides comprehensive examples for integrating with the ZKScore Trust Registry contract. It covers attestation creation, verification workflows, trust score calculation, and best practices for production deployments.
Always test your integration on testnet before deploying to mainnet. Use the testnet contract addresses provided in the Contract Overview section.

Web3 Integration

Basic Setup

Integration Class

Complete Trust System

Trust Score Dashboard

Attestation Workflows

Identity Verification Workflow

Error Handling

Best Practices

Security

  1. Verify Attestations: Always check validity before trusting
  2. Attester Reputation: Consider attester trustworthiness
  3. Schema Validation: Use well-defined schemas
  4. Expiration: Set appropriate expiration times
  5. Revocation: Monitor for revocations

Performance

  1. Batch Operations: Use multiAttest for multiple attestations
  2. Cache Schemas: Cache schema definitions locally
  3. Event Listening: Use events for real-time updates
  4. Pagination: Paginate large attestation lists
  5. Gas Optimization: Estimate gas before transactions

Integration

  1. Test Thoroughly: Test on testnet first
  2. Error Handling: Implement comprehensive error handling
  3. Monitor Events: Track all attestation events
  4. Documentation: Document your attestation schemas
  5. User Experience: Provide clear feedback to users