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

@attestia/verify

v0.2.1

Published

Deterministic replay verification and GlobalStateHash for Attestia

Readme

@attestia/verify

Part of Attestia — financial truth infrastructure for the decentralized world.

Deterministic replay verification, GlobalStateHash computation, compliance evidence generation, SLA enforcement, and tenant governance.

npm version License: MIT


At a Glance

  • Computes a content-addressed GlobalStateHash from ledger and registrum snapshots (SHA-256 + RFC 8785)
  • Replay verification proves persistence is lossless by restoring snapshots and comparing hashes
  • Quick verifyHash() path for fast checks without full replay
  • Multi-chain replay audit with per-chain hash chains and combined cross-chain verification
  • Cross-chain invariant checks: asset conservation, duplicate settlement detection, event ordering, governance consistency
  • Compliance evidence generation for SOC 2 and ISO 27001 frameworks with per-control scoring
  • SLA evaluation engine with configurable policies, thresholds, and multi-SLA batch evaluation
  • Tenant governance: create policies, suspend/reactivate tenants, assign SLA policies
  • Multi-verifier consensus aggregation for external verification networks
  • 200 tests

Installation

npm install @attestia/verify

Usage

Compute a GlobalStateHash

import { computeGlobalStateHash } from "@attestia/verify";

const globalState = computeGlobalStateHash(ledgerSnapshot, registrumSnapshot);
console.log(globalState.hash);          // SHA-256 hex string
console.log(globalState.subsystems);    // { ledger: "...", registrum: "..." }

Replay Verification

import { verifyByReplay } from "@attestia/verify";

const result = verifyByReplay({
  ledgerSnapshot,
  registrumSnapshot,
  expectedHash: "abc123...",
});

console.log(result.verdict);        // "PASS" | "FAIL"
console.log(result.discrepancies);  // [] when PASS

Quick Hash Verification (No Replay)

import { verifyHash } from "@attestia/verify";

const result = verifyHash(
  { ledgerSnapshot, registrumSnapshot },
  expectedHash,
);
// result.verdict === "PASS" if hash matches

Compliance Evidence

import {
  generateComplianceEvidence,
  SOC2_FRAMEWORK,
  SOC2_MAPPINGS,
} from "@attestia/verify";

const report = generateComplianceEvidence(SOC2_MAPPINGS, SOC2_FRAMEWORK, bundle);
console.log(report.score);           // 0-100
console.log(report.passedControls);  // number of controls passing

SLA Evaluation

import { evaluateSla } from "@attestia/verify";

const evaluation = evaluateSla(slaPolicy, currentMetrics);
console.log(evaluation.verdict);  // "COMPLIANT" | "BREACHED" | "AT_RISK"

Tenant Governance

import {
  createTenantGovernancePolicy,
  suspendTenant,
  assignSlaPolicy,
} from "@attestia/verify";

const policy = createTenantGovernancePolicy("tenant-1", { maxIntentsPerDay: 1000 });
const suspended = suspendTenant(policy, "Policy violation");
const withSla = assignSlaPolicy(policy, slaPolicy);

API

Core Verification

| Export | Description | |---|---| | computeGlobalStateHash() | Combine subsystem snapshots into a single content-addressed hash | | hashLedgerSnapshot() | SHA-256 hash of a canonical ledger snapshot | | hashRegistrumSnapshot() | SHA-256 hash of a canonical registrum snapshot | | verifyByReplay() | Full replay-based verification with discrepancy reporting | | verifyHash() | Quick hash comparison without replay |

Multi-Chain and Cross-Chain

| Export | Description | |---|---| | auditMultiChainReplay() | Replay audit across multiple chains | | computeChainHashChain() | Per-chain hash chain computation | | auditCrossChainInvariants() | Run all cross-chain invariant checks | | checkAssetConservation() | Verify no assets created or destroyed in transit | | checkNoDuplicateSettlement() | Detect duplicate settlement events |

Compliance and SLA

| Export | Description | |---|---| | generateComplianceEvidence() | Evaluate controls against system state | | SOC2_FRAMEWORK / SOC2_MAPPINGS | SOC 2 framework definition and control mappings | | ISO27001_FRAMEWORK / ISO27001_MAPPINGS | ISO 27001 framework definition and control mappings | | evaluateSla() / evaluateMultipleSla() | Evaluate SLA policies against metrics | | createTenantGovernancePolicy() | Create tenant governance policies | | suspendTenant() / reactivateTenant() | Tenant lifecycle management |

External Verification

| Export | Description | |---|---| | createStateBundle() | Package system state for external verification | | verifyBundleIntegrity() | Verify an exported state bundle | | VerifierNode / runVerification() | Run verification as an external node | | aggregateVerifierReports() | Aggregate reports from multiple verifiers | | isConsensusReached() | Check if multi-verifier consensus is met |

Ecosystem

This package is part of the Attestia monorepo with 13 sister packages:

@attestia/types | @attestia/ledger | @attestia/registrum | @attestia/vault | @attestia/treasury | @attestia/event-store | @attestia/proof | @attestia/reconciler | @attestia/chain-observer | @attestia/witness | @attestia/sdk | @attestia/node | @attestia/demo

Docs

| Document | Description | |---|---| | Architecture | System architecture overview | | API Reference | Full API documentation | | Verification Deep Dive | How replay verification works |

License

MIT