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

@backbay/witness

v0.1.0

Published

Browser-side verification of Backbay attestations

Readme

@backbay/witness

Browser-side verification of Backbay attestations using WebAssembly.

Features

  • Ed25519 signature verification - Verify kernel, verifier, and provider signatures
  • Merkle proof verification - Validate event inclusion proofs
  • SHA-256 and Keccak-256 hashing - Compute hashes for receipt verification
  • Chain fetchers - Fetch attestations from Rekor, EAS, and Solana
  • <200KB gzipped - Lightweight WASM bundle

Installation

npm install @backbay/witness
# or
bun add @backbay/witness

Usage

import {
  initWasm,
  verifyReceipt,
  fetchAndVerifyChain,
  sha256,
  verifyMerkleProof,
} from '@backbay/witness';

// Initialize WASM (call once at startup)
await initWasm();

// Verify a signed receipt
const result = verifyReceipt(signedReceipt, {
  kernel: '0xabc123...',
  verifier: '0xdef456...',
});

if (result.valid) {
  console.log('All signatures valid!');
} else {
  console.error('Verification failed:', result.errors);
}

// Verify complete attestation chain
const chain = await fetchAndVerifyChain(receiptId, {
  rekor: true,
  eas: { chainId: 8453 }, // Base
  solana: { cluster: 'mainnet-beta' },
});

console.log('Rekor:', chain.rekor?.verified);
console.log('EAS:', chain.eas?.verified);
console.log('Solana:', chain.solana?.verified);

API

Core Functions

initWasm(): Promise<void>

Initialize the WASM module. Must be called before any verification.

verifyReceipt(receipt, publicKeys): VerificationResult

Verify a signed RunReceipt against public keys.

verifyMerkleProof(leafHash, proof, root): boolean

Verify a Merkle inclusion proof.

sha256(data: Uint8Array): string

Compute SHA-256 hash.

keccak256(data: Uint8Array): string

Compute Keccak-256 hash (Ethereum-compatible).

verifySignature(publicKey, message, signature): boolean

Verify an Ed25519 signature.

Chain Verification

fetchAndVerifyChain(receiptId, options): Promise<AttestationChain>

Fetch and verify attestations from multiple sources:

  • Rekor - Sigstore transparency log
  • EAS - Ethereum Attestation Service
  • Solana - Aegis Registry

Configuration

All chain verifiers support custom configuration for endpoints, program IDs, and RPC URLs. This allows using private infrastructure without forking the code.

Simple Configuration

const chain = await fetchAndVerifyChain(receiptHash, {
  rekor: true,
  eas: { chainId: 8453 },           // Base
  solana: { cluster: 'devnet' },
});

Advanced Configuration

const chain = await fetchAndVerifyChain(receiptHash, {
  rekor: true,
  eas: {
    chainId: 8453,
    graphqlUrl: 'https://my-graphql.example.com',  // Custom GraphQL
    rpcUrl: 'https://my-rpc.example.com',          // Custom RPC
  },
  solana: {
    cluster: 'mainnet-beta',
    rpcUrl: 'https://my-solana-rpc.example.com',   // Custom RPC
    programIds: {
      registryProgramId: 'MyProgramId...',         // Custom program
    },
    commitment: 'finalized',                        // Commitment level
  },
});

Solana Configuration

The Solana fetcher supports these options:

| Option | Type | Default | Description | |--------|------|---------|-------------| | cluster | 'mainnet-beta' \| 'devnet' \| 'testnet' | Required | Solana cluster | | rpcUrl | string | Public cluster endpoint | Custom RPC endpoint | | programIds.registryProgramId | string | From infra/solana/program_ids.json | Aegis Registry program ID | | programIds.feeMarketProgramId | string | None | Aegis Fee Market program ID | | commitment | 'processed' \| 'confirmed' \| 'finalized' | 'confirmed' | Connection commitment |

Direct Solana fetcher usage:

import { fetchFromSolana, SolanaConfig } from '@backbay/witness/fetchers/solana';

const config: SolanaConfig = {
  cluster: 'devnet',
  rpcUrl: 'https://my-rpc.example.com',
  programIds: {
    registryProgramId: '5612LDBwkX4voFX4PP3mwHnrVigveTEXDxH7tAaxN5P8',
  },
};

const result = await fetchFromSolana(receiptHash, config);

Default program IDs are sourced from infra/solana/program_ids.json:

| Cluster | Registry Program ID | |---------|---------------------| | devnet | 5612LDBwkX4voFX4PP3mwHnrVigveTEXDxH7tAaxN5P8 | | mainnet-beta | Not deployed | | testnet | Not deployed |

EAS Configuration

The EAS fetcher supports these options:

| Option | Type | Default | Description | |--------|------|---------|-------------| | chainId | number | Required | EVM chain ID | | graphqlUrl | string | Public EASScan endpoint | Custom GraphQL endpoint | | rpcUrl | string | Public RPC | Custom RPC for tx lookups |

Supported chains:

| Chain | ID | Default GraphQL Endpoint | |-------|-----|-------------------------| | Ethereum | 1 | https://easscan.org/graphql | | Optimism | 10 | https://optimism.easscan.org/graphql | | Arbitrum | 42161 | https://arbitrum.easscan.org/graphql | | Base | 8453 | https://base.easscan.org/graphql |

Direct EAS fetcher usage:

import { fetchFromEAS, EASConfig } from '@backbay/witness/fetchers/eas';

const config: EASConfig = {
  chainId: 8453,
  graphqlUrl: 'https://my-graphql.example.com',
  rpcUrl: 'https://my-rpc.example.com',
};

const result = await fetchFromEAS(receiptHash, config);

Helper Functions

The Solana module exports helper functions for offline use:

import {
  deriveReceiptPDA,
  deriveConfigPDA,
  parseReceiptAccount,
  parseRegistryConfig,
  receiptHashToBytes,
  normalizeReceiptHash,
} from '@backbay/witness/fetchers/solana';

// Derive PDA without network calls
const [receiptPda, bump] = deriveReceiptPDA(
  '0xabcd...',
  '5612LDBwkX4voFX4PP3mwHnrVigveTEXDxH7tAaxN5P8'
);

// Parse account data from raw bytes
const receiptData = parseReceiptAccount(rawAccountBytes);
console.log(receiptData.status); // 'verified' | 'pending' | 'quarantined'

Testing

Run the test suite:

cd packages/witness
bun install
bun test

Tests are fully offline - they use fixture bytes to verify parsing logic without making network calls.

Building from Source

# Build WASM
./scripts/build-wasm.sh

# Or manually:
cd crates/cyntra-trust-wasm
wasm-pack build --target web --release

License

MIT