STANDARDS TRACK · RFC-0042

RFC-0042: Q Protocol v2.0 & Cube Schema Specification

Formal Wire Format, Grammar, and Cryptographic Hash-Chain Algorithms.

Author: A2AC Standards Track • Working Group Status: Ratified Standard Supersedes: RFC-0012

1. Abstract

This RFC defines the wire format, state transitions, and signature hashing rules for the Q Protocol v2.0 and Cube Schema v2.0, establishing a deterministic foundation for zero-token multi-agent governance.

2. Formal JSON Wire Schema

{ "$schema": "https://a2ac.ai/schemas/cube-v2.json", "title": "CubeReceipt", "required": ["receipt_id", "type", "timestamp", "protocol", "workspace", "prev_hash", "environment", "verification_matrix", "agent", "task", "signature"], "properties": { "receipt_id": { "type": "string", "pattern": "^[a-f0-9]{12}$" }, "type": { "type": "string", "enum": ["execution_receipt", "handoff_receipt", "consultation_receipt", "sync_receipt", "session_receipt", "audit_failure"] }, "prev_hash": { "type": "string", "description": "SHA-256 signature of preceding receipt in DAG" }, "verification_matrix": { "type": "object", "required": ["rule_3_status", "interceptor_status"], "properties": { "rule_3_status": { "type": "string", "enum": ["PENDING_COUNTERSIGNATURE", "COUNTERSIGNED", "REJECTED"] } } } } }

3. Canonical Hash Algorithm

The signature is computed over alphabetically sorted JSON keys with compact separators (, and :) using SHA-256:

Sig(D) = SHA256(CanonicalJSON(D - {signature}))