npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iteotwawki/dkg-contestation

v0.1.0

Published

A framework-agnostic contestation protocol for DKG Shared Memory — agents challenge and corroborate each other's knowledge assertions, and a confidence model turns multi-agent scrutiny into a real trust signal.

Readme

dkg-contestation

A framework-agnostic contestation protocol for the OriginTrail DKG (v10 Shared Memory).

Everyone else captures knowledge and tags its provenance. This lets agents stress-test each other's knowledge — and lets confidence emerge from who survives scrutiny.

Agents publish knowledge claims to DKG Shared Memory. Other agents challenge or corroborate them with evidence. A pure confidence model turns that multi-agent scrutiny into a real trust signal that matures along v10's trust gradient:

self-attested  ──►  endorsed  ──►  consensus-verified
   (c0=0.30)      (≥1 indep,     (≥k indep corroborators,
                   0 challenges)   high confidence, 0 challenges)

A claim cannot mature while a single unrebutted challenge stands. Confidence is earned by surviving challenge, not by accumulating easy agreement.


Why this exists

Multi-agent systems increasingly share memory — but shared memory with no adversarial check is just a louder echo chamber. A wrong claim, corroborated by ten copies of the same agent, looks authoritative. This protocol makes knowledge contestable: every assertion carries a confidence score that reflects how much independent scrutiny it has survived, with built-in sybil resistance so a swarm citing the same source can't manufacture consensus.

The confidence kernel is a pure function of (evidence, agent-diversity, agent-reputation) with no framework coupling — which is exactly what a Bittensor-style subnet would need as a validator scoring mechanism. See DESIGN.md for the full specification and forward path.


Install

# via the DKG integrations registry (recommended)
dkg integration install dkg-contestation

# or directly from npm
npm install -g @iteotwawki/dkg-contestation   # CLI: dkg-contest
npm install @iteotwawki/dkg-contestation      # library

The CLI auto-discovers your node token when dkg integration install wires it; otherwise set DKG_API_URL (default http://127.0.0.1:9200) and DKG_AUTH_TOKEN (or DKG_HOME).


Quickstart

CLI

# Score a contestation graph OFFLINE — no node required (this is the confidence kernel)
echo '{"claim":{"id":"c:1","statement":"...","author":"0xA","createdAt":"2026-06-17T00:00:00Z"},
       "challenges":[],
       "corroborations":[{"id":"k1","supports":"c:1","corroborator":"0xB",
         "independence":"IndependentSource",
         "evidence":[{"id":"e1","kind":"OnChainFact","source":"tx:1","hash":"h"}],
         "createdAt":"2026-06-17T01:00:00Z"}]}' | dkg-contest score

# Run a full contestation round against your live DKG node
dkg-contest demo

# Publish a single claim
dkg-contest claim "SN15 emissions favor low-latency inference miners"

Library

import {
  ContestationEngine,
  HttpDkgTransport,
  ReputationLedger,
  EvidenceKind,
  Independence,
  ChallengeGrounds,
} from '@iteotwawki/dkg-contestation';

const transport = new HttpDkgTransport({ dkgHome: process.env.DKG_HOME });
const engine = new ContestationEngine({
  transport,
  contextGraphId: `contestation-${Date.now()}`,
  reputation: new ReputationLedger(),
});

// 1. an agent publishes a claim
const claim = await engine.publishClaim({
  statement: 'Contestation produces a real quality signal.',
});
engine.confidence(claim.id);        // → tier: self-attested, confidence: 0.30

// 2. another agent corroborates with independent on-chain evidence
await engine.corroborate({
  claimId: claim.id,
  corroborator: '0xCorroboratorA',
  independence: Independence.IndependentSource,
  evidence: [{ id: 'ev:a', kind: EvidenceKind.OnChainFact, source: 'tx:0xfeed', hash: 'h:a' }],
});

// 3. a skeptic challenges it
const challenge = await engine.challenge({
  claimId: claim.id,
  challenger: '0xSkeptic',
  groundsType: ChallengeGrounds.MissingEvidence,
  evidence: [{ id: 'ev:c', kind: EvidenceKind.Citation, source: 'doc:doubt', hash: 'h:c' }],
});
engine.confidence(claim.id);        // → still self-attested: an open challenge vetoes maturation

// 4. the author rebuts; the claim can mature again
await engine.corroborate({
  claimId: claim.id, corroborator: claim.author,
  independence: Independence.SecondaryConfirm,
  rebuts: challenge.id, rebuttalStrength: 1,
  evidence: [{ id: 'ev:r', kind: EvidenceKind.Measurement, source: 'measure:1', hash: 'h:r' }],
});

const verdict = await engine.settle(claim.id);   // folds outcomes into reputation

The pure kernel is also usable standalone, no node, no I/O:

import { computeConfidence } from '@iteotwawki/dkg-contestation';
const verdict = computeConfidence(contestationGraph);   // { confidence, tier, ... }

The confidence model in one paragraph

Each new assertion recomputes a scalar pressure: corroborations push it up, open challenges pull it down, each weighted by evidence kind (OnChainFact > Replication > Measurement > Citation > Derivation), a diversity discount indep(), and the agent's reputation. Pressure is squashed around the self-attested floor c0 into confidence ∈ [0,1]. indep() is the anti-gaming core: it discounts corroborators whose evidence sources overlap (graded Jaccard similarity) — amplified when they also publish within a short time window (a swarm signal). Tier promotion is hard-gated on zero open challenges, so falsification always beats confirmation. Full math, parameters, and the subnet-scoring forward path are in DESIGN.md; the agent-facing contract is in SKILL.md.


Architecture

ContestationEngine          orchestrates claim/challenge/corroborate/settle
   ├── computeConfidence()  PURE confidence kernel  (confidence.ts)  ← the moat
   ├── ReputationLedger     EWMA over settled outcomes (reputation.ts)
   └── DkgTransport         the framework-agnostic seam (transport.ts)
        └── HttpDkgTransport  reference impl over the DKG v10 rc.17 HTTP API

Any client — Hermes, OpenClaw, an MCP server, a raw HTTP script — participates by implementing the DkgTransport interface or by speaking the ct: ontology over the node's HTTP API. Nothing in the core imports any agent runtime.


Memory layers & cost

| layer | cost | trust tier | role | |---|---|---|---| | WM Working Memory | free, local | self-attested | the draft | | SWM Shared Memory | free, replicated | self-attested → endorsed | the contestation arena | | VM Verifiable Memory | gas | consensus-verified | durable publish, earned by surviving contestation |

This protocol operates entirely in the free WM/SWM tiers. On-chain VM publish is a later, operator-gated step — a claim only crosses the spend boundary once it has earned consensus-verified.


Develop

npm install
npm run typecheck
npm run build
npm run test:unit          # 22 pure-kernel tests, no node needed
npm run test:integration   # full round against a live DKG node (set DKG_API_URL + DKG_HOME)
npm test                   # everything

License

Apache-2.0.