JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q57569F
  • License MIT

Depth-of-Identity SDK. Query Nostr relays for a pubkey's chain depth across spatial, social, access, and vouch dimensions.

Package Exports

  • @powforge/identity
  • @powforge/identity/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@powforge/identity) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@powforge/identity

Depth-of-Identity SDK for Nostr. Measures accumulated irreversible work across four dimensions to produce a single identity weight score.

Built on the idea that identity is not a credential -- it is accumulated proof-of-work across time, space, social graphs, and economic commitments.

Install

npm install @powforge/identity

Quick Start

const { getIdentityDepth } = require('@powforge/identity');

const report = await getIdentityDepth(pubkey, {
  relays: ['wss://relay.powforge.dev'],
});

console.log(report.weight);      // total identity depth score
console.log(report.dimensions);  // breakdown by dimension

What It Measures

Four dimensions of identity depth:

Dimension What It Scores Event Kinds
Spatial Cyberspace movement proofs, unique regions explored kind:3333
Social Notes published, reactions given, unique peers interacted with kind:1, kind:7
Access NIP-13 proof-of-work accumulated across all events nonce tags
Vouch Inbound vouches from other identities, weighted by voucher depth with sqrt dilution kind:33335

API

getIdentityDepth(pubkey, options?)

Returns a full identity report for a hex pubkey.

Options:

Option Default Description
relays ['ws://localhost:3088'] Array of relay WebSocket URLs to query
timeout 5000 Query timeout per relay in ms
dimensions ['spatial', 'social', 'access', 'vouch'] Which dimensions to score

Returns:

{
  "pubkey": "93da4435...",
  "totalEvents": 3,
  "weight": 24,
  "dimensions": {
    "spatial": { "events": 3, "uniqueRegions": 3, "proofsVerified": 3, "score": 21 },
    "social": { "notes": 0, "reactions": 0, "uniquePeers": 0, "score": 0 },
    "access": { "totalEvents": 3, "totalPowBits": 0, "maxDifficulty": 0, "score": 3 },
    "vouch": { "inboundVouches": 0, "uniqueVouchers": 0, "totalWeight": 0, "score": 0 }
  },
  "firstActivity": "2026-04-12T17:25:47.000Z",
  "lastActivity": "2026-04-13T21:01:16.000Z",
  "relaysQueried": 1
}

queryRelay(relayUrl, filters, timeout?)

Low-level function to query a single relay for events matching NIP-01 filters.

HTTP API

If you run a PowForge relay, the identity endpoint is available at:

GET /api/identity/:pubkey

Returns the same JSON report as getIdentityDepth().

How Scoring Works

  • Spatial: events * 2 + uniqueRegions * 5
  • Social: notes * 3 + reactions + uniquePeers * 10
  • Access: totalPowBits * 2 + totalEvents
  • Vouch: totalWeight * 3 + uniqueVouchers * 20 (sqrt dilution prevents vouch farming)

The total weight is the sum of all dimension scores. Higher weight means more accumulated, irreversible work.

Why Not Just Check Follower Count?

Follower counts are trivially faked. This SDK measures things that cost real resources to produce: computation (PoW), time (event history), movement (spatial proofs), and social commitment (vouches backed by depth). Every dimension requires irreversible expenditure to increase.

License

MIT