Trust Scoring

Trust scores are computed as a weighted sum of trust signals from the ledger, normalized to 0.0-1.0.

Components

ComponentDefault WeightSource
Verification0.4Trust proof count / saturation
Credential0.3Active credential count / saturation
Delegation0.2Delegation count / saturation
Revocation Penalty0.1Revocation count (subtracted)

Time Decay

When enabled, older entries contribute less to the score using exponential decay:

factor = 2^(-age_days / half_life_days)
from trusthub import TrustScorer, TrustScoringConfig

config = TrustScoringConfig(
    time_decay_enabled=True,
    decay_half_life_days=30,
    saturation_proofs=10,
)

scorer = TrustScorer(store, config=config)
score = scorer.compute_score(agent.did)
print(f"Score: {score.score}")
print(f"Components: {score.components}")

Cross-Org Scoring

# Scale score by org trust factor
cross_org = scorer.compute_cross_org_score(
    agent.did, org_trust_factor=0.8
)