Skip to main content

The official SDK for the OpenTrust Protocol, the open standard for auditable trust.

Project description

OpenTrust Protocol (OTP) SDK

PyPI version License: MIT Python 3.8+

The Open Standard for Auditable Trust

This is the official Python SDK for the OpenTrust Protocol (OTP). It enables developers to create, manipulate, and fuse Neutrosophic Judgments to build more transparent, robust, and auditable systems.

OTP transforms uncertainty from a "black box" into a measurable metric (T, I, F) with a complete audit trail (provenance_chain).

Features

  • Neutrosophic Judgments: Represent evidence with Truth (T), Indeterminacy (I), and Falsity (F) components
  • Fusion Operators: Multiple strategies for combining judgments (conflict-aware, optimistic, pessimistic)
  • Audit Trail: Complete provenance tracking for every decision
  • Python 3.8+: Modern Python support with type hints
  • MIT Licensed: Open source and free to use

Official Website & Full Documentation: https://opentrustprotocol.com

Scientific Foundation: https://neutrosofia.com

Installation

pip install opentrustprotocol

Quick Start

Start using OTP in just a few lines of code:

from otp import NeutrosophicJudgment, fuse

# 1. Create Neutrosophic Judgments from your evidence
# Source 1: An AI model's confidence score
judgment_from_model = NeutrosophicJudgment(
    T=0.85, 
    I=0.15, 
    F=0.0,
    provenance_chain=[{
        "source_id": "model-text-bison-v1.2",
        "timestamp": "2025-09-20T20:30:00Z"
    }]
)

# Source 2: A human expert's verdict
judgment_from_expert = NeutrosophicJudgment(
    T=0.7, 
    I=0.1, 
    F=0.2,
    provenance_chain=[{
        "source_id": "expert-auditor-jane-doe",
        "timestamp": "2025-09-20T20:32:15Z"
    }]
)

# 2. Fuse the evidence to get an auditable conclusion
# We use the standard, conflict-aware operator.
# We give more weight to the human expert (60%) than the model (40%).
fused_judgment = fuse.conflict_aware_weighted_average(
    judgments=[judgment_from_model, judgment_from_expert],
    weights=[0.4, 0.6]
)

# 3. Analyze the result and its audit trail
print(f"Fused Judgment: {fused_judgment}")
# Fused Judgment: NeutrosophicJudgment(T=0.76, I=0.12, F=0.12)

# The provenance_chain now contains the full history
print("\nComplete Audit Trail:")
for entry in fused_judgment.provenance_chain:
    print(f"- {entry}")

# - {'source_id': 'model-text-bison-v1.2', ...}
# - {'source_id': 'expert-auditor-jane-doe', ...}
# - {'operator_id': 'otp-cawa-v1.1', ...}

Use Cases

  • Financial Risk Assessment: Evaluate investment opportunities with multiple data sources
  • Identity Verification: Multi-factor authentication with confidence scoring
  • AI Model Validation: Assess reliability of machine learning predictions
  • Blockchain Auditing: Verify transaction legitimacy with multiple validators
  • Reputation Systems: Build trust networks with auditable metrics

Fusion Operators

1. Conflict-Aware Weighted Average (Recommended)

result = fuse.conflict_aware_weighted_average(
    judgments=[judgment1, judgment2, judgment3],
    weights=[0.5, 0.3, 0.2]
)

Automatically adjusts weights based on internal conflicts in judgments.

2. Optimistic Fusion

result = fuse.optimistic_fusion(judgments)

Takes maximum T and minimum F - useful for opportunity analysis.

3. Pessimistic Fusion

result = fuse.pessimistic_fusion(judgments)

Takes minimum T and maximum F - useful for risk analysis.

What's Next?

License

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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opentrustprotocol-1.0.3.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opentrustprotocol-1.0.3-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file opentrustprotocol-1.0.3.tar.gz.

File metadata

  • Download URL: opentrustprotocol-1.0.3.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for opentrustprotocol-1.0.3.tar.gz
Algorithm Hash digest
SHA256 be22884d9ef6448e635a6b9b4158bd7cd6b8805482032fc0593896faf081afac
MD5 696278b22df4dc055e726c624902500a
BLAKE2b-256 1d05a816d0f270f7ee01e796f4142f6d7beeee5137b3ea3114ff21a52ff0165f

See more details on using hashes here.

File details

Details for the file opentrustprotocol-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for opentrustprotocol-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6ecbcd0897064c8f5f7af9a9b58b298f172f0e0012eca4ede441507bd97312a6
MD5 6e528d24d30c20c1bdcf384cc7e2ff95
BLAKE2b-256 bb64e64293221b07dfb08fd3ddaf4a6fd2c5f9d56a886c44b690e5b345086210

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page