BB-MCP Architecture

Understanding how Blockchain-Backed Model Context Protocol extends MCP with cryptographic verification and immutable logging.

Protocol Overview

BB-MCP operates as a layered architecture that extends the Model Context Protocol

Agent Layer

The AI agent or tool that generates context following MCP standards

Context Packaging Layer (MCP)

Structures context into standardized MCP schema format

Signing Layer

Generates cryptographic signature using agent's private key

Blockchain Logging Layer

Records cryptographic hash on public blockchain for immutable verification

BB-MCP Context Schema

Extended MCP schema with cryptographic verification fields

{
  "agent_id": "string",           // Unique agent identifier
  "timestamp": "ISO 8601 UTC",    // Context creation time
  "context_data": {               // MCP-defined structured data
    "task": "classify_image",
    "model": "resnet50",
    "confidence": 0.95
  },
  "metadata": {                   // Application-specific metadata
    "dataset": "imagenet-mini",
    "version": "1.0"
  },
  "signature": "base64-encoded",  // Digital signature (BB-MCP extension)
  "hash": "SHA-256 hash"          // Context hash for blockchain (BB-MCP extension)
}

Field Descriptions

agent_id
Uniquely identifies the agent (can be DID, public key, or URI)
signature
Generated using agent's private key over serialized context data
hash
SHA-256 digest of signed package, used for blockchain storage

Cryptographic Signing Process

How BB-MCP ensures authenticity and tamper resistance

1

Serialize Context

Serialize MCP context object without signature and hash fields

2

Compute SHA-256 Hash

Generate SHA-256 hash of the serialized context object

3

Digital Signature

Sign the hash using agent's private key (ECDSA secp256k1)

4

Final Hash

Compute SHA-256 hash of the complete signed package for blockchain storage

Security Guarantees

  • • Only the originating agent could have produced the signed context
  • • Any modification after signing will result in verification failure
  • • Blockchain timestamp proves context existed at specific time

Blockchain Logging Mechanism

Minimal on-chain storage for maximum cost efficiency

// Minimal Solidity contract for BB-MCP logging
contract BBMCPRegistry {
    event ContextLogged(
        bytes32 indexed contextHash, 
        string agentId, 
        uint256 timestamp
    );

    function logContextHash(
        bytes32 contextHash,
        string calldata agentId,
        uint256 timestamp
    ) external {
        emit ContextLogged(contextHash, agentId, timestamp);
    }
}

Immutable Record

Once emitted, the log is permanently recorded in blockchain's event history

Minimal Storage

Only hash and metadata stored on-chain to minimize gas costs

Public Verification

Anyone can recompute hash and confirm presence on blockchain

Blockchain Network Support

BB-MCP supports multiple Ethereum-compatible networks

Polygon

~$0.001/tx

2s confirmation

Recommended

Base

~$0.005/tx

2s confirmation

L2

Arbitrum

~$0.01/tx

1s confirmation

L2

Ethereum

~$2-20/tx

12s confirmation

Mainnet

Performance Characteristics

Measured performance from prototype implementation

OperationMean LatencyGas UsedCost (Polygon)
Context Signing1.2msN/AN/A
SHA-256 Hashing0.4msN/AN/A
Blockchain Logging4.3s42,000~$0.001
Verification Query780msN/AN/A

Design Trade-offs

Understanding the balance between security, cost, and performance

Benefits

  • Immutable verification records
  • No single point of failure
  • Global accessibility
  • MCP compatibility preserved

Considerations

  • Blockchain confirmation latency (2-12s)
  • Transaction costs (varies by network)
  • Key management complexity
  • Off-chain storage dependency