Quick Start
Get up and running with Web of Trust in just a few minutes.
Query the Oracle from a browser or server
Oracle v0.3.0 supports standard fetch requests. Use full 64-character hexadecimal public keys. No extension or SDK is required.
Query follow distance
async function getFollowDistance(from: string, to: string) {
const query = new URLSearchParams({ from, to, max_hops: "2" });
const response = await fetch(
"https://wot-oracle.mappingbitcoin.com/distance?" + query
);
if (!response.ok) throw new Error("Oracle HTTP " + response.status);
const data = await response.json();
return data.hops as number | null;
}
// Replace with real public keys before querying.
const hops = await getFollowDistance("a".repeat(64), "b".repeat(64));
console.log(hops === null ? "No indexed path within 2 hops" : hops);Hop values: 0 = yourself, 1 = direct follow, 2 = follow of follow. A null result means no path was found within the requested depth in the indexed graph. Coverage depends on the configured relays. The extension provides signing and identity; it does not answer graph queries.
Server (with Oracle API)
For server-side applications, use the Oracle REST API. No extension required.
Include public mute evidence
const from = "a".repeat(64); // Replace with source pubkey
const to = "b".repeat(64); // Replace with target pubkey
const query = new URLSearchParams({ from, to, max_hops: "3" });
const response = await fetch(
"https://wot-oracle.mappingbitcoin.com/trust?" + query
);
if (!response.ok) throw new Error("Oracle HTTP " + response.status);
const { follow_distance, public_mute_evidence } = await response.json();
console.log(follow_distance.hops, follow_distance.path_count);
console.log(public_mute_evidence.source_mutes_target);
console.log(public_mute_evidence.source_mute_list_known);Follow distance and public kind-10000 mute observations are separate evidence. The API does not combine them into a numeric score or decrypt private mute entries. Unknown mute lists and lists with no public entries are different states. Define your application's policy explicitly.
Using cURL
SDK compatibility
Published @nostr-wot/[email protected] uses legacy remote endpoints and response fields that Oracle v0.3.0 does not expose. Remote SDK distance queries can report null after a 404, so do not interpret that as a verified graph result. Use the fetch examples above for this Oracle.
The SDK's data, relay and identity packages remain useful independently. For local graph queries and React integration, see the verified SDK examples. useTrustScore is not part of the published WoT 1.0 API.
Build from Source
Clone the repo and build locally for development or to verify the code.
Go to chrome://extensions, enable Developer mode, click Load unpacked, and select the dist/ folder.