Skip to main content

Overview

Trust gating enables you to build applications that control access to features, content, or services based on user trust scores, attestations, and reputation. This guide shows you how to implement comprehensive trust-gating systems in your applications.
Trust gating is like a VIP system for Web3. Instead of just checking if someone has enough tokens, you verify their reputation, experience, and trustworthiness before granting access.

What is Trust Gating?

Trust gating is a security pattern that uses reputation and attestation data to control access to application features. It enables:
  • Reputation-based access control - Grant access based on trust scores
  • Attestation verification - Require specific credentials or achievements
  • Risk-based decisions - Adjust access levels based on user risk profiles
  • Progressive access - Gradually unlock features as users build reputation
  • Fraud prevention - Block malicious actors based on behavior patterns

Trust Gating Patterns

1. Score-Based Gating

Control access based on trust score thresholds:

2. Attestation-Based Gating

Require specific attestations for access:

3. Policy-Based Gating

Use complex policies for sophisticated access control:

4. Composite Gating

Combine multiple gating mechanisms:

Building a Trust-Gated Application

Let’s build a complete trust-gated DeFi lending application:

1. Application Setup

2. Trust Gate Middleware

3. Protected Routes

4. Dynamic Access Control

5. Frontend Integration

6. Real-time Trust Updates

Advanced Trust Gating Patterns

1. Progressive Unlocking

2. Risk-Based Gating

3. Time-Based Gating

Best Practices

1. User Experience

  • Clear requirements: Always show users what they need to access features
  • Progress indicators: Show users how close they are to unlocking features
  • Helpful suggestions: Provide actionable steps to improve trust
  • Graceful degradation: Offer alternative features when trust requirements aren’t met

2. Performance

  • Cache trust data: Cache trust scores and attestations to reduce API calls
  • Batch requests: Use batch evaluation for multiple trust checks
  • Lazy loading: Only check trust when features are accessed
  • Background updates: Update trust data in the background

3. Security

  • Server-side validation: Always validate trust on the server side
  • Rate limiting: Implement rate limiting on trust-gated endpoints
  • Audit logging: Log all trust-based access decisions
  • Regular updates: Keep trust requirements up to date

4. Monitoring

  • Trust metrics: Monitor trust score distributions and trends
  • Access patterns: Track which trust gates are most restrictive
  • User feedback: Collect feedback on trust requirements
  • A/B testing: Test different trust requirements for optimal conversion