<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc [
<!ENTITY nbsp "&#160;">
]>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="info" docName="draft-condrey-rats-pop-schema-00" ipr="trust200902" submissionType="independent" xml:lang="en" version="3">

  <front>
    <title abbrev="PoP CDDL Schema">Proof of Process CDDL Schema</title>

    <seriesInfo name="Internet-Draft" value="draft-condrey-rats-pop-schema-00"/>

    <author fullname="David Condrey" initials="D." surname="Condrey">
      <organization>Writerslogic Inc</organization>
      <address>
        <postal>
          <country>United States</country>
        </postal>
        <email>david@writerslogic.com</email>
      </address>
    </author>

    <date year="2026" month="February" day="6"/>

    <area>Security</area>
    <workgroup>Remote ATtestation procedureS</workgroup>

    <keyword>CDDL</keyword>
    <keyword>schema</keyword>
    <keyword>CBOR</keyword>
    <keyword>attestation</keyword>

    <abstract>
      <t>
        This document provides the normative Concise Data Definition Language
        (CDDL) schema for the Proof of Process specification. The schema defines
        the complete wire format for Evidence Packets (.pop files) and
        Attestation Results (.war files) as specified in the companion
        architecture document.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="introduction">
      <name>Introduction</name>

      <t>
        This document contains the normative CDDL schema for the Proof of
        Process (PoP) specification defined in <xref target="I-D.condrey-rats-pop"/>.
        The schema is provided as a separate document to facilitate:
      </t>

      <ul>
        <li>Independent tooling and validation</li>
        <li>Schema versioning separate from specification updates</li>
        <li>Direct integration with CDDL processing tools</li>
      </ul>

      <section anchor="conventions">
        <name>Requirements Language</name>
        <t>
          The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
          "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
          "OPTIONAL" in this document are to be interpreted as described in
          BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and
          only when, they appear in all capitals, as shown here.
        </t>
      </section>
    </section>

    <section anchor="schema-info">
      <name>Schema Information</name>

      <t>
        This schema is specified using CDDL as defined in <xref target="RFC8610"/>.
        CDDL provides a notation for expressing CBOR <xref target="RFC8949"/>
        data structures with precise type constraints and extensibility support.
      </t>

      <dl>
        <dt>Schema Version:</dt>
        <dd>1.4.0</dd>

        <dt>Compatibility:</dt>
        <dd>
          Breaking changes increment the major version number. Minor version
          changes add optional fields or new enumeration values. Patch version
          changes are documentation or clarification only.
        </dd>

        <dt>Encoding:</dt>
        <dd>
          All structures are encoded as CBOR per <xref target="RFC8949"/>.
          Deterministic encoding (RFC 8949 Section 4.2) is RECOMMENDED for
          signature verification.
        </dd>

        <dt>Key Encoding:</dt>
        <dd>
          Integer keys (1-99) are reserved for fields defined by this
          specification. String keys are available for vendor extensions.
        </dd>

        <dt>Semantic Tags:</dt>
        <dd>
          Evidence Packets use CBOR tag 1347571280 (0x50505020, "PPP ").
          Attestation Results use CBOR tag 1463894560 (0x57415220, "WAR ").
        </dd>
      </dl>
    </section>

    <section anchor="complete-schema">
      <name>Complete CDDL Schema</name>

      <t>
        The following CDDL defines the complete wire format for Proof of
        Process packets. This schema is normative and implementations MUST
        conform to it.
      </t>

      <sourcecode type="cddl" markers="true"><![CDATA[
; Proof of Process CDDL Schema
; Version: 1.4.0

; ============================================================
; Top-Level Structures
; ============================================================

tagged-evidence-packet = #6.1347571280(evidence-packet)
tagged-attestation-result = #6.1463894560(attestation-result)

; Evidence Packet (.pop file)
evidence-packet = {
    1 => uint,                      ; version
    2 => uuid,                      ; packet-id
    3 => hash-value,                ; document-hash
    4 => pop-timestamp,             ; created
    5 => document-ref,              ; document
    6 => [+ checkpoint],            ; checkpoints

    ; Tiered optional sections
    ? 10 => presence-section,       ; presence
    ? 11 => forensics-section,      ; forensics
    ? 12 => keystroke-section,      ; keystroke
    ? 13 => hardware-section,       ; hardware
    ? 14 => external-section,       ; external

    ; Extension fields
    ? 20 => provenance-section,     ; provenance
    ? 21 => continuation-section,   ; continuation
    ? 22 => collaboration-section,  ; collaboration

    ; Packet signature
    99 => COSE_Sign1,               ; packet-signature
}

; Attestation Result (.war file)
attestation-result = {
    1 => uint,                      ; version
    2 => uuid,                      ; reference-packet-id
    3 => pop-timestamp,             ; verified-at
    4 => forensic-assessment,       ; verdict
    5 => float32,                   ; confidence-score
    6 => [+ result-claim],          ; verified-claims
    7 => [* caveat],                ; caveats
    ? 8 => verifier-info,           ; verifier
    99 => COSE_Sign1,               ; result-signature
}

; ============================================================
; Core Types
; ============================================================

uuid = bstr .size 16
pop-timestamp = #6.1(uint)          ; Unix timestamp
hash-value = {
    1 => uint,                      ; algorithm (1=SHA-256)
    2 => bstr,                      ; digest
}

document-ref = {
    1 => tstr,                      ; filename
    ? 2 => tstr,                    ; mime-type
    ? 3 => uint,                    ; size-bytes
}

; ============================================================
; Checkpoint Structure
; ============================================================

checkpoint = {
    1 => uint,                      ; sequence-number
    2 => hash-value,                ; content-hash
    3 => pop-timestamp,             ; timestamp
    4 => vdf-proof,                 ; vdf-proof
    ? 5 => delta-metrics,           ; delta
    ? 6 => jitter-binding,          ; jitter
    ? 7 => [+ anchor-reference],    ; anchors
}

delta-metrics = {
    1 => uint,                      ; chars-added
    2 => uint,                      ; chars-deleted
    ? 3 => uint,                    ; words-added
    ? 4 => uint,                    ; words-deleted
}

; ============================================================
; VDF Structures
; ============================================================

vdf-proof = {
    1 => uint,                      ; algorithm
    2 => bstr,                      ; input
    3 => bstr,                      ; output
    4 => uint,                      ; iterations
    ? 5 => bstr,                    ; proof (for succinct VDFs)
    ? 6 => calibration-ref,         ; calibration
}

calibration-ref = {
    1 => hash-value,                ; attestation-hash
    2 => float32,                   ; rate (iter/sec)
}

; ============================================================
; Jitter Seal Structures
; ============================================================

jitter-binding = {
    1 => hash-value,                ; entropy-commitment
    2 => [1*3 uint],                ; sources
    3 => jitter-summary,            ; summary
    4 => bstr,                      ; binding-mac
    ? 5 => [+ uint],                ; raw-intervals (optional)
}

jitter-summary = {
    1 => uint,                      ; sample-count
    2 => [+ histogram-bucket],      ; timing-histogram
    3 => float32,                   ; entropy-bits
}

histogram-bucket = {
    1 => uint,                      ; min-ms
    2 => uint,                      ; max-ms
    3 => uint,                      ; count
}

; ============================================================
; Optional Sections
; ============================================================

presence-section = {
    1 => float32,                   ; active-ratio
    2 => [+ activity-window],       ; windows
}

activity-window = {
    1 => pop-timestamp,             ; start
    2 => pop-timestamp,             ; end
    3 => float32,                   ; activity-level
}

forensics-section = {
    1 => [* paste-event],           ; paste-events
    2 => [* focus-event],           ; focus-events
}

paste-event = {
    1 => pop-timestamp,             ; timestamp
    2 => uint,                      ; char-count
    3 => uint,                      ; checkpoint-ref
}

focus-event = {
    1 => pop-timestamp,             ; timestamp
    2 => bool,                      ; gained (true) or lost
}

keystroke-section = {
    1 => jitter-binding,            ; keystroke-jitter
}

hardware-section = {
    1 => [+ hw-attestation],        ; attestations
}

hw-attestation = {
    1 => uint,                      ; type (1=SE, 16=TPM, 17=SGX)
    2 => bstr,                      ; attestation-data
    3 => pop-timestamp,             ; timestamp
}

external-section = {
    1 => [+ anchor-reference],      ; external-anchors
}

anchor-reference = {
    1 => uint,                      ; type
    2 => tstr / bstr,               ; reference
    3 => pop-timestamp,             ; timestamp
    ? 4 => uint,                    ; status
}

; ============================================================
; Extension Sections
; ============================================================

provenance-section = {
    1 => uuid,                      ; parent-packet-id
    2 => hash-value,                ; parent-chain-hash
    3 => uint,                      ; derivation-type
    ? 4 => COSE_Sign1,              ; cross-packet-attestation
}

continuation-section = {
    1 => uuid,                      ; series-id
    2 => uint,                      ; sequence-number
    3 => hash-value,                ; prev-packet-hash
    ? 4 => continuation-summary,    ; cumulative-summary
}

continuation-summary = {
    1 => uint,                      ; total-checkpoints
    2 => uint,                      ; total-chars-added
    3 => uint,                      ; total-chars-deleted
    4 => float32,                   ; total-duration
}

collaboration-section = {
    1 => bstr,                      ; session-id
    2 => [+ collaborator],          ; collaborators
}

collaborator = {
    1 => bstr,                      ; public-key
    2 => uint,                      ; role
    ? 3 => tstr,                    ; name
    ? 4 => tstr,                    ; identifier
}

; ============================================================
; Attestation Result Types
; ============================================================

forensic-assessment = &(
    authentic: 1,
    suspicious: 2,
    inconclusive: 3,
    insufficient: 4,
)

result-claim = {
    1 => uint,                      ; claim-type
    2 => any,                       ; threshold
    3 => any,                       ; observed-value
    4 => claim-status,              ; status
    ? 5 => trust-basis,             ; trust-basis
}

claim-status = &(
    proven: 1,
    high-confidence: 2,
    moderate-confidence: 3,
    low-confidence: 4,
    failed: 5,
    not-applicable: 6,
)

trust-basis = {
    1 => uint,                      ; basis-type
    ? 2 => float32,                 ; confidence-contribution
}

caveat = {
    1 => uint,                      ; caveat-type
    2 => tstr,                      ; description
    ? 3 => any,                     ; details
}

verifier-info = {
    1 => tstr,                      ; verifier-id
    2 => tstr,                      ; version
    ? 3 => [+ tstr],                ; capabilities
}

; ============================================================
; COSE Placeholder (per RFC 9052)
; ============================================================

COSE_Sign1 = bstr  ; Encoded COSE_Sign1 structure
]]></sourcecode>
    </section>

    <section anchor="security">
      <name>Security Considerations</name>
      <t>
        This document defines a data format schema. Security considerations
        for the use of this schema are specified in the companion architecture
        document <xref target="I-D.condrey-rats-pop"/>.
      </t>
    </section>

    <section anchor="iana">
      <name>IANA Considerations</name>
      <t>
        This document has no IANA actions. IANA registrations for CBOR tags
        and media types are specified in the companion architecture document.
      </t>
    </section>
  </middle>

  <back>
    <references>
      <name>References</name>

      <references>
        <name>Normative References</name>

        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
        </reference>

        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
        </reference>

        <reference anchor="RFC8610" target="https://www.rfc-editor.org/info/rfc8610">
          <front>
            <title>Concise Data Definition Language (CDDL)</title>
            <author fullname="H. Birkholz" initials="H." surname="Birkholz"/>
            <author fullname="C. Vigano" initials="C." surname="Vigano"/>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <date month="June" year="2019"/>
          </front>
          <seriesInfo name="RFC" value="8610"/>
        </reference>

        <reference anchor="RFC8949" target="https://www.rfc-editor.org/info/rfc8949">
          <front>
            <title>Concise Binary Object Representation (CBOR)</title>
            <author fullname="C. Bormann" initials="C." surname="Bormann"/>
            <author fullname="P. Hoffman" initials="P." surname="Hoffman"/>
            <date month="December" year="2020"/>
          </front>
          <seriesInfo name="STD" value="94"/>
          <seriesInfo name="RFC" value="8949"/>
        </reference>
      </references>

      <references>
        <name>Informative References</name>

        <reference anchor="I-D.condrey-rats-pop">
          <front>
            <title>Proof of Process: An Evidence Framework for Digital Authorship Attestation</title>
            <author fullname="David Condrey" initials="D." surname="Condrey"/>
            <date/>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-condrey-rats-pop-00"/>
        </reference>
      </references>
    </references>
  </back>
</rfc>
