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

@mingchain/bsv-geo-shield

v0.1.0

Published

BSV-powered GEO poisoning defense for AI — data attestation, RAG verification, trust network on blockchain

Downloads

122

Readme

BSV-GEO Shield

BSV-powered GEO poisoning defense for AI — data attestation, RAG verification, trust network on blockchain.

Protect your AI systems from GEO (Generative Engine Optimization) poisoning attacks. BSV-GEO Shield verifies RAG retrieval data, anchors content provenance on BSV blockchain, and filters poisoned data before it reaches your LLM.

Open source, MIT licensed — pay only BSV transaction fees (~$0.01/anchor).

Features

  • Data Attestation — Hash content, build Merkle tree, anchor to BSV OP_RETURN
  • RAGShield Verification — Real-time verification of RAG-retrieved documents
  • Trust Network — Decentralized reputation scoring for content sources
  • Risk Assessment — Multi-dimensional scoring: attestation, hash, timestamp, reputation
  • Fallback Strategies — Filter, reduce weight, or flag untrusted content
  • BSV Anchoring — Immutable on-chain proof, SPV verifiable

Quick Start

npm install @mingchain/bsv-geo-shield
import { GEOShield, createGEOShield } from '@mingchain/bsv-geo-shield';

// Create shield instance
const shield = new GEOShield({
  bsvWallet: 'your-bsv-wallet-address'
});

// Attest training data
const batch = shield.attestBatch([
  { content: 'Medical research text...', metadata: { title: 'Research', sourceDomain: 'nih.gov' } },
  { content: 'Academic article...', metadata: { title: 'Paper', sourceDomain: 'arxiv.org' } }
]);
console.log('Merkle Root:', batch.merkleRoot);
console.log('BSV Anchor TX:', batch.bsvAnchorTx?.unsignedHex);

// Verify RAG retrieved documents
const { results, allowed, rejected, stats } = shield.verify([
  { id: 'doc1', content: 'Medical research...', sourceDomain: 'nih.gov' },
  { id: 'doc2', content: 'Unknown content...', sourceDomain: 'suspicious-site.xyz' }
]);

results.forEach(r => {
  console.log(`${r.documentId}: ${r.status} (${r.trustLevel}) - ${r.confidenceScore.toFixed(2)}`);
});

Architecture

┌──────────────┐    ┌───────────────┐    ┌─────────────────┐    ┌──────────────┐
│ Data Source  │───▶│DataAttestation│───▶│Merkle Aggregation│───▶│ BSV Anchor   │
│ (content)    │    │ (hash+index)  │    │ (batch root)    │    │ (OP_RETURN)  │
└──────────────┘    └───────────────┘    └─────────────────┘    └──────────────┘
                                                                      │
┌──────────────┐    ┌───────────────┐    ┌─────────────────┐         │
│ RAG Retrieval│───▶│RAGShieldVerify│───▶│  TrustNetwork   │─────────┘
│ (documents)  │    │ (attest+hash+ │    │ (reputation     │
│              │    │  timestamp+   │    │  scoring)       │
│              │    │  reputation)  │    │                 │
└──────────────┘    └───────────────┘    └─────────────────┘

Core Modules

| Module | Description | |--------|-------------| | DataAttestation | SHA-256 hash → Merkle tree → BSV OP_RETURN anchoring | | RAGShieldVerifier | Multi-dimensional document verification | | TrustNetwork | Decentralized reputation scoring network | | BSV Anchor | OP_RETURN transaction builder (unsigned, ready to sign) |

API Reference

GEOShield

Main unified class for GEO poisoning defense.

const shield = new GEOShield(options);

Options:

  • bsvWallet — BSV wallet address for anchoring
  • policyVerificationPolicy.DEFAULT | STRICT | RELAXED
  • attestationOptions — DataAttestation config
  • trustNetworkOptions — TrustNetwork config

Methods:

// Attest single content
shield.attest({ content, metadata });

// Batch attest + flush (builds Merkle tree)
shield.attestBatch([{ content, metadata }, ...]);

// Verify RAG documents
shield.verify([{ id, content, metadata }, ...]);

// Get reputation for a source
shield.getReputation('wikipedia.org', 'domain');

// Register reputation score
shield.registerReputation({ subjectId, finalScore, tier });

// Get system status
shield.status();

DataAttestation

import { DataAttestation } from '@mingchain/bsv-geo-shield';

const attester = new DataAttestation({ bsvWallet: '...', batchSize: 50 });

// Create attestation
const record = attester.attest({ content: '...', metadata: {...} });

// Flush pending: build Merkle tree, create BSV anchor tx
const { batchId, merkleRoot, records, anchorTx } = attester.flush();

// Verify content
const result = attester.verify(content, attestationId);

RAGShieldVerifier

import { RAGShieldVerifier, RAGDocument, VerificationPolicy } from '@mingchain/bsv-geo-shield';

const verifier = new RAGShieldVerifier({ policy: VerificationPolicy.STRICT });
verifier.setAttestations(attester); // Connect to attestation records

// Verify documents
const docs = [
  new RAGDocument({ id: 'd1', content: '...', sourceDomain: 'wikipedia.org' }),
  new RAGDocument({ id: 'd2', content: '...', sourceDomain: 'unknown.xyz' })
];

const results = verifier.verifyDocuments(docs);
const { allowed, rejected } = verifier.applyFallback(docs, results);

TrustNetwork

import { TrustNetwork, TrustTier } from '@mingchain/bsv-geo-shield';

const network = new TrustNetwork();

// Query reputation
const rep = network.getReputation('wikipedia.org');
// { finalScore: 0.8, tier: 'high', totalReviews: 100, isTrusted: true }

// Register new reputation
network.registerReputation({
  subjectId: 'new-source.com',
  finalScore: 0.7,
  tier: TrustTier.MEDIUM,
  participantIds: ['r1', 'r2', 'r3']
});

// Batch query
network.batchGetReputation([
  { subjectId: 'wikipedia.org' },
  { subjectId: 'github.com' }
]);

Verification Policies

import { VerificationPolicy } from '@mingchain/bsv-geo-shield';

// Standard (default)
const standard = new VerificationPolicy();

// Strict: require attestation, 3+ confirmations, 0.7 min reputation
const strict = VerificationPolicy.STRICT;

// Relaxed: no attestation required
const relaxed = VerificationPolicy.RELAXED;

// Custom
const custom = new VerificationPolicy({
  requireAttestation: true,
  minConfirmations: 1,
  verifyContentHash: true,
  checkTimestampAnomaly: true,
  checkReputation: true,
  minReputationScore: 0.5,
  weights: { attestation: 0.4, hash: 0.2, timestamp: 0.1, reputation: 0.3 },
  fallbackMode: 'filter', // filter | reduce_weight | flag
  lowScoreThreshold: 0.3
});

BSV Cost

Each BSV anchor transaction costs approximately $0.01 in transaction fees (at BSV ~$500):

| Batch Size | Cost per Item | |------------|---------------| | 50 items | ~$0.0002 | | 100 items | ~$0.0001 | | 1000 items | ~$0.00001 |

With default settings (50 items/batch), that's less than $0.001 per document verified.

Commercial Model

Software is free. The blockchain is the business.

BSV-GEO Shield is MIT-licensed open source. The revenue comes from BSV blockchain usage — every anchor creates a BSV transaction.

Tiers

  • Free (Open Source): Self-deployed, user pays own BSV fees
  • Hosted (Future): Minglian Tech SaaS API, no BSV wallet needed
  • Enterprise (Future): Private deployment, custom policies, SLA

See docs/commercial.md for full details.

OpenClaw Integration

Add to your openclaw.plugin.json skills:

{
  "skills": ["skills/bsv-geo-shield"]
}

Or use the OpenClaw plugin config at openclaw-plugin/openclaw.plugin.json.

License

MIT — see LICENSE

Links

  • GitHub: https://github.com/minglian-tech/bsv-geo-shield
  • npm: https://www.npmjs.com/package/@mingchain/bsv-geo-shield
  • BSV Blockchain: https://bsvblockchain.org/