Expand description
§OpenTrust Protocol (OTP) Rust SDK
This crate is the official Rust implementation of the OpenTrust Protocol.
It provides the necessary tools to create, validate, and fuse Neutrosophic Judgments in Rust applications with mathematical proof of conformance and Performance Oracle capabilities.
§🦀 The Revolutionary Additions: Conformance Seals + Performance Oracle
OTP v3.0 introduces:
- Zero Pillar: Proof-of-Conformance Seals (cryptographic proof of specification compliance)
- First Pillar: Performance Oracle (Circle of Trust for real-world outcome tracking)
Every fusion operation now generates a cryptographic fingerprint (SHA-256 hash) that proves the operation was performed according to the exact OTP specification. Additionally, the Performance Oracle system enables tracking real-world outcomes to measure the effectiveness of OTP-based decisions.
This transforms OTP from a trust protocol into the mathematical embodiment of trust itself.
§Core Components
NeutrosophicJudgment: The main struct for representing evidence (T, I, F).- Fusion operators: Functions for combining multiple judgments with conformance seals.
- NEW:
generate_conformance_seal: Generate cryptographic proof of conformance. - NEW:
verify_conformance_seal_with_inputs: Verify mathematical proof of conformance.
§Example with Conformance Seals
use opentrustprotocol::{NeutrosophicJudgment, conflict_aware_weighted_average, verify_conformance_seal_with_inputs};
// Create judgments
let judgment1 = NeutrosophicJudgment::new(
0.8, 0.2, 0.0,
vec![("sensor1".to_string(), "2023-01-01T00:00:00Z".to_string())]
).unwrap();
let judgment2 = NeutrosophicJudgment::new(
0.6, 0.3, 0.1,
vec![("sensor2".to_string(), "2023-01-01T00:00:00Z".to_string())]
).unwrap();
// Fuse judgments (now with automatic conformance seal generation)
let fused = conflict_aware_weighted_average(
&[&judgment1, &judgment2],
&[0.6, 0.4]
).unwrap();
// Verify the mathematical proof of conformance
let is_mathematically_proven = verify_conformance_seal_with_inputs(
&fused,
&[&judgment1, &judgment2],
&[0.6, 0.4]
).unwrap();
if is_mathematically_proven {
println!("✅ MATHEMATICAL PROOF: This judgment is 100% conformant to OTP specification!");
} else {
println!("❌ WARNING: Conformance verification failed - possible tampering detected!");
}
println!("Fused judgment: {}", fused);Re-exports§
pub use conformance::generate_conformance_seal;pub use conformance::verify_conformance_seal;pub use conformance::verify_conformance_seal_with_inputs;pub use conformance::create_fusion_provenance_entry;pub use error::OpenTrustError;pub use error::Result;pub use fusion::conflict_aware_weighted_average;pub use fusion::optimistic_fusion;pub use fusion::pessimistic_fusion;pub use judgment::NeutrosophicJudgment;pub use judgment_id::generate_judgment_id;pub use judgment_id::ensure_judgment_id;pub use judgment_id::OutcomeJudgment;pub use judgment_id::OutcomeType;pub use mapper::create_judgment;pub use mapper::create_timestamp;pub use mapper::get_global_registry;pub use mapper::normalize_boolean_input;pub use mapper::reset_global_registry;pub use mapper::validate_judgment_values;pub use mapper::BaseMapperParams;pub use mapper::BooleanMapper;pub use mapper::BooleanParams;pub use mapper::CategoricalMapper;pub use mapper::CategoricalParams;pub use mapper::InputError;pub use mapper::Mapper;pub use mapper::MapperError;pub use mapper::MapperParams;pub use mapper::MapperRegistry;pub use mapper::MapperType;pub use mapper::MapperValidator;pub use mapper::NumericalMapper;pub use mapper::NumericalParams;pub use mapper::ProvenanceEntry;pub use mapper::ValidationError;pub use mapper::types::JudgmentData;pub use mapper::validator::ValidationResult;
Modules§
- conformance
- Conformance Seal Module
- error
- Error types for the OpenTrust Protocol SDK
- fusion
- Fusion operators for OpenTrust Protocol
- judgment
- Neutrosophic Judgment implementation
- judgment_
id - Judgment ID System for Circle of Trust
- mapper
- OTP Mapper module for OpenTrust Protocol Rust SDK
Constants§
- VERSION
- Current version of the OpenTrust Protocol SDK