Understanding Web of Trust
A decentralized approach to reputation and spam filtering on Nostr, built on the principle of social distance.
The Problem
Nostr has no central authority to filter spam or verify identity. Traditional blocklists are centralized and don't scale. Web of Trust solves this by measuring social distance—how many hops separate you from someone in the follow graph.
Why Social Distance Works
People you explicitly chose to follow. High trust by definition—these are your curated connections.
Friends of friends. Still likely to be real humans with shared interests. Good for content discovery.
No meaningful connection. Could be anyone—legitimate users or spam bots. Filter or review carefully.
System Architecture
Use Cases
Web of Trust enables a wide range of applications that benefit from decentralized reputation.
Spam Filtering
Filter content by social distance without centralized blocklists. Only show content from people within 2-3 hops.
Trust Scores
Build reputation systems for marketplaces, reviews, and recommendations based on social proximity.
Smart Notifications
Prioritize notifications from close connections. Alert immediately for 1-hop, batch for 2-hop, mute beyond.
Content Discovery
Surface content from your extended network. Find interesting posts from friends-of-friends.
Code Examples
// Check if someone is in your web of trust
if (window.nostr?.wot) {
const distance = await window.nostr.wot.getDistance(pubkey);
if (distance !== null && distance <= 2) {
console.log("Trusted! " + distance + " hops away");
}
}# Query social distance between two users
curl "https://wot-oracle.example.com/distance?\
from=PUBKEY1&to=PUBKEY2"
# Response
{
"distance": 2,
"paths": 5,
"mutual": false
}Ready to Get Started?
Explore our documentation or dive straight into the code.