Skip to content

Implement Enhanced Trust Score System with Blockchain Reputation #340

@umwelt

Description

@umwelt

Overview

Implement an enhanced trust score system that integrates with blockchain reputation data, includes trust decay over time, and supports reputation propagation across the network.

Background

The current implementation has basic trust scores (trust_score: f64) in MeshConnection but lacks:

  • Blockchain reputation integration
  • Trust decay mechanism
  • Reputation propagation

Requirements

1. Blockchain Reputation Integration

  • Query blockchain for identity reputation data
  • Map on-chain reputation to peer trust scores
  • Update trust scores when blockchain reputation changes
  • Cache blockchain lookups with TTL

2. Trust Decay Mechanism

  • Implement time-based trust decay (trust decays if peer inactive)
  • Define decay curves (linear, exponential, etc.)
  • Reset decay on successful interactions
  • Minimum trust floor (never decay below threshold)

3. Reputation Propagation

  • Peers can share reputation observations
  • Weight reputation based on reporter's own reputation
  • Prevent sybil attacks on reputation system
  • Implement reputation consensus mechanism

Files to Modify

  • lib-network/src/mesh/connection.rs - Add reputation tracking fields
  • lib-network/src/identity/unified_peer.rs - Add reputation methods
  • zhtp/src/server/mesh/identity_verification.rs - Integrate blockchain lookup
  • NEW: lib-network/src/reputation/ - Reputation module

Acceptance Criteria

  • Trust scores update from blockchain reputation
  • Trust decays over time for inactive peers
  • Peers can propagate reputation observations
  • Sybil attack resistance implemented
  • Unit tests for reputation system
  • Integration tests with blockchain

Priority

MEDIUM - Important for network security but not blocking

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsecuritySecurity-related changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions