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

@gtcx/protocol-tradepass

v0.1.0

Published

TradePass Protocol - Identity & Authorization for GTCX

Readme

@gtcx/protocol-tradepass

Universal identity, credential, and verification protocol for the GTCX ecosystem.

Overview

TradePass provides decentralized identity (W3C DID), verifiable credentials (W3C VC), and a predicate-based claim model for global commodity trade. It enables any entity, asset, or transaction to be verified with cryptographic proof. The protocol supports 12 operator credential types, offline operation for up to 45 days, and selective disclosure via BBS+ signatures.

Key Concepts

  • DID Identity -- Self-sovereign W3C Decentralized Identifiers (did:gtcx:tp_<hash>) with biometric binding and role-based access.
  • Biometric Keygen -- HKDF-derived keys bound to biometric hashes and device identifiers.
  • Verifiable Credentials -- Credentials for all 12 operator types (Producer, Aggregator, Vault, Refiner, Buyer, etc.) with full lifecycle management.
  • Predicates and Claims -- Predicates define what can be verified (80+ types across 9 domains); claims are specific assertions with evidence, confidence scores, and cryptographic proof.
  • Composite Predicates -- Simple predicates compose into complex verification bundles (e.g., Deal Due Diligence = KYC + Origin + Sanctions + Quality + Custody).
  • TradeCV -- Portable reputation credential capturing a producer's verifiable transaction history and milestone progression.
  • Confidence Scoring -- Every claim includes a weighted confidence score derived from evidence strength, attestor trust, temporal decay, and corroboration.

Usage

import {
  createDID,
  issueCredential,
  verifyCredential,
  createClaimService,
  createPredicateRegistry,
  evaluateComposite,
} from '@gtcx/protocol-tradepass';

// Create a decentralized identity
const did = createDID({ role: 'producer', region: 'gh-ashanti' });

// Issue a verifiable credential
const credential = issueCredential({ subject: did.id, type: 'ProducerID' });

// Evaluate composite compliance
const result = evaluateComposite(COMMODITY_DEAL_DUE_DILIGENCE, claims);

API

Identity and Credentials

  • createDID -- Create a new decentralized identifier
  • issueCredential / verifyCredential -- Issue and verify W3C verifiable credentials
  • createIdentityStore -- Persistent identity management
  • deriveBiometricKey -- Derive HKDF key material from biometric enrollment + device binding

Roles and Permissions

  • assignRole / revokeRole -- Manage operator roles (producer, vault, refiner, buyer, etc.)
  • checkPermission -- Evaluate role-based permissions against the capability matrix
  • createTradePassPEP / tradePassRolesToPolicyRules -- Auth adapter for @gtcx/auth

Predicate Engine

  • createPredicateRegistry -- Registry for predicate definitions
  • PREDICATE_SEEDS -- Built-in predicate definitions (80+)
  • createClaimService -- Create, attest, and manage claim lifecycle
  • calculateConfidence / getAttestorTrustScore / calculateTemporalDecay -- Confidence scoring
  • validateEvidence / calculateEvidenceStrength -- Evidence validation
  • evaluateComposite / COMMODITY_DEAL_DUE_DILIGENCE -- Composite predicate evaluation

Trust and Infrastructure

  • calculateTrustScore -- Compute trust scores for attestors
  • createEventLog -- Immutable event log with hash chain integrity
  • createOfflineQueue -- Offline operation support (up to 45 days)

Specification

See SPEC.md for the full protocol specification.

Persistence

  • Postgres adapters: postgres-identity-store.ts
  • Offline queue: offline-queue.ts — syncs claims and attestations when connectivity returns

Testing

pnpm vitest run protocols/tradepass/

**Coverage summary**: 34 test files, ~925 tests

License

BSL 1.1 -- converts to Apache 2.0 on January 1, 2030.