KTP/
github ↗
schemas

Transaction Record

created 14 October 2026 · last modified 14 October 2026
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://kinetic-trust-protocol.net/specs/schemas/v3/transaction-record.json",
  "title": "KTP Transaction Record v3",
  "description": "Unreleased v3 Trajectory Chain record. The exact record and staged signing contract are defined in specifications/trajectory-signatures.md. Every accepted field participates in the specified agent payload, Oracle payload, or completed-record hash; no unsigned extension fields exist outside the explicitly signed action.details object. This schema constrains shape, ranges, and chain-start conditions. Canonical JSON, finite and representable numbers, cryptographic signatures, trusted keys and profiles, migration authority, chain continuity, and Oracle commit evidence require semantic and runtime verification. The byte-preserved historical v2 schema is transaction-record-legacy-v2.json and does not define v3 acceptance.",
  "type": "object",
  "required": [
    "record_version",
    "record_id",
    "agent_id",
    "zone_id",
    "chain_id",
    "sequence",
    "timestamp",
    "previous_hash",
    "previous_state",
    "current_state",
    "action",
    "friction",
    "velocity",
    "conformance_level",
    "evaluation_profile_digest",
    "migration_checkpoint",
    "agent_signature",
    "oracle_attestation",
    "record_hash"
  ],
  "additionalProperties": false,
  "properties": {
    "record_version": {
      "const": "ktp-trajectory-v3"
    },
    "record_id": {
      "$ref": "#/$defs/literalId"
    },
    "agent_id": {
      "$ref": "#/$defs/literalId"
    },
    "zone_id": {
      "$ref": "#/$defs/literalId"
    },
    "chain_id": {
      "$ref": "#/$defs/literalId"
    },
    "sequence": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "description": "Zero-based position within this authenticated chain. Semantic verification also requires a JSON integer token and exact continuity with the verified predecessor."
    },
    "timestamp": {
      "$ref": "#/$defs/utcTimestamp"
    },
    "previous_hash": {
      "oneOf": [
        {
          "$ref": "#/$defs/digest"
        },
        {
          "type": "null"
        }
      ],
      "description": "Null only for sequence zero. Otherwise the digest of the verified immediately preceding completed v3 record; same-chain continuity is a semantic obligation."
    },
    "previous_state": {
      "oneOf": [
        {
          "$ref": "#/$defs/agentState"
        },
        {
          "type": "null"
        }
      ]
    },
    "current_state": {
      "$ref": "#/$defs/agentState"
    },
    "action": {
      "$ref": "#/$defs/action"
    },
    "friction": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "Environmental friction at the time of the action; included in the authenticated record body."
    },
    "velocity": {
      "type": "number",
      "minimum": 0,
      "description": "Agent transaction rate at the time of the action, included in the authenticated body. This is the record's own rate field; it is not the trust_trend Risk Factor. Semantic validation rejects nonfinite and nonrepresentable JSON numbers."
    },
    "conformance_level": {
      "type": "integer",
      "enum": [
        1,
        2,
        3
      ],
      "description": "Claimed conformance level bound by the signatures. A record cannot select a weaker level than the trusted deployment requires; declaration shape alone does not prove conformance."
    },
    "evaluation_profile_digest": {
      "$ref": "#/$defs/digest",
      "description": "Digest of the exact authenticated evaluation profile used for this record. Level 3 requires SHA-384; the trusted deployment controls the required profile and cryptographic strength."
    },
    "migration_checkpoint": {
      "oneOf": [
        {
          "$ref": "#/$defs/digest"
        },
        {
          "type": "null"
        }
      ],
      "description": "Null for ordinary genesis and every successor. A legacy migration starts a new v3 chain at sequence zero and binds its independently authenticated migration checkpoint digest. A nonnull digest alone does not authorize migration."
    },
    "agent_signature": {
      "$ref": "#/$defs/compactJws",
      "description": "Compact JWS for the agent signing stage defined by specifications/trajectory-signatures.md. The stage excludes its derived signature envelope, the later Oracle attestation, and record_hash. Shape does not verify the protected header, payload, signature, or trusted signer."
    },
    "oracle_attestation": {
      "$ref": "#/$defs/oracleAttestation"
    },
    "record_hash": {
      "$ref": "#/$defs/digest",
      "description": "Digest of the completed v3 signed-record bytes defined by specifications/trajectory-signatures.md, excluding only the derived record_hash field. Both signature envelopes and every Oracle attestation field are covered. Level 3 requires SHA-384."
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "sequence": {
            "const": 0
          }
        },
        "required": [
          "sequence"
        ]
      },
      "then": {
        "properties": {
          "previous_hash": {
            "type": "null"
          },
          "previous_state": {
            "type": "null"
          }
        }
      },
      "else": {
        "properties": {
          "previous_hash": {
            "$ref": "#/$defs/digest"
          },
          "previous_state": {
            "$ref": "#/$defs/agentState"
          },
          "migration_checkpoint": {
            "type": "null"
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "conformance_level": {
            "const": 3
          }
        },
        "required": [
          "conformance_level"
        ]
      },
      "then": {
        "properties": {
          "record_hash": {
            "$ref": "#/$defs/sha384Digest"
          },
          "evaluation_profile_digest": {
            "$ref": "#/$defs/sha384Digest"
          },
          "migration_checkpoint": {
            "oneOf": [
              {
                "$ref": "#/$defs/sha384Digest"
              },
              {
                "type": "null"
              }
            ]
          },
          "previous_hash": {
            "oneOf": [
              {
                "$ref": "#/$defs/sha384Digest"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      }
    }
  ],
  "$defs": {
    "literalId": {
      "type": "string",
      "minLength": 1,
      "pattern": "^(?!.*[\\s*?\\[\\]{}])[\\s\\S]+$",
      "description": "Exact nonempty identifier without whitespace or wildcard characters."
    },
    "utcTimestamp": {
      "type": "string",
      "format": "date-time",
      "pattern": "^[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])T(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]{1,6})?Z$(?![\\s\\S])",
      "description": "UTC RFC 3339 timestamp with uppercase T and Z, seconds and optional one-to-six fractional digits. Leap-second spellings are unsupported and rejected. Calendar validity requires format assertions; trusted-time and ordering checks remain separate."
    },
    "sha256Digest": {
      "type": "string",
      "minLength": 71,
      "maxLength": 71,
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "sha384Digest": {
      "type": "string",
      "minLength": 103,
      "maxLength": 103,
      "pattern": "^sha384:[0-9a-f]{96}$"
    },
    "digest": {
      "oneOf": [
        {
          "$ref": "#/$defs/sha256Digest"
        },
        {
          "$ref": "#/$defs/sha384Digest"
        }
      ]
    },
    "compactJws": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$(?![\\s\\S])",
      "description": "Compact JWS with three nonempty, unpadded base64url segments. Decoding, canonical payload equality, protected-header requirements, approved algorithms, cryptographic verification, and key authorization are separate mandatory checks."
    },
    "agentState": {
      "type": "object",
      "required": [
        "e_base",
        "e_trust",
        "location",
        "tier",
        "lineage",
        "generation"
      ],
      "additionalProperties": false,
      "properties": {
        "e_base": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "e_trust": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "location": {
          "$ref": "#/$defs/literalId"
        },
        "tier": {
          "type": "string",
          "enum": [
            "hibernation",
            "observer",
            "analyst",
            "operator",
            "admin"
          ]
        },
        "lineage": {
          "type": "string",
          "enum": [
            "sponsored",
            "independent",
            "guarantor"
          ],
          "description": "Lineage stage, derived from generation; consistency requires semantic verification."
        },
        "generation": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991,
          "description": "Nonnegative generation within the exact integer range supported by canonical JSON; semantic validation also requires an integer token."
        }
      }
    },
    "action": {
      "type": "object",
      "required": [
        "action_type",
        "action_risk",
        "target",
        "result",
        "details"
      ],
      "additionalProperties": false,
      "properties": {
        "action_type": {
          "$ref": "#/$defs/literalId"
        },
        "action_risk": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "target": {
          "oneOf": [
            {
              "$ref": "#/$defs/literalId"
            },
            {
              "type": "null"
            }
          ]
        },
        "result": {
          "type": "string",
          "enum": [
            "success",
            "denied"
          ]
        },
        "details": {
          "type": "object",
          "description": "Operation-specific JSON object. Every key and recursively nested value is included in the canonical signed payload; this is not an unsigned extension channel. Duplicate keys, nonfinite or nonrepresentable numbers, and non-JSON values are rejected before canonicalization."
        }
      }
    },
    "oracleAttestation": {
      "type": "object",
      "required": [
        "oracle_id",
        "attestation_time",
        "risk_factors",
        "oracle_signature"
      ],
      "additionalProperties": false,
      "properties": {
        "oracle_id": {
          "$ref": "#/$defs/literalId"
        },
        "attestation_time": {
          "$ref": "#/$defs/utcTimestamp"
        },
        "risk_factors": {
          "$ref": "https://kinetic-trust-protocol.net/specs/schemas/v2/risk-factors.json",
          "description": "The exact six Risk Factor inputs from the existing v2 Risk Factors schema. All six inputs are covered by the Oracle signing stage and completed-record hash; finite values and the required deterministic evaluation must be verified."
        },
        "oracle_signature": {
          "$ref": "#/$defs/compactJws",
          "description": "Compact JWS for the Oracle signing stage defined by specifications/trajectory-signatures.md. Its payload is the canonical object {record_body: B, agent_signature: exact compact JWS, attestation: O}, where B is the agent record body and O contains oracle_id, attestation_time, and risk_factors. It excludes the derived Oracle signature envelope and record_hash. A valid signature does not replace required mesh commit evidence."
        }
      }
    }
  }
}