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

@logiccrafterdz/causal-verify

v0.1.1

Published

Causal Behavioral Verification - trust layer for x402/ERC-8004 ecosystem

Readme

CausalVerify

A lightweight library for causal behavioral verification in autonomous agent systems.

CausalVerify provides cryptographic proof that events happened in a specific causal order. It serves as a trust layer for payment protocols like x402, bridging identity verification and outcome validation through proven causality.

Features

  • Zero runtime dependencies (pure JavaScript/TypeScript)
  • SHA3-256 hashing (FIPS 202 compliant)
  • UUIDv7 for timestamp-ordered identifiers
  • Merkle tree proofs with O(log n) verification
  • Causal event registry with predecessor enforcement
  • secp256k1 ECDSA signing (BIP-62 compliant)
  • Browser and Node.js compatible

Installation

npm install @logiccrafterdz/causal-verify

Quick Start

import { 
  CausalEventRegistry, 
  sha3, 
  ProofGenerator, 
  verifyProof,
  generateKeyPair 
} from '@logiccrafterdz/causal-verify';

// Setup
const agentId = '0xAgentID';
const { privateKey, publicKey } = generateKeyPair();
const registry = new CausalEventRegistry(agentId);

// Register an event
const event = registry.registerEvent({
  agentId,
  actionType: 'request',
  payloadHash: sha3('payload'),
  predecessorHash: null,
  timestamp: Date.now()
});

// Generate proof
const generator = new ProofGenerator(registry);
const proof = generator.generateProof(event.causalEventId, privateKey);

// Verify
const result = verifyProof(proof, agentId, publicKey);
console.log(`Valid: ${result.isValid}, Trust: ${result.trustScore}`);

API Reference

CausalEventRegistry

const registry = new CausalEventRegistry(agentId);
registry.registerEvent(input);
registry.getEventChain(eventId, depth);
registry.generateProofPath(eventId);

ProofGenerator

const generator = new ProofGenerator(registry);
generator.generateProof(eventId, privateKey, chainDepth);

Verification

verifyProof(proof, agentId, publicKey);
verifyPrePayment(proof, agentId, publicKey, rules);
verifyCausalChain(chain, expectedHash, options);

Trust Scoring

Trust scores range from 0.0 to 1.0:

  • Base score (0.2): Cryptographic validity confirmed
  • Chain length bonus (up to 0.4): Longer verified chains increase trust
  • Recency bonus (up to 0.4): Recent events receive higher trust

Invalid proofs receive a score of 0.0.

x402 Integration

import { encodeCausalHeader, decodeCausalHeader, CAUSAL_PROOF_HEADER } from '@logiccrafterdz/causal-verify';

// Encode for HTTP header
const headerValue = encodeCausalHeader(proof);
response.setHeader(CAUSAL_PROOF_HEADER, headerValue);

// Decode from header
const proof = decodeCausalHeader(headerValue);

Security Requirements

  • Requires crypto.getRandomValues() API (modern browsers, Node.js 15+)
  • Event timestamps must be within 5 seconds of registration time
  • All payloads are stored as hashes for privacy

Progressive Verification

For performance-critical applications:

  1. Light verification (under 1ms): Fast metadata and chain continuity check
  2. Full verification (around 150ms): Complete cryptographic validation
import { ProgressiveVerifier } from '@logiccrafterdz/causal-verify';

const verifier = new ProgressiveVerifier();
const result = await verifier.verify(
  { light: lightProof, full: fullProof },
  { agentId, publicKey },
  { autoVerifyFull: true }
);

License

MIT