PoCC Schema

Machine-readable protocol definitions

Purpose

This page provides canonical, machine-readable schemas for PoCC protocol elements. These schemas are authoritative for implementation and integration.

Any implementation diverging from these schemas is not PoCC-compliant.

JSON Schema

Base Action Schema

All PoCC actions must conform to this base schema:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pocc.io/schema/action.json",
  "title": "PoCC Action",
  "description": "Base schema for all PoCC actions",
  "type": "object",
  "required": [
    "action_id",
    "action_type",
    "agent_id",
    "timestamp",
    "signature"
  ],
  "properties": {
    "action_id": {
      "type": "string",
      "description": "Unique identifier for this action"
    },
    "action_type": {
      "type": "string",
      "enum": ["ASSERT", "CHALLENGE", "REVISE", "COMMIT", "DELEGATE", "FULFILL", "REASON"]
    },
    "agent_id": {
      "type": "string",
      "description": "Identifier of the agent performing this action"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp"
    },
    "signature": {
      "type": "string",
      "description": "Cryptographic signature of the action"
    },
    "dependencies": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Array of action_ids this action depends on"
    },
    "metadata": {
      "type": "object",
      "description": "Optional structured metadata"
    }
  }
}

ASSERT Action Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pocc.io/schema/assert.json",
  "title": "PoCC ASSERT Action",
  "allOf": [
    { "$ref": "https://pocc.io/schema/action.json" }
  ],
  "properties": {
    "action_type": {
      "const": "ASSERT"
    },
    "content_hash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$",
      "description": "SHA-256 hash of the asserted content"
    }
  },
  "required": ["content_hash"]
}

CHALLENGE Action Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pocc.io/schema/challenge.json",
  "title": "PoCC CHALLENGE Action",
  "allOf": [
    { "$ref": "https://pocc.io/schema/action.json" }
  ],
  "properties": {
    "action_type": {
      "const": "CHALLENGE"
    },
    "target_action_id": {
      "type": "string",
      "description": "ID of the action being challenged"
    },
    "reason_hash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$",
      "description": "SHA-256 hash of the challenge reason"
    }
  },
  "required": ["target_action_id", "reason_hash"]
}

COMMIT Action Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pocc.io/schema/commit.json",
  "title": "PoCC COMMIT Action",
  "allOf": [
    { "$ref": "https://pocc.io/schema/action.json" }
  ],
  "properties": {
    "action_type": {
      "const": "COMMIT"
    },
    "commitment_hash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$",
      "description": "SHA-256 hash of the commitment"
    },
    "conditions": {
      "type": "object",
      "description": "Structured conditions for the commitment"
    },
    "deadline": {
      "type": "string",
      "format": "date-time",
      "description": "Optional deadline for fulfillment"
    }
  },
  "required": ["commitment_hash"]
}

JSON-LD Context

For semantic web integration, PoCC provides a JSON-LD context:

{
  "@context": {
    "@version": 1.1,
    "@vocab": "https://pocc.io/ontology#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "pocc": "https://pocc.io/ontology#",
    
    "Action": "pocc:Action",
    "Agent": "pocc:Agent",
    "Commitment": "pocc:Commitment",
    "Challenge": "pocc:Challenge",
    "Revision": "pocc:Revision",
    
    "action_id": {
      "@id": "pocc:actionId",
      "@type": "@id"
    },
    "agent_id": {
      "@id": "pocc:agentId",
      "@type": "@id"
    },
    "action_type": {
      "@id": "pocc:actionType",
      "@type": "xsd:string"
    },
    "timestamp": {
      "@id": "pocc:timestamp",
      "@type": "xsd:dateTime"
    },
    "content_hash": {
      "@id": "pocc:contentHash",
      "@type": "xsd:string"
    },
    "dependencies": {
      "@id": "pocc:dependsOn",
      "@type": "@id",
      "@container": "@list"
    },
    "signature": {
      "@id": "pocc:signature",
      "@type": "xsd:string"
    }
  }
}

Example: Complete PoCC Action

Here is a complete, valid PoCC ASSERT action:

{
  "@context": "https://pocc.io/schema/context.jsonld",
  "action_id": "action:550e8400-e29b-41d4-a716-446655440000",
  "action_type": "ASSERT",
  "agent_id": "agent:alice",
  "timestamp": "2026-02-02T12:34:56Z",
  "content_hash": "a3c4f5d8e2b1a0c9f7e6d5c4b3a2918f0e7d6c5b4a39281f0e7d6c5b4a39281f",
  "dependencies": [],
  "signature": "3045022100abcd...ef01",
  "metadata": {
    "content_type": "text/plain",
    "language": "en"
  }
}

Validation Rules

Signature Verification

All actions must be cryptographically signed. The signature must cover:

Dependency Validation

For actions with dependencies:

Timestamp Validation

Schema Versioning

PoCC schemas follow semantic versioning:

Current version: 0.1.0

Breaking changes will be announced with migration guides.