import { useState } from 'react' import { Key, GitCommit, FileText, Lock, ShieldAlert, CheckCircle, XCircle } from 'lucide-react' interface SimulationResult { gateway_decision: string org_c_standalone_verified: boolean verification_mode: string evidence_artifact: { artifact_id: string agent_did: string issuer_did: string target_system: string requested_capability: string ed25519_proof: string tampered: boolean } | null } const SAMPLE_SIMULATION: SimulationResult = { gateway_decision: 'ALLOW', org_c_standalone_verified: true, verification_mode: '100% Offline Cryptographic Ed25519 Signature Verification via Pinned Root Keys', evidence_artifact: { artifact_id: 'art_bth_778899001122', agent_did: 'did:bth:org_a_agent_alpha', issuer_did: 'did:bth:org_a_root', target_system: 'Org_C_Resource_Server', requested_capability: 'resource_c.access', ed25519_proof: 'proof_ed25519_778899001122', tampered: false } } const ADVERSARIAL_TESTS = [ { id: 'normal', label: '1. Standard 3-Org Verified Request (Org A → Bartholomew → Org C)', expected: 'ALLOW / Org C Verified' }, { id: 'forged_sig', label: '2. Identity Attack: Forged Issuer Signature', expected: 'DENIED by Gateway' }, { id: 'overreach', label: '3. Delegation Attack: Capability Overreach', expected: 'DENIED by Gateway' }, { id: 'revoked', label: '4. Revocation Attack: Revoked DID Replay', expected: 'DENIED by Gateway' }, { id: 'nonce_replay', label: '5. Replay Attack: Reusing Nonce / Request ID', expected: 'DENIED by Gateway' }, { id: 'tamper_one_byte', label: '6. Evidence Attack: 1-Byte Payload Tampering', expected: 'Org C Verifier REJECTS' }, ] export default function VendorNeutralProtocolViewer() { const [activeTest, setActiveTest] = useState('normal') const [sim, setSim] = useState(SAMPLE_SIMULATION) const [isEvaluating, setIsEvaluating] = useState(false) const handleRunAdversarialTest = (testId: string) => { setActiveTest(testId) setIsEvaluating(true) setTimeout(() => { if (testId === 'normal') { setSim({ gateway_decision: 'ALLOW', org_c_standalone_verified: true, verification_mode: '100% Offline Cryptographic Verification via Pinned Root Keys', evidence_artifact: { artifact_id: `art_bth_${Math.floor(100000 + Math.random() * 900000)}`, agent_did: 'did:bth:org_a_agent_alpha', issuer_did: 'did:bth:org_a_root', target_system: 'Org_C_Resource_Server', requested_capability: 'resource_c.access', ed25519_proof: `proof_ed25519_${Math.floor(100000 + Math.random() * 900000)}`, tampered: false } }) } else if (testId === 'tamper_one_byte') { setSim({ gateway_decision: 'ALLOW', org_c_standalone_verified: false, // Org C REJECTS due to 1-byte tamper! verification_mode: 'CRITICAL FAILURE: Org C Verifier detected 1-byte signature mismatch!', evidence_artifact: { artifact_id: 'art_bth_tampered_1byte', agent_did: 'did:bth:org_a_agent_alpha', issuer_did: 'did:bth:org_a_root', target_system: 'Org_C_Resource_Server', requested_capability: 'resource_c.access', ed25519_proof: 'proof_ed25519_INVALID_TAMPERED_HASH', tampered: true } }) } else { setSim({ gateway_decision: 'DENY', org_c_standalone_verified: false, verification_mode: `Blocked at Gateway: ${testId.replace('_', ' ').toUpperCase()} attack prevented.`, evidence_artifact: null }) } setIsEvaluating(false) }, 500) } return (
Bartholomew Trust Protocol (BTP v0.1)

Bartholomew Trust Protocol (BTP v0.1)

A vendor-neutral protocol for machine identity, delegated authority, verifiable intent, and independently verifiable execution evidence. Language-neutral specification (BTP-001–BTP-008) with zero-dependency standalone verifier compliance.

{/* 3 Independent Organizations Experiment Diagram */}
THE 3 INDEPENDENT ORGANIZATIONS EXPERIMENT (ZERO BLIND TRUST)
{/* 3 Node Diagram */}
{/* Org A */}
ORG A (Agent Owner)

Agent Alpha (`did:bth:org_a_agent`)

Signs request with Org A private key. Possesses delegated authority credential.

{/* Bartholomew Gateway */}
BARTHOLOMEW GATEWAY

Decision & Evidence Engine

Evaluates Identity + Authority + Intent + Context + Revocation List + Nonce. Issues signed proof.

{/* Org C */}
ORG C (Resource Owner)

Standalone Offline Verifier

Executes 100% offline verification via pinned root keys. Zero API calls to Bartholomew.

{/* Adversarial Attack Testbed */}

Adversarial Attack Testbed

15/15 Protocol Tests Passed
{/* Left: Test Case Selector */}
Execute Adversarial Attack Vector: {ADVERSARIAL_TESTS.map((test) => ( ))}
{/* Right: Real-Time Results & Independent Verification */}
Gateway Decision: {sim.gateway_decision}
Org C Standalone Offline Verification: {sim.org_c_standalone_verified ? : } {sim.org_c_standalone_verified ? 'VERIFIED_ACCEPTED' : 'REJECTED_UNTRUSTED'}
Verification Execution Mode:

{sim.verification_mode}

{sim.evidence_artifact && (
Artifact ID: {sim.evidence_artifact.artifact_id}
Ed25519 Proof: {sim.evidence_artifact.ed25519_proof}
)}
{/* 3 Grounded Architecture Principles */}

Identity + Authority + Intent + Context

Full 5-element decision evaluation prevents unauthorized access by matching requested intent and context against credential authority boundaries.

Nonce & Replay Prevention

Nonce registry and strict 300s timestamp windows ensure legitimate signed requests cannot be replayed by malicious interceptors.

1-Byte Tamper Detection

Standalone verifiers independently hash evidence artifacts using pinned root public keys. Any 1-byte alteration invalidates the proof instantly.

) }