System Architecture

CARGE enables multi-party credential creation where participants don't need to trust each other. AI agents access on-chain RAG metadata through MCP servers to retrieve schemas from IPFS, then guide users through credential creation workflows. The blockchain stores only hashes and CIDs for verification, while actual data lives in IPFS.

MCP Server Interface

Model Context Protocol server providing AI agents with stdio-based access to blockchain data and IPFS content. Each MCP server embeds a Helia node for P2P content retrieval.

Substrate Blockchain

Custom blockchain storing cryptographic hashes and IPFS CIDs. Three specialized smart contracts manage PKI, encrypted messaging, and RAG metadata coordination.

IPFS + Helia Storage

Distributed content-addressed storage for schemas, credentials, and workflow data. Helia nodes embedded in MCP servers enable direct P2P content retrieval without centralized gateways.

Three Smart Contracts

CARGE's Substrate blockchain implements three specialized smart contracts that coordinate the entire decentralized context engineering system.

1. PKI Smart Contract

Public Key Infrastructure management for all participants. Handles identity registration, key rotation, and cryptographic verification.

  • Identity Registry Decentralized identity management for AI agents and users
  • Key Management ECDH key pairs with automatic rotation support
  • Verification System Cryptographic proof validation for all operations

2. Encrypted Messaging Contract

Peer-to-peer encrypted message exchange between AI agents. Messages are encrypted with AES-GCM using ECDH-derived keys.

  • P2P Messaging Direct agent-to-agent communication without intermediaries
  • E2E Encryption ECDH + AES-GCM with perfect forward secrecy
  • Message Attestation Cryptographic proof of message delivery and content

3. RAG Metadata Contract

On-chain RAG system that guides AI agents through credential creation workflows. Stores IPFS CIDs for schemas and workflow instructions, enabling AI to retrieve the right context and guide users step-by-step.

  • Schema Registry IPFS CIDs for JSON schemas and IPLD structures
  • Versioning System Immutable version history of all schemas and instructions
  • Tag-Based Discovery Semantic search and categorization of context data

On-Chain RAG: Guiding AI Through Workflows

The on-chain RAG system guides AI agents through complex multi-party credential creation workflows. By retrieving schemas and instructions from IPFS, the AI understands what information to collect, how to validate it, and what format to generate - enabling trustless collaboration between parties.

Retrieval Layer

The AI queries the on-chain RAG contract to discover what schemas and workflow instructions it needs. It retrieves these from IPFS via Helia, getting the knowledge required to guide users through credential creation.

  • CID Resolution Blockchain stores only CIDs, not actual data
  • P2P Content Fetch Helia node retrieves schemas from IPFS network
  • Schema Validation Verify retrieved schemas match on-chain hashes

Augmentation Layer

Retrieved schemas and workflow instructions are injected as MCP resources into the AI's context. This augmentation teaches the AI what questions to ask, what data is required, and how to structure the final credential.

  • Context Injection Schemas become MCP resources available to Claude
  • Structural Knowledge AI understands expected IPLD object structure
  • Constraint Awareness Validation rules and requirements guide generation

Generation Layer

Guided by the retrieved context, the AI dialogues with users to collect required information. It then generates properly-structured W3C credentials with cryptographic proofs, ready for validation by other parties in the workflow.

  • Guided Dialogue AI collects required data through conversation
  • Credential Proposal Generation Create W3C credential proposals conformant to EBSI schemas
  • Cryptographic Proof Sign credentials with cryptographic proofs for multi-party validation

Complete RAG Flow

  • 1. Query AI agent asks MCP server for workflow schema
  • 2. Retrieve CID MCP queries RAG contract, gets IPFS CID
  • 3. Fetch Schema Helia node retrieves schema from IPFS P2P network
  • 4. Inject Context Schema injected as MCP resource into Claude's context
  • 5. Generate Credential AI creates W3C credential with cryptographic signature
  • 6. Store & Validate Credential stored in IPFS, other parties can verify and validate

Multi-Party Credential Creation

CARGE enables collaborative credential creation between multiple parties who don't trust each other. The on-chain RAG system guides AI agents through complex workflows, ensuring all parties can verify each step independently.

Educational Credentials

Create diplomas and certifications where students, institutions, and validators don't need to trust each other. AI guides each party through their role, with all steps cryptographically verified. Compatible with systems like EBSI.

Administrative Workflows

Enable complex multi-party administrative processes where participants don't trust each other. On-chain RAG guides AI through each step, with cryptographic verification ensuring accountability without central authority.

Technical Documentation

AI-assisted creation of structured technical documentation with schema validation and versioning through IPFS content addressing.

Compliance & Audit

Perfect audit trails for compliance requirements. Every action is cryptographically verified and immutably recorded on-chain.

Supply Chain Credentials

Track products through supply chains where manufacturers, distributors, and retailers don't trust each other. AI-guided credential creation at each step, with cryptographic proofs ensuring authenticity without intermediaries.

EBSI Compatibility

As an example, credentials created with CARGE can be designed for validation by organizations in trusted registries like EBSI. The system is flexible and works with any W3C-compliant credential standard.

Development Roadmap

Our development timeline for delivering trustless multi-party credential creation with on-chain RAG guidance.

Q4 2025 - Paseo Testnet

Deploy three smart contracts on Paseo testnet. Full testing of MCP integration, Helia IPFS nodes, on-chain RAG system, and multi-party credential workflows with cryptographic verification.

Active Development

Q2 2026 - Public Network

Public network launch. Anyone can create workflows for multi-party credential creation with AI-guided processes and cryptographic verification. Compatible with standards like W3C and EBSI.

Planned