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/agent-audit-trail

v0.1.0

Published

Immutable AI Agent action logging on BSV blockchain - Merkle tree anchoring with OP_RETURN

Readme

Agent Audit Trail

Immutable AI Agent action logging on BSV blockchain.

Record every AI agent action, hash it, build a Merkle tree, anchor to Bitcoin SV. Open source, free to use — pay only BSV transaction fees (~$0.01/anchor).

Features

  • Action Capture — Records tool calls, agent replies, session events automatically
  • Privacy First — Auto-redacts API keys, tokens, passwords before hashing
  • Merkle Tree — Batch actions into a single Merkle root for efficient verification
  • BSV Anchoring — OP_RETURN on Bitcoin SV blockchain, immutable and auditable
  • Verifiable Receipts — Each batch gets a receipt with Merkle proofs, independently verifiable

Quick Start

npm install agent-audit-trail
import { AuditLogger } from 'agent-audit-trail';

const logger = new AuditLogger({
  sanitize: true,
  bsvWallet: 'your-bsv-wallet-address'
});

// Record agent actions
logger.onAction({
  type: 'tool_call',
  tool: 'web_search',
  params: { query: 'BSV price' },
  sessionId: 'chat-001'
});

logger.onAction({
  type: 'tool_result',
  tool: 'web_search',
  result: { price: '$15.83' },
  sessionId: 'chat-001'
});

// Flush: build Merkle tree, generate receipt, create BSV anchor
const receipt = logger.flush();
console.log('Merkle Root:', receipt.merkleRoot);
console.log('Actions:', receipt.actionCount);
console.log('Status:', receipt.status);

Architecture

┌─────────────┐    ┌──────────┐    ┌─────────────┐    ┌───────────┐    ┌──────────┐
│ Agent Actions │───▶│ Sanitize │───▶│ SHA-256 Hash │───▶│ Merkle Tree │───▶│ BSV Anchor │
│ (tool_call,   │    │ (redact  │    │ (param hash, │    │ (batch root │    │ (OP_RETURN │
│  agent_reply) │    │  secrets)│    │  result hash)│    │  + proofs)  │    │  on-chain) │
└─────────────┘    └──────────┘    └─────────────┘    └───────────┘    └──────────┘
                                                                            │
                                                                    ┌───────▼────────┐
                                                                    │ Verifiable      │
                                                                    │ Receipt         │
                                                                    │ (Merkle proofs) │
                                                                    └────────────────┘

Verify a Receipt

const result = logger.verify(receipt);
// { valid: true, details: [{ id: '...', valid: true }, ...] }

Anyone can verify: given an action's hash, its Merkle proof, and the root (from BSV blockchain), the action's inclusion is cryptographically proven.

BSV Cost

Each anchor batch costs approximately 1/100 USD in BSV transaction fees. With default settings (100 actions per batch), that's ~$0.0001 per action verified.

OpenClaw Integration

For OpenClaw users, install as a plugin:

openclaw plugins install agent-audit-trail

Actions are captured automatically via OpenClaw hooks (before_tool_call, after_tool_call, agent_end, session_start, session_end).

API Reference

AuditLogger

| Method | Description | |--------|-------------| | onAction(event) | Record an agent action | | flush() | Batch-anchor all buffered actions | | verify(receipt) | Verify a receipt's Merkle proofs | | status() | Get current buffer and config status | | destroy() | Stop timer and final flush |

Standalone Modules

| Module | Exports | |--------|---------| | merkle.js | sha256(), buildMerkleTree(), verifyMerkleProof() | | sanitizer.js | sanitize(), DEFAULT_SANITIZE_RULES | | bsv-anchor.js | buildBSVOpReturnTx() | | receipt.js | generateReceipt() |

Why Open Source?

The value of on-chain audit trails lies in network effects. The more agents use this, the stronger the BSV ecosystem becomes, and the more indispensable the audit infrastructure gets. Free software, paid blockchain — that's the BSV way.

Roadmap

  • v0.1 — MVP: Merkle tree, sanitization, BSV OP_RETURN builder, OpenClaw plugin
  • v0.2 — REST API server, real BSV transaction signing, multi-agent support
  • v1.0 — Multi-tenant SaaS, dashboard, compliance reports, enterprise features

License

MIT — use it, fork it, build on it. Just anchor to BSV.