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

opentrustprotocol

v3.0.0

Published

๐ŸŸจ Official JavaScript SDK for OpenTrust Protocol - The mathematical embodiment of trust itself. Features neutrosophic judgments, fusion operators, OTP mappers, REVOLUTIONARY Conformance Seals, and Performance Oracle with Circle of Trust for real-world ou

Readme

๐ŸŸจ OpenTrust Protocol (OTP) - JavaScript SDK

npm version Documentation License: MIT TypeScript

๐ŸŸจ REVOLUTIONARY UPDATE: OTP v3.0 introduces Performance Oracle & Circle of Trust

The official JavaScript/TypeScript implementation of the OpenTrust Protocol - The mathematical embodiment of trust itself

๐ŸŒŸ REVOLUTIONARY UPDATE: v3.0.0 - Performance Oracle & Circle of Trust

๐Ÿ” The Zero Pillar: Mathematical Proof of Conformance

OTP v3.0 introduces Conformance Seals - cryptographic SHA-256 hashes that provide mathematical, irrefutable proof that every fusion operation was performed according to the exact OTP specification.

This solves the fundamental paradox: "Who audits the auditor?"

With Conformance Seals, OTP audits itself through mathematics.

๐Ÿ”ฎ The First Pillar: Performance Oracle & Circle of Trust

OTP v3.0 introduces the Performance Oracle - a revolutionary system that enables tracking real-world outcomes and measuring the effectiveness of OTP-based decisions.

The Circle of Trust creates a feedback loop between decisions and outcomes:

  • ๐Ÿ†” Judgment IDs: Unique SHA-256 identifiers for every decision
  • ๐ŸŒ Outcome Tracking: Link decisions with real-world results
  • ๐Ÿ“Š Performance Measurement: Measure calibration and effectiveness
  • ๐Ÿ”„ Learning Loop: Continuous improvement through feedback
  • ๐ŸŽฏ Trust Validation: Prove that OTP decisions lead to better outcomes

๐Ÿš€ The Revolution

  • โœ… Mathematical Proof: SHA-256 hashes prove 100% conformance to OTP specification
  • โœ… Self-Auditing: OTP verifies its own operations through cryptography
  • โœ… Tamper Detection: Any modification breaks the mathematical proof
  • โœ… Independent Verification: Anyone can verify conformant operations
  • โœ… Decentralized Trust: No central authority needed for verification

๐Ÿš€ What is OpenTrust Protocol?

The OpenTrust Protocol (OTP) is a revolutionary framework for representing and managing uncertainty, trust, and auditability in AI systems, blockchain applications, and distributed networks. Built on neutrosophic logic, OTP provides a mathematical foundation for handling incomplete, inconsistent, and uncertain information.

With Conformance Seals, OTP transforms from a trust protocol into the mathematical embodiment of trust itself.

๐ŸŽฏ Why OTP Matters

  • ๐Ÿ”’ Trust & Security: Quantify trust levels in AI decisions and blockchain transactions
  • ๐Ÿ“Š Uncertainty Management: Handle incomplete and contradictory information gracefully
  • ๐Ÿ” Full Auditability: Complete provenance chain for every decision
  • ๐ŸŒ Cross-Platform: Interoperable across Python, JavaScript, Rust, and more
  • โšก Performance: Optimized for both browser and Node.js environments

๐ŸŸจ JavaScript SDK Features

๐Ÿ” Revolutionary Core Components

  • Neutrosophic Judgments: Represent evidence as (T, I, F) values where T + I + F โ‰ค 1.0
  • Conformance Seals: Cryptographic SHA-256 proof of OTP specification compliance
  • Fusion Operators: Combine multiple judgments with automatic Conformance Seal generation
  • OTP Mappers: Transform raw data into neutrosophic judgments
  • Provenance Chain: Complete audit trail with cryptographic verification

๐Ÿ” Conformance Seals API

import { 
  generateConformanceSeal,
  verifyConformanceSealWithInputs,
  createFusionProvenanceEntry,
  ConformanceError 
} from 'opentrustprotocol';

// Generate a Conformance Seal
const seal = generateConformanceSeal(judgments, weights, "otp-cawa-v1.1");
console.log(`๐Ÿ” Conformance Seal: ${seal}`);

// Verify mathematical proof
const isValid = verifyConformanceSealWithInputs(fusedJudgment, inputJudgments, weights);
if (isValid) {
  console.log('โœ… Mathematical proof of conformance verified!');
}

// Create provenance entry with seal
const provenanceEntry = createFusionProvenanceEntry(
  "otp-cawa-v1.1",
  new Date().toISOString(),
  seal,
  "Conflict-aware weighted average fusion operation"
);

๐Ÿ†• OTP Mapper System (v2.0.0)

Transform any data type into neutrosophic judgments:

import { NumericalMapper, CategoricalMapper, BooleanMapper } from 'opentrustprotocol';
import { NumericalParams, CategoricalParams, BooleanParams } from 'opentrustprotocol';

// DeFi Health Factor Mapping
const healthMapper = new NumericalMapper(new NumericalParams({
  id: "defi-health-factor",
  version: "1.0.0",
  falsityPoint: 1.0,      // Liquidation threshold
  indeterminacyPoint: 1.5, // Warning zone  
  truthPoint: 2.0,        // Safe zone
  clampToRange: true
}));

// Transform health factor to neutrosophic judgment
const judgment = healthMapper.apply(1.8);
console.log(`Health Factor 1.8: T=${judgment.T.toFixed(3)}, I=${judgment.I.toFixed(3)}, F=${judgment.F.toFixed(3)}`);

Available Mappers

| Mapper Type | Use Case | Example | |-------------|----------|---------| | NumericalMapper | Continuous data interpolation | DeFi health factors, IoT sensors | | CategoricalMapper | Discrete category mapping | KYC status, product categories | | BooleanMapper | Boolean value transformation | SSL certificates, feature flags |

๐Ÿ“ฆ Installation

npm install opentrustprotocol

๐Ÿš€ Quick Start

๐Ÿ” Revolutionary: Conformance Seals in Action

import { 
  NeutrosophicJudgment, 
  conflict_aware_weighted_average,
  generateConformanceSeal,
  verifyConformanceSealWithInputs 
} from 'opentrustprotocol';

// Create judgments with provenance
const judgment1 = new NeutrosophicJudgment(
  0.8, 0.2, 0.0,
  [{
    source_id: 'sensor1',
    timestamp: '2023-01-01T00:00:00Z'
  }]
);

const judgment2 = new NeutrosophicJudgment(
  0.6, 0.3, 0.1,
  [{
    source_id: 'sensor2',
    timestamp: '2023-01-01T00:00:00Z'
  }]
);

// **REVOLUTIONARY**: Fuse with automatic Conformance Seal generation
const fused = conflict_aware_weighted_average(
  [judgment1, judgment2],
  [0.6, 0.4]
);

// Extract the Conformance Seal
const lastEntry = fused.provenance_chain[fused.provenance_chain.length - 1];
const conformanceSeal = (lastEntry as any).conformance_seal;

console.log(`๐Ÿ” Conformance Seal: ${conformanceSeal.substring(0, 16)}...`);
console.log(`๐Ÿ“ˆ Fused Result: T=${fused.T.toFixed(3)}, I=${fused.I.toFixed(3)}, F=${fused.F.toFixed(3)}`);

// **MATHEMATICAL PROOF**: Verify the seal
const isValid = verifyConformanceSealWithInputs(
  fused, 
  [judgment1, judgment2], 
  [0.6, 0.4]
);

if (isValid) {
  console.log('โœ… MATHEMATICAL PROOF OF CONFORMANCE VERIFIED!');
  console.log('   The judgment is mathematically proven to be conformant.');
} else {
  console.log('โŒ Conformance verification failed!');
}

Real-World Example: DeFi Risk Assessment

import { 
  NumericalMapper, CategoricalMapper, BooleanMapper,
  NumericalParams, CategoricalParams, BooleanParams,
  JudgmentData, conflict_aware_weighted_average
} from 'opentrustprotocol';

// 1. Health Factor Mapper
const healthMapper = new NumericalMapper(new NumericalParams({
  id: "health-factor",
  version: "1.0.0",
  falsityPoint: 1.0,
  indeterminacyPoint: 1.5,
  truthPoint: 2.0,
  clampToRange: true
}));

// 2. KYC Status Mapper
const kycMappings = new Map([
  ["VERIFIED", new JudgmentData(0.9, 0.1, 0.0)],
  ["PENDING", new JudgmentData(0.3, 0.7, 0.0)],
  ["REJECTED", new JudgmentData(0.0, 0.0, 1.0)]
]);

const kycMapper = new CategoricalMapper(new CategoricalParams({
  id: "kyc-status",
  version: "1.0.0",
  mappings: kycMappings,
  defaultJudgment: null
}));

// 3. SSL Certificate Mapper
const sslMapper = new BooleanMapper(new BooleanParams({
  id: "ssl-cert",
  version: "1.0.0",
  trueMap: new JudgmentData(0.9, 0.1, 0.0),
  falseMap: new JudgmentData(0.0, 0.0, 1.0)
}));

// 4. Transform data to judgments
const healthJudgment = healthMapper.apply(1.8);
const kycJudgment = kycMapper.apply("VERIFIED");
const sslJudgment = sslMapper.apply(true);

// 5. Fuse for final risk assessment
const riskAssessment = conflict_aware_weighted_average(
  [healthJudgment, kycJudgment, sslJudgment],
  [0.5, 0.3, 0.2]  // Health factor most important
);

console.log(`DeFi Risk Assessment: T=${riskAssessment.T.toFixed(3)}, I=${riskAssessment.I.toFixed(3)}, F=${riskAssessment.F.toFixed(3)}`);

๐Ÿ—๏ธ Architecture

Performance & Reliability

  • ๐Ÿ”’ Memory Efficient: Optimized for both browser and Node.js
  • โšก Fast Execution: V8-optimized operations with minimal overhead
  • ๐Ÿ”„ Thread Safe: Safe concurrent access with proper async handling
  • ๐Ÿ“ฆ Minimal Dependencies: Only essential packages for reliability

Mapper Registry System

import { getGlobalRegistry } from 'opentrustprotocol';

const registry = getGlobalRegistry();

// Register mappers
registry.register(healthMapper);
registry.register(kycMapper);

// Retrieve and use
const mapper = registry.get("health-factor");
const judgment = mapper.apply(1.5);

// Export configurations
const configs = registry.export();

๐Ÿงช Testing

Run the comprehensive test suite:

npm test
npm run test:coverage

Run examples:

npm run example:mapper

๐Ÿ“Š Use Cases

๐Ÿ”— Blockchain & DeFi

  • Risk Assessment: Health factors, liquidation risks
  • KYC/AML: Identity verification, compliance scoring
  • Oracle Reliability: Data source trust evaluation

๐Ÿค– AI & Machine Learning

  • Uncertainty Quantification: Model confidence scoring
  • Data Quality: Input validation and reliability
  • Decision Fusion: Multi-model ensemble decisions

๐ŸŒ IoT & Sensors

  • Sensor Reliability: Temperature, pressure, motion sensors
  • Data Fusion: Multi-sensor decision making
  • Anomaly Detection: Trust-based outlier identification

๐Ÿญ Supply Chain

  • Product Tracking: Status monitoring and verification
  • Quality Control: Defect detection and classification
  • Compliance: Regulatory requirement tracking

๐Ÿ”ง Advanced Features

Custom Mapper Creation

import { Mapper, MapperType, MapperParams, NeutrosophicJudgment } from 'opentrustprotocol';

class CustomMapper implements Mapper {
  constructor(private params: MapperParams) {}
  
  apply(inputValue: any): NeutrosophicJudgment {
    // Your transformation logic
    return new NeutrosophicJudgment(0.8, 0.2, 0.0, []);
  }
  
  getParams(): MapperParams {
    return this.params;
  }
  
  getType(): MapperType {
    return MapperType.Custom;
  }
  
  validate(): boolean {
    // Validate your parameters
    return true;
  }
}

JSON Schema Validation

import { MapperValidator } from 'opentrustprotocol';

const validator = new MapperValidator();
const result = validator.validate(mapperParams);

if (result.valid) {
  console.log("โœ… Valid mapper configuration");
} else {
  result.errors.forEach(error => {
    console.log(`โŒ Validation error: ${error}`);
  });
}

๐ŸŒŸ Why Choose OTP JavaScript SDK?

๐Ÿš€ Performance

  • Optimized operations - Minimal runtime overhead
  • Memory efficient - Smart garbage collection
  • Fast development - Rich TypeScript integration

๐Ÿ”’ Safety

  • Type safety - Full TypeScript support with strict typing
  • Error handling - Comprehensive exception handling
  • Data integrity - Immutable provenance chains

๐Ÿ”ง Developer Experience

  • Rich ecosystem - Seamless integration with Node.js and browser tools
  • Comprehensive docs - Extensive documentation and examples
  • Active community - Growing ecosystem and support

๐Ÿ“ˆ Performance Benchmarks

| Operation | Time | Memory | |-----------|------|--------| | Judgment Creation | < 5ฮผs | 48 bytes | | Mapper Application | < 10ฮผs | 96 bytes | | Fusion (10 judgments) | < 30ฮผs | 384 bytes |

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

git clone https://github.com/draxork/opentrustprotocol-js.git
cd opentrustprotocol-js
npm install
npm test
npm run example:mapper

๐Ÿ“š Documentation

๐ŸŒ Ecosystem

OTP is available across multiple platforms with Conformance Seals:

| Platform | Package | Status | Conformance Seals | |----------|---------|--------|-------------------| | ๐ŸŸจ JavaScript | opentrustprotocol | โœ… v2.0.0 | โœ… REVOLUTIONARY | | ๐Ÿ Python | opentrustprotocol | โœ… v2.0.0 | โœ… REVOLUTIONARY | | ๐Ÿฆ€ Rust | opentrustprotocol | โœ… v0.3.0 | โœ… REVOLUTIONARY |

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Neutrosophic Logic: Founded by Florentin Smarandache
  • JavaScript/TypeScript Community: For the amazing language and ecosystem
  • Open Source Contributors: Making trust auditable for everyone

๐ŸŒŸ Star this repository if you find it useful!

GitHub stars

Made with โค๏ธ by the OpenTrust Protocol Team