Individual Submission C.X. Ruvalcaba Internet-Draft Saluca LLC Intended status: Standards Track 26 November 2026 Expires: 30 May 2027 The Hash-Chain Context Transfer Protocol (HCTP) draft-ruvalcaba-hctp-01 Abstract The Hash-Chain Context Transfer Protocol (HCTP) is a payload format and synchronization protocol for incrementally transferring an ordered, append-only sequence of conversational context between two endpoints over a bandwidth-constrained channel. Acknowledged history is represented by a single fixed-size rolling hash commitment (the "static root"); only not-yet-acknowledged context blocks (the "dynamic window") are transmitted. As a result, the per-message wire overhead attributable to history is constant and independent of the total number of previously acknowledged turns. HCTP is transport- agnostic and carries no confidentiality or peer authentication of its own; it is intended to run over a secure transport. This document specifies the HCTP data model, wire format, rolling-root computation, and synchronization state machine. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on 30 May 2027. Copyright Notice Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved. Ruvalcaba Expires 30 May 2027 [Page 1] Internet-Draft HCTP November 2026 This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Scope and Non-Goals . . . . . . . . . . . . . . . . . . . 4 2. Conventions and Terminology . . . . . . . . . . . . . . . . . 4 3. Data Model . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1. Context Block . . . . . . . . . . . . . . . . . . . . . . 5 3.2. Static and Dynamic Sections . . . . . . . . . . . . . . . 7 4. Rolling-Root Computation . . . . . . . . . . . . . . . . . . 7 5. Wire Format . . . . . . . . . . . . . . . . . . . . . . . . . 8 5.1. SYNC Packet . . . . . . . . . . . . . . . . . . . . . . . 8 5.2. ACK Packet . . . . . . . . . . . . . . . . . . . . . . . 10 6. Protocol Operation . . . . . . . . . . . . . . . . . . . . . 10 6.1. Per-Role State . . . . . . . . . . . . . . . . . . . . . 10 6.2. Sending a SYNC . . . . . . . . . . . . . . . . . . . . . 12 6.3. Receiving a SYNC . . . . . . . . . . . . . . . . . . . . 13 6.4. Receiving an ACK . . . . . . . . . . . . . . . . . . . . 16 6.5. Retransmission and Loss . . . . . . . . . . . . . . . . . 16 6.6. Error Handling and Re-establishment . . . . . . . . . . . 17 7. Bidirectional Synchronization . . . . . . . . . . . . . . . . 18 8. Verifiable Summaries (Optional) . . . . . . . . . . . . . . . 19 9. Protocol Constants . . . . . . . . . . . . . . . . . . . . . 19 10. Transport Considerations . . . . . . . . . . . . . . . . . . 21 11. Security Considerations . . . . . . . . . . . . . . . . . . . 23 12. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 12.1. HCTP Packet Type Registry . . . . . . . . . . . . . . . 25 12.2. HCTP Version Registry . . . . . . . . . . . . . . . . . 26 12.3. Media Type Registration . . . . . . . . . . . . . . . . 26 13. Normative References . . . . . . . . . . . . . . . . . . . . 26 14. Informative References . . . . . . . . . . . . . . . . . . . 27 Appendix A. Test Vectors . . . . . . . . . . . . . . . . . . . . 27 A.1. Genesis Root . . . . . . . . . . . . . . . . . . . . . . 28 A.2. Three ASCII Blocks . . . . . . . . . . . . . . . . . . . 28 A.3. Non-ASCII Block . . . . . . . . . . . . . . . . . . . . . 29 A.4. SYNC and ACK . . . . . . . . . . . . . . . . . . . . . . 29 Appendix B. Changes since draft-ruvalcaba-hctp-00 . . . . . . . 30 Canonical encoding . . . . . . . . . . . . . . . . . . . . . . 30 Packet validation and the receiver procedure . . . . . . . . . 31 Sender procedure . . . . . . . . . . . . . . . . . . . . . . . 32 Ruvalcaba Expires 30 May 2027 [Page 2] Internet-Draft HCTP November 2026 Bidirectional operation . . . . . . . . . . . . . . . . . . . . 32 Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Transport mapping . . . . . . . . . . . . . . . . . . . . . . . 33 Security considerations . . . . . . . . . . . . . . . . . . . . 33 Removed . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Design choices made in this revision . . . . . . . . . . . . . 34 Open questions . . . . . . . . . . . . . . . . . . . . . . . . 35 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 35 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 35 1. Introduction Conversational and agentic systems increasingly need to share an evolving record of interaction ("context") between components: between a client and a service, between cooperating agents, or between a live process and a resumable checkpoint. The naive approach retransmits the entire conversation on every exchange, so the wire cost grows without bound as the conversation lengthens. This is wasteful on any channel and prohibitive on a constrained one. HCTP addresses this by partitioning the context into two parts: * a *static section* of blocks both endpoints have acknowledged, represented on the wire by a single 32-octet rolling hash (the static root); and * a *dynamic window* of pending blocks that have not yet been acknowledged, which is the only part transmitted. Each context block commits to the raw text of one turn via a content hash and additionally carries a short semantic summary, so that an endpoint may operate on the summary as context without ever receiving the raw text, while retaining the ability to verify the block against the raw text if it later obtains it (Section 8). HCTP provides ordering and tamper-evidence through a hash chain. It does *not* provide confidentiality, peer authentication, or non- repudiation, and its integrity guarantees are meaningful only when it is carried over a transport that authenticates the peer and protects the payload (Section 11). HCTP is deliberately independent of any particular transport: it defines the payload octets, and any datagram or stream transport MAY carry them. Ruvalcaba Expires 30 May 2027 [Page 3] Internet-Draft HCTP November 2026 1.1. Scope and Non-Goals This document specifies only the transport-agnostic core: the block format, the rolling-root commitment, the SYNC/ACK exchange, and the rules for advancing the chain. Mechanisms for peer authentication, key establishment, message confidentiality, and the specific method by which a summary is produced are out of scope and are expected to be supplied by the surrounding system. 2. Conventions and Terminology 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 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. Context block: The unit of context corresponding to one conversational turn (Section 3.1). Static root: A 32-octet rolling hash committing to the ordered sequence of acknowledged context blocks. Dynamic window: The ordered set of pending context blocks not yet acknowledged by the peer. SYNC: A packet sent to convey the dynamic window and the current static root. ACK: A packet sent to acknowledge a SYNC and report the acknowledged static root. Fold: The operation that advances the static root by incorporating one context block (Section 4). Sender / Receiver: Roles with respect to a single SYNC exchange. An endpoint MAY act in both roles; see Section 7. Scope instance: The instance, defined by the layer beneath HCTP, to which one HCTP session and all of its state are bound: either one underlying transport connection, or one enclosing session defined by the protocol that carries HCTP and that can outlive a single connection, for example a session that resumes on a new connection (Section 10). Ruvalcaba Expires 30 May 2027 [Page 4] Internet-Draft HCTP November 2026 All multi-octet integers in this document are unsigned and encoded in network byte order (big-endian). Octet strings written as hexadecimal are shown for illustration only; on the wire they are raw octets. 3. Data Model 3.1. Context Block A context block is a logical record with the following fields: seq: An unsigned 32-bit sequence number identifying the block's position in the ordered context. Numbering starts at 0, and the block at position n carries seq n. The sequence space is per directional chain (Section 7): in a bidirectional session each of the two chains starts at 0 and is numbered independently, and a one-way session has a single chain, which also starts at 0. role: A UTF-8 label identifying the originator of the turn (for example "user" or "agent"), whose UTF-8 encoding is 1 to MAX_ROLE_LEN (Section 9) octets in length. Its interpretation is application-defined, and it does not select the chain to which a block belongs (Section 7). content_hash: The SHA-256 [RFC6234] digest of the UTF-8 encoding of the raw turn text, written as exactly 64 ASCII lowercase hexadecimal digits. summary: A UTF-8 semantic summary of the turn, of at most MAX_SUMMARY_LEN (Section 9) Unicode code points, counted after UTF-8 decoding; a character outside the Basic Multilingual Plane counts as one code point. For hashing and for on-the-wire serialization, a context block MUST be encoded as the canonical encoding of the block, denoted canonical(B) for a block B. canonical(B) is the JSON Canonicalization Scheme [RFC8785] serialization of B, and B MUST be a JSON object [RFC8259] containing exactly the members "content_hash", "role", "seq", and "summary", each present exactly once. Neither [RFC8785] nor [RFC8259] assigns a meaning to an object with duplicate member names, so a block that repeats a member name has no canonical encoding and is not a valid block. [RFC8785] already fixes the member order, the absence of insignificant whitespace, the separators, and the serialization of strings and numbers. This document restates those properties, for the specific case of a block, in this section and the paragraphs that follow: member names in ascending Unicode code point order, which for Ruvalcaba Expires 30 May 2027 [Page 5] Internet-Draft HCTP November 2026 these four names is the same order as the UTF-16 code unit order that [RFC8785] uses; no insignificant whitespace; no separators other than a single "," between members and a single ":" between a member name and its value; and the string and number forms given below. Those restatements introduce no requirement that [RFC8785] does not already impose. Should a restatement and [RFC8785] ever appear to differ, [RFC8785] governs. An encoder that produces canonical(B) MUST serialize strings as specified in Section 3.2.2.2 of [RFC8785]: only the quotation mark (U+0022), the reverse solidus (U+005C), and the code points U+0000 through U+001F are escaped. U+0008, U+0009, U+000A, U+000C, and U+000D are written as "\b", "\t", "\n", "\f", and "\r" respectively; every other code point in the range U+0000 through U+001F is written as "\u00xx" with lowercase hexadecimal digits; every other character appears as its UTF-8 octets. In particular, the characters "<", ">", and "&", the code points U+2028 and U+2029, and U+007F MUST NOT be escaped, and the ASCII-escaped form that writes every character outside U+0020 through U+007E as "\uXXXX" MUST NOT be used. These are requirements on the encoder. The matching requirement on a receiver, that it reject a received SYNC whose octets are not exactly canonical, is stated once in Section 6.3 and is not restated here. The value of "seq" MUST be serialized as a JSON number written as ASCII digits only: no sign, no leading zeros except for the value 0 itself, no fraction, and no exponent. This is the form that the number serialization of Section 3.2.2.3 of [RFC8785] gives for a value in the range 0 to 4294967295, which is the range of every seq value; [RFC8785] is cited as the source of the rule. A spelling that departs from that form is not canonical; non-canonical spellings include a JSON string, "0.0", "1e0", "-0", and "00". The value of "content_hash" MUST be exactly 64 ASCII lowercase hexadecimal digits. Any other spelling, including uppercase digits, is not canonical. No Unicode normalization is applied to "role", "summary", or the raw turn text that is hashed into "content_hash". Canonically equivalent but octet-different text therefore yields different "content_hash" values and, through them, different static roots (Section 4); an application that requires equivalence MUST normalize before constructing a block. All strings in a block MUST be well-formed UTF-8; a string containing an unpaired surrogate is not well-formed UTF-8 and is therefore excluded. A block is not valid if its "role" is not well-formed UTF- 8, if the UTF-8 encoding of its "role" is shorter than 1 octet or longer than MAX_ROLE_LEN octets, or if its "summary" exceeds Ruvalcaba Expires 30 May 2027 [Page 6] Internet-Draft HCTP November 2026 MAX_SUMMARY_LEN Unicode code points. These conditions, together with the spelling rules above, are among the conditions on which a received SYNC is rejected, and they are applied at the ingest step of Section 6.3. When blocks are carried together, they form a JSON array: "[" followed by the canonical encodings of the blocks separated by single commas, closed by "]", with no whitespace. A receiver MUST fold canonical(B) rather than the octets it received. The requirement that the received octets be exactly the canonical encoding of the array and of each block it parses, and every other condition on which a received SYNC is rejected, are specified in Section 6.3. It follows from that requirement, and is not a separate rule, that the octets received for an accepted SYNC are the canonical octets of its array, and that a receiver which retains a digest of those received octets retains a digest of the canonical encoding (Section 6.3). 3.2. Static and Dynamic Sections An endpoint maintains, per directional chain (Section 7): * a static root: a 32-octet value initialized to the genesis root (Section 4) and advanced only as blocks are acknowledged; and * when it acts as sender on that chain, a dynamic window: an ordered list of pending context blocks. In a bidirectional session the endpoint pair maintains two chains, one per direction, each with its own static root and its own dynamic window, and the requirement to maintain both chains applies to such a session only. A one-way session has a single chain. An endpoint that only receives on a chain keeps no dynamic window for it. Acknowledged blocks are never retransmitted; they are represented solely by the static root, whose size is constant and independent of the number of blocks it commits to. 4. Rolling-Root Computation The static root is a SHA-256 hash chain over acknowledged blocks. Let "||" denote octet-string concatenation and SHA256(x) denote the 32-octet SHA-256 digest of x. The genesis root is defined as: root_0 = SHA256(GENESIS_SEED) Ruvalcaba Expires 30 May 2027 [Page 7] Internet-Draft HCTP November 2026 where GENESIS_SEED is the ASCII octet string "hctp-genesis-v1" (15 octets, no trailing NUL). Given a current root R and a block B, folding B advances the root: fold(R, B) = SHA256( R || SHA256(canonical(B)) ) The static root after acknowledging blocks B_1, ..., B_n (in order) is therefore: root_n = fold( fold( ... fold(root_0, B_1) ..., B_{n-1}), B_n ) Because each root embeds every prior acknowledged root, any modification, reordering, insertion, or deletion of acknowledged history produces a different static root, and the mismatch is detected at the next SYNC (Section 6.3). 5. Wire Format HCTP defines two packet types, SYNC and ACK. Every packet begins with a 1-octet version and a 1-octet packet type. The version specified by this document is 0x01. This section defines the format of each packet type together with the obligations that follow from it for a sender. It defines formats only. The conditions under which a receiver rejects a received SYNC are defined once, in the single ordered list of Section 6.3, and a receiver applies them there and nowhere else. 5.1. SYNC Packet 0 1 2 3 4 5 6 +--------+--------+--------------------------+ |version | ptype | seq | | 0x01 | 0x53 | (uint32, 4 octets) | +--------+--------+--------------------------+ | static_root | | (32 octets) | +--------------------------------------------+ | dynamic_len | | (uint32, 4 octets) | +--------------------------------------------+ | dynamic_data (dynamic_len octets) | | ... | +--------------------------------------------+ | combined_hash | | (32 octets) | +--------------------------------------------+ Ruvalcaba Expires 30 May 2027 [Page 8] Internet-Draft HCTP November 2026 version (1 octet): MUST be 0x01. The receiver checks this field as part of the framing and version check of Section 6.3. ptype (1 octet): MUST be 0x53 (ASCII 'S') for SYNC. The receiver checks this field in the same check. seq (4 octets): The sequence number of the last block in the dynamic window carried by this SYNC. A sender MUST set it to the seq member of the last block encoded in dynamic_data. static_root (32 octets): The sender's current static root, i.e., the root over all blocks the sender has acknowledged prior to this SYNC. dynamic_len (4 octets): The length in octets of dynamic_data. A sender MUST NOT emit a SYNC in which dynamic_len is zero. dynamic_data (dynamic_len octets): A single zlib [RFC1950] stream, compressed with DEFLATE [RFC1951], whose uncompressed content is the array [E_1, ..., E_n] of the canonical block encodings defined in Section 3.1, in ascending seq order. The array MUST contain at least one block. The array MUST be encoded exactly as the canonical block array of Section 3.1: an opening "[", the canonical blocks separated by single commas, and a closing "]", with no insignificant whitespace, and no other octets. The compressed stream MUST have the FDICT flag (Section 2.2 of [RFC1950]) clear, and it MUST consist of exactly one complete zlib stream that ends at the last octet of dynamic_data, so that a truncated stream, a stream followed by octets that are not part of it, and two or more concatenated streams are all excluded by this definition. combined_hash (32 octets): SHA256(static_root || dynamic_data), computed over the static_root field and the compressed dynamic_data octets exactly as they appear on the wire. The fixed fields of a SYNC total 74 octets, independent of the acknowledged-history depth, and the total size of the packet is 74 octets plus dynamic_len. The 42 octets that precede dynamic_data are the fixed header prefix that a receiver reads first in order to learn dynamic_len (Section 10); the 74-octet and 42-octet figures describe the same fields and differ only in where they stop. Both values are listed in Section 9. A sender MUST derive the seq field from the final block of dynamic_data, and a retransmission MUST be an octet-identical copy of the SYNC it repeats (Section 6.5). Every format requirement stated in this subsection is enforced as a rejection condition by the Ruvalcaba Expires 30 May 2027 [Page 9] Internet-Draft HCTP November 2026 receiver at the ingest validation step of Section 6.3, which is the sole ordered list of the conditions under which a received SYNC is rejected. 5.2. ACK Packet 0 1 2 3 4 5 6 +--------+--------+--------------------------+ |version | ptype | seq | | 0x01 | 0x41 | (uint32, 4 octets) | +--------+--------+--------------------------+ | new_root | | (32 octets) | +--------------------------------------------+ version (1 octet): MUST be 0x01. ptype (1 octet): MUST be 0x41 (ASCII 'A') for ACK. seq (4 octets): The seq of the SYNC being acknowledged, echoed unchanged. new_root (32 octets): The receiver's static root after folding in the acknowledged blocks (Section 6.3). An ACK packet is exactly 38 octets. 6. Protocol Operation 6.1. Per-Role State The SYNC/ACK exchange is asymmetric, and sender state MUST NOT be conflated with receiver state. State is maintained per directional chain. A one-way session has a single chain. A bidirectional session has two independent chains, and an endpoint pair MUST maintain both for the lifetime of the session (Section 7). The chain to which a SYNC belongs is determined solely by the channel on which it is received, that is, by the direction of transfer within the scope instance as established by the layer beneath; the role label never determines the chain. For a given directional chain an endpoint maintains: Receiver state: * local_root: the current static root; * last_seen_seq: the seq of the most recently accepted SYNC; Ruvalcaba Expires 30 May 2027 [Page 10] Internet-Draft HCTP November 2026 * last_block_seq: the seq of the last block folded into local_root, absent if no block has yet been folded; * has_seen: a boolean, initially false, set to true when the first SYNC is accepted; * ack_cache: a single entry holding the cached ACK, the pre-fold root over which that ACK was computed, and the SHA-256 digest of the received octets of the SYNC to which that ACK responds. The digest is over those octets exactly as received, and those octets are the raw received octets. The entry is stored only on the accept path, after the ingest validation of Section 6.3 has established that the octets are canonical. The entry is of fixed size, and the receiver does not retain the SYNC octets themselves. Sender state: * static_root: the current static root; * dynamic: the ordered list of pending blocks, frozen while a SYNC is outstanding (Section 6.2); * a queue holding blocks originated while the dynamic window is frozen; * next_seq: the seq to assign to the next block the sender originates. A block receives its seq when it is originated, whether it enters the dynamic window at once or waits in the queue, so queued blocks already carry consecutive seq values when they are promoted; * pending_seq: the seq of the outstanding, unacknowledged SYNC, if any; * last_acked_seq: the seq of the most recently acknowledged SYNC, undefined until the first ACK is accepted; * the last transmitted SYNC octets, retained for octet-identical retransmission (Section 6.5); * a retransmit timer and a bounded retransmit counter. last_acked_seq is undefined until the first ACK is accepted. An implementation MAY track that definedness with a separate boolean but MUST NOT initialize last_acked_seq to a numeric sentinel. The sender holds no cached ACK; an ACK cache is receiver state only. Ruvalcaba Expires 30 May 2027 [Page 11] Internet-Draft HCTP November 2026 The queue is discarded when the outstanding SYNC is abandoned, when a fatal session error is declared (Section 6.6), or when the session ends. The sender state is likewise discarded when a session ends or a session error is declared (Section 6.6). Sequence numbers are scoped to a single directional chain and start at 0, so the chains of a bidirectional session number their blocks independently. 6.2. Sending a SYNC To transmit pending context, the sender first determines the part of the dynamic window that the SYNC will carry. If the frozen dynamic window W fits in a single SYNC within the baselines of Section 9, the part is W. Otherwise the part is the first part of W that has not yet been acknowledged, as specified by the splitting rule below. The sender then: 1. computes dynamic_data by serializing the blocks of the part to be sent, in ascending seq order, as the canonical block array of Section 3.1 and compressing the result with zlib [RFC1950], with the FDICT flag clear as required by Section 5.1; 2. sets combined_hash to SHA256(static_root || dynamic_data), computed over the static_root field and the compressed dynamic_data octets exactly as they are sent; 3. sets seq to the seq of the last block in dynamic_data and records that value as pending_seq; 4. emits the SYNC packet and starts the retransmit timer when the packet is emitted. The sender MUST NOT advance its static_root at send time; the root is advanced only upon receiving a valid ACK (Section 6.4). While pending_seq is set, the sender MUST NOT add, remove, or reorder blocks in the dynamic window, except to remove an acknowledged part as specified below. Blocks originated during that period MUST be queued and admitted to the window only after the ACK for the last part of the frozen window is accepted or the outstanding SYNC is abandoned. When the frozen dynamic window W does not fit in a single SYNC within the baselines of Section 9, the sender MUST divide W, in ascending seq order, into consecutive parts P_1, ..., P_k, each within those baselines. It sends a SYNC carrying exactly P_1 over the current static_root, with pending_seq set to the seq of the last block of Ruvalcaba Expires 30 May 2027 [Page 12] Internet-Draft HCTP November 2026 P_1. On accepting the ACK for that SYNC, the sender folds exactly the blocks of P_1 into static_root, removes them from W, sets last_acked_seq, clears pending_seq, and then sends the SYNC for P_2 over the new static_root, and so on. W stays frozen, with no block added, removed, or reordered other than the removal of an acknowledged part, until the ACK for P_k is accepted; only then are queued blocks promoted into the window. Each part is retransmitted, if needed, under the ordinary rule of Section 6.5. The receiver treats each part as an ordinary SYNC and never reassembles blocks across SYNC packets. The usable size of the underlying channel is the sender's choice and is not part of conformance. A sender MAY choose a part smaller than the baselines, but it MUST NOT exceed the baselines in a single SYNC. 6.3. Receiving a SYNC Reject, as used in this document, means that the packet is discarded, no state changes, and no response is sent. A rejection is fatal only where this section states that it is. Where this section says that a packet is discarded without state change, the packet is not processed further and no response is sent. On receiving a candidate SYNC packet P, the receiver applies the following checks in order: 1. Framing and version. The transport unit MUST satisfy the framing rules of Section 10: it MUST contain exactly one HCTP packet, and that packet MUST occupy the full length of the transport unit. version MUST be 0x01 and ptype MUST be 0x53. The receiver MUST compare dynamic_len with its local bound (Section 9) before it allocates for or reads dynamic_data, and a value above that bound fails this check. A packet that fails any part of this check is discarded without any state change. 2. Integrity. The receiver MUST recompute SHA256(P.static_root || P.dynamic_data) over the fields exactly as received and MUST reject the packet if the result does not equal P.combined_hash. This rejection is not fatal. 3. Replay. If has_seen is true and P.seq is less than last_seen_seq, the SYNC is a replay of already-superseded state and MUST be silently discarded. 4. Duplicate. If has_seen is true and P.seq equals last_seen_seq, the receiver MUST compute SHA256 over the complete received SYNC octets exactly as received and compare the result with the digest recorded in ack_cache. If they are equal, the SYNC is a Ruvalcaba Expires 30 May 2027 [Page 13] Internet-Draft HCTP November 2026 retransmission of an already-processed SYNC whose ACK was lost: the receiver MUST resend the cached ACK and MUST NOT fold again. If they differ, the SYNC MUST be silently discarded. The digest is over the raw received octets; canonicality of those octets is not established on this path and is not needed for the comparison. Canonicality is established only on the accept path, at ingest validation, before the digest is stored. The receiver does not compare dynamic_data on this path, and it does not retain the SYNC octets themselves. 5. Alignment. If P.static_root does not equal local_root, the endpoints disagree on acknowledged history and the receiver MUST treat this as a fatal session error (Section 6.6). This is the only check in this list that is fatal. 6. Ingest validation. The receiver decompresses P.dynamic_data within the bounds of Section 9 and Section 11 and validates the result. The receiver's accepted decompressed bound MUST be at least MAX_DECOMPRESSED_LEN_BASE and its accepted block bound MUST be at least MAX_BLOCKS_PER_SYNC_BASE; the receiver MUST abort decompression that exceeds its accepted bounds. The checks are: * P.dynamic_len MUST be non-zero, and P.dynamic_data MUST contain exactly one complete zlib stream, with FDICT zero, that ends at the last octet of dynamic_data ([RFC1950]); * the decompressed octets MUST be exactly the canonical encoding of a non-empty array of blocks as defined in Section 3.1; the receiver MUST produce the canonical encoding of the blocks it parses and MUST reject octets that differ from that encoding; * every element MUST be an object carrying exactly the members content_hash, role, seq, and summary, each present exactly once. A block with duplicate member names has no canonical encoding and is invalid; * each block MUST satisfy Section 3.1 and the limits of Section 9: content_hash MUST be exactly 64 ASCII lowercase hexadecimal digits; role MUST be well-formed UTF-8 whose encoding is 1 to MAX_ROLE_LEN octets; summary MUST be at most MAX_SUMMARY_LEN Unicode code points; and seq MUST be serialized as decimal ASCII digits, with no sign, no leading zeros except for the value 0 itself, no fraction, and no exponent (Section 3.2.2.3 of [RFC8785]). A receiver MUST reject any other spelling of seq, including a JSON string and a number with a sign, a leading zero other than the value 0, a fraction, or an exponent; Ruvalcaba Expires 30 May 2027 [Page 14] Internet-Draft HCTP November 2026 * the seq values MUST be strictly ascending and contiguous, starting at last_block_seq + 1, or at 0 when no block has yet been folded; * the seq of the last block MUST equal P.seq. Any failure of this step means reject: no fold, no ACK, and no state change. The format rules of Section 5.1 are enforced here. The ordered list of this section is the sole set of SYNC rejection conditions in this document. 7. Accept. The receiver records pre_fold_root = local_root, folds each accepted block into local_root in order, folding canonical(B) rather than the received octets (Section 4), sets last_block_seq to the seq of the last accepted block, sets last_seen_seq = P.seq, sets has_seen = true, constructs an ACK with new_root = local_root, replaces ack_cache with the entry (ACK, pre_fold_root, digest), where digest is SHA256 of the complete received SYNC octets exactly as received and is computed after the ingest validation above has confirmed that those octets are canonical, and sends the ACK. On this accept path last_seen_seq equals last_block_seq, because the ingest validation requires the packet seq to equal the seq of the last block; the two are kept separate because a rejected SYNC may have a packet seq that differs from the seq of the last folded block. Integrity is checked before the duplicate step so that the cached-ACK path is never reached with a body that is inconsistent with its own combined_hash. The duplicate step compares a digest of the complete received SYNC, taken over the octets exactly as received, with the cached digest, so the cached-ACK path answers only an exact retransmission. A well-formed injected SYNC that carries the cached seq but different octets therefore receives silence, not a cached ACK. The replay and duplicate checks precede alignment because a retransmission carries the pre-fold root, which by construction no longer equals local_root. All non-fatal rejections are silent because HCTP/1 defines no error packet. A static-root mismatch is fatal and is therefore the one observable outcome at the HCTP layer. A receiver whose state has just been reset has has_seen false and local_root equal to the fixed genesis root. Such a receiver cannot distinguish an old first SYNC of a prior session from a new one, and it accepts the first SYNC that satisfies the remaining checks however old that SYNC may be. This guarantee is wholly the transport's; a receiver cannot check it, and a static-root mismatch is the only outcome the HCTP layer exposes. Ruvalcaba Expires 30 May 2027 [Page 15] Internet-Draft HCTP November 2026 6.4. Receiving an ACK On receiving an ACK packet A, the sender: 1. discards A without state change if A.seq does not equal pending_seq (a stale or duplicate ACK), or if last_acked_seq is defined and A.seq is less than or equal to last_acked_seq. When last_acked_seq is undefined, the second condition does not apply, so an ACK for the first SYNC is processed; 2. otherwise computes a candidate root by folding, in ascending seq order, each block of the part carried by the outstanding SYNC, which is exactly the set of blocks carried by that SYNC, into static_root, without modifying any state; 3. MUST treat A as a fatal divergence if A.new_root does not equal the candidate root (Section 6.6). The candidate root is not committed, and the sender MUST end the session as required by Section 6.6 immediately: it MUST NOT send another SYNC or process another ACK on that session first. No state is retained after the session ends; 4. on success commits the candidate root as static_root, removes exactly the blocks of the acknowledged part from the dynamic window, sets last_acked_seq = A.seq, clears pending_seq, cancels the retransmit timer. If the acknowledged part was P_k, so that no part of the frozen window remains, it promotes queued blocks into the dynamic window; otherwise it sends the SYNC for the next part over the new static_root. 6.5. Retransmission and Loss If the retransmit timer expires before an ACK is accepted, the sender MUST retransmit an octet-for-octet identical SYNC, bearing the *unchanged* seq and the *unchanged* pre-fold static_root, up to a bounded retransmit count. A single lost ACK MUST NOT cause session re-establishment or re-keying: because the retransmission is octet- identical, the duplicate rule of Section 6.3 re-elicits the cached ACK without double-folding. If a retransmission is corrupted in transit so that its octets differ from the cached SYNC, the receiver silently discards it as specified by the duplicate check of Section 6.3, and recovery from that corruption is the responsibility of the transport: TLS and QUIC, for example, reject corrupted records before HCTP sees them. HCTP does not repair a corrupted packet. Only after the bounded retransmit count is exhausted without acknowledgment does the sender signal transport failure to the application, at which point it MUST discard all session state, including the retained SYNC octets, the retransmit timer and counter, Ruvalcaba Expires 30 May 2027 [Page 16] Internet-Draft HCTP November 2026 the dynamic window, the queue, pending_seq, and last_acked_seq. The sender holds no cached ACK. 6.6. Error Handling and Re-establishment A static-root mismatch, whether detected by a receiver at the alignment check (Section 6.3) or by a sender comparing A.new_root against its candidate root (Section 6.4), means the endpoints no longer agree on the acknowledged history or on the fold of the outstanding window, and cannot be reconciled within HCTP. Implementations MUST treat this as a fatal session error and re- establish a new session from the fixed genesis root (Section 4). HCTP/1 always resets to that fixed root and defines no session- specific genesis. HCTP does not define reconciliation of divergent chains; such divergence indicates loss, reordering that escaped detection at a lower layer, or tampering. Session state is scoped to one scope instance (Section 10). An endpoint MUST NOT reset HCTP state while the scope instance continues; it resets HCTP state only together with the end of that instance. Where the scope instance is an enclosing session that moves to a new connection, the HCTP session and all of its state continue across that move unchanged, and an outstanding SYNC is retransmitted octet-for-octet on the new connection (Section 6.5). A fatal session error, or exhaustion of the retransmit count, ends the HCTP session; where the scope instance is an enclosing session, HCTP MUST NOT continue within that instance, and the protocol that defines it determines whether that instance is ended or a new one is established. A receiver whose state has just been reset cannot distinguish an old first SYNC of a prior session from a new one, and session freshness, including prevention of whole-session replay, therefore rests wholly on the layer beneath (Section 11). A static- root mismatch is the one observable outcome at the HCTP layer. When an HCTP session ends, each endpoint MUST discard all sender and receiver state it holds for every chain, including local_root, last_seen_seq, last_block_seq, has_seen, ack_cache, static_root, dynamic, the queue, next_seq, pending_seq, last_acked_seq, the retained SYNC octets, the retransmit timer, and the retransmit counter. A later exchange MUST start a new session from the fixed genesis root. The seq field is a 32-bit unsigned integer. An endpoint MUST NOT assign a seq greater than 2^32 - 1 on a chain and MUST end the session before it would do so. Chains exceeding 2^32 blocks are not supported. A reset forced by seq exhaustion is not caused by loss and does not conflict with the single-lost-ACK rule of Section 6.5. Ruvalcaba Expires 30 May 2027 [Page 17] Internet-Draft HCTP November 2026 7. Bidirectional Synchronization When both endpoints originate context concurrently, a single shared static root can diverge, because each endpoint would fold blocks in an order the other cannot reproduce. HCTP resolves this with per- direction chains: the endpoint pair maintains two independent rolling-root chains, one advanced solely by folding blocks originated by the first endpoint and acknowledged by the second, and the other advanced solely by folding blocks originated by the second endpoint and acknowledged by the first. Because opposite-direction SYNCs fold into disjoint chains, they cannot diverge. The chain to which a SYNC belongs is determined solely by the transport direction on which that SYNC is received. Each directional chain corresponds to one direction of the underlying transport, and an endpoint associates each received SYNC with the chain of the direction in which it arrived. The "role" member of a block is an application-defined label (Section 3.1) and MUST NOT be used to select a chain: two implementations that read that label differently would place the same block on different chains, and the two chains would then advance over different block sequences. The seq space is per directional chain, not per session. Each chain numbers its blocks independently from 0 (Section 3.1), so the two chains of a bidirectional session each begin at seq 0, and the receiver maintains a separate local_root, last_seen_seq, last_block_seq, has_seen and ack_cache for each chain (Section 6.1). Because exactly one endpoint originates the blocks of a given chain, every seq value within that chain has a single writer. The number of chains a session maintains is the number of directions in which context flows. A session in which only one endpoint originates context is one-way and has a single chain: the originating endpoint holds sender state for it and the other endpoint holds receiver state for it (Section 6.1), and no second chain is instantiated. A session in which both endpoints originate context is bidirectional, and the endpoint pair MUST maintain both chains for the lifetime of that session; each chain is advanced only when the endpoint that receives it accepts a SYNC on that chain and acknowledges it, and neither chain substitutes for the other. Because the two chains of a bidirectional session must be told apart by the direction in which a SYNC arrives, a transport that cannot distinguish the two directions cannot carry a bidirectional session (Section 10). The chains of a session are scoped to one scope instance (Section 6.6). Where several requests or streams are carried within one scope instance, they share that single session and its chains Ruvalcaba Expires 30 May 2027 [Page 18] Internet-Draft HCTP November 2026 rather than each starting its own. A new session, and with it new chains that start from the genesis root (Section 4), begins only when the scope instance ends. Per-direction chains are the only synchronization strategy defined by HCTP/1. The remainder of this paragraph records a design choice rather than a requirement, and it constrains neither an implementation of HCTP/1 nor a future version. Serializing all folds onto a single shared chain with a single-writer turn-token is deliberately not specified: under such a token, the token changes hands when an ACK is transmitted, so a single lost ACK transfers it to a peer that has not yet advanced its root, and recovering from that state would require the session re-establishment that Section 6.5 requires a single lost ACK not to cause. A future version that reintroduces a token would need to specify its own recovery rule. 8. Verifiable Summaries (Optional) An endpoint that lacks the raw turn text MAY operate using the block's summary as its working context. If the endpoint later obtains the raw text, it can verify the block by recomputing content_hash from the raw text and comparing it to the block's content_hash field. Implementations MAY additionally make the summary itself reproducible and thus verifiable, rather than merely asserted, by computing it with a fixed, pre-agreed deterministic summarization function -- for example a summarizer identified by name and version, applied with a fixed prompt or template and a deterministic decoding configuration -- such that any party holding the raw text and the agreed configuration recomputes the identical summary. This document does not mandate any particular summarization function; when determinism across heterogeneous implementations cannot be guaranteed, an endpoint MAY instead verify a summary under a pre-agreed equivalence predicate (for example a canonicalization or a distance threshold). Absent such a mechanism, the summary MUST be treated as an unverified assertion. 9. Protocol Constants PROTO_VERSION: 0x01 PTYPE_SYNC: 0x53 PTYPE_ACK: 0x41 GENESIS_SEED: the ASCII octets "hctp-genesis-v1" (15 octets, no Ruvalcaba Expires 30 May 2027 [Page 19] Internet-Draft HCTP November 2026 trailing NUL) Hash function: SHA-256 [RFC6234] Compression: zlib [RFC1950] / DEFLATE [RFC1951], with the zlib FDICT flag clear (Section 5.1) MAX_SUMMARY_LEN: 120 Unicode code points, counted after UTF-8 decoding and before any normalization, with a non-BMP character counting once (Section 3.1) MAX_ROLE_LEN: 64 octets, the maximum length of the UTF-8 encoding of role; that encoding MUST be well-formed UTF-8 and MUST be at least 1 octet (Section 3.1) MAX_BLOCKS_PER_SYNC_BASE: 64 blocks MAX_DECOMPRESSED_LEN_BASE: 65536 octets SYNC fixed overhead: 74 octets, being the fixed header prefix of 42 octets followed by the 32-octet combined_hash (Section 5.1); the total size of a SYNC is 74 octets plus dynamic_len SYNC fixed header prefix: 42 octets, the fields a receiver reads first in order to learn dynamic_len (Section 10) ACK size: 38 octets (Section 5.2) MAX_SUMMARY_LEN and MAX_ROLE_LEN are fixed limits on the corresponding block members. The format of those members, and the conditions under which a received block or SYNC is rejected, are defined once in Section 3.1 and Section 6.3; this section only fixes their values. MAX_BLOCKS_PER_SYNC_BASE and MAX_DECOMPRESSED_LEN_BASE are minimum capacities, not maxima. Both apply to a single SYNC packet. Every receiver MUST accept at least MAX_BLOCKS_PER_SYNC_BASE blocks and at least MAX_DECOMPRESSED_LEN_BASE octets of decompressed output in one SYNC, and MAY accept more. The finite bound that a receiver actually enforces MUST be at least these baselines, and the receiver MUST abort decompression that exceeds that bound (Section 11). A sender MUST NOT exceed either baseline in a single SYNC; when the pending blocks do not fit within them, it MUST divide them into consecutive parts and send each part in its own SYNC (Section 6.2). The usable size of the underlying channel is the sender's own choice: it is not a protocol constant, and conformance is assessed against the baselines above rather than against any particular channel size. Ruvalcaba Expires 30 May 2027 [Page 20] Internet-Draft HCTP November 2026 MAX_DECOMPRESSED_LEN_BASE bounds decompressed output and does not bound the length of dynamic_data. No protocol constant bounds dynamic_len: a receiver MUST bound it before allocation, that bound is a local matter, and a value above the receiver's bound is rejected without allocation (Section 6.3 and Section 11). 10. Transport Considerations HCTP is transport-agnostic; it defines only the octets of SYNC and ACK packets. A SYNC is self-delimiting, since its length is fully determined by its fixed fields plus dynamic_len (Section 5.1), and an ACK is a fixed 38 octets (Section 5.2). A packet MAY be carried as a single datagram, a length-framed record on a stream, a WebSocket [RFC6455] binary message, or the body of an HTTP request or response. Each transport unit MUST carry exactly one HCTP packet and no other octets. On a datagram transport, one packet per datagram. On a stream transport, one packet per length-framed record, the length being that of the packet as defined by its fixed fields plus dynamic_len for a SYNC, and 38 octets for an ACK. A receiver reads the 42-octet fixed header prefix of a SYNC first (version, ptype, seq, static_root and dynamic_len), then reads exactly dynamic_len octets of dynamic_data followed by the 32 octets of combined_hash, and requires the transport unit to end at that octet. The 42-octet prefix and the 74-octet fixed overhead of Section 5.1 measure different spans: 42 octets precede dynamic_data, and 74 octets is that prefix plus the 32-octet combined_hash. A transport unit that is shorter than the length so derived, or that carries octets after combined_hash, does not carry exactly one packet and therefore fails the framing and version check of Section 6.3. This section defines the format of a transport unit; the conditions under which a received packet is rejected, and the consequence of each rejection, are stated once in Section 6.3 and are not restated here. The directional chain to which a SYNC belongs is determined by the transport channel on which it is received, and never by the role member of a block, which is application data (Section 7). A transport that carries both chains of a bidirectional session therefore MUST provide a distinguishable channel for each direction, for example a separate connection per direction or an explicit stream mapping. A transport that cannot distinguish the two directions, such as a single HTTP/1.1 connection carrying requests in both directions, MUST NOT carry a bidirectional session; over such a transport a session is necessarily one-way and has the single chain described in Section 7. Ruvalcaba Expires 30 May 2027 [Page 21] Internet-Draft HCTP November 2026 An HCTP session is scoped to exactly one scope instance. All sender state and receiver state is scoped to that instance, and an endpoint discards that state only together with the end of the instance (Section 6.6). A reset of HCTP state while the scope instance continues is not permitted. Unless the protocol carrying HCTP defines an enclosing session and states that HCTP is scoped to it, the scope instance is one underlying transport connection. A protocol that scopes HCTP to an enclosing session MUST state how the instance is identified, how the direction of each SYNC within it is established, and what ends it, and that session MUST provide the freshness required by Section 11. Such a session may move between connections, for example by resumption; HCTP state then continues on the new connection (Section 6.6). The session layer of the Agent Transfer Protocol [AGTP-SESSION], which binds a session to its participants rather than to a connection, is an example of an enclosing session. When HCTP is carried over HTTP and no enclosing session is defined, the connection is the scope instance: all requests and all streams carried on one connection share one HCTP session and its state, and a new connection starts a new session from the fixed genesis root (Section 4). A connection that carries requests in both directions is limited to a one-way session, for the reason given in the preceding paragraph. HCTP performs no fragmentation of its own. A sender MUST NOT exceed MAX_BLOCKS_PER_SYNC_BASE blocks or MAX_DECOMPRESSED_LEN_BASE octets of decompressed output in a single SYNC (Section 9), and when the pending blocks would exceed either baseline it MUST split them across successive SYNC packets as specified in Section 6.2. A sender MAY additionally cap the size of a SYNC to the usable size of the underlying channel. That cap is the sender's own choice: no value for it is defined by this document, and it is not part of conformance. Each SYNC is validated, folded, and acknowledged on its own. The receiver MUST NOT reassemble blocks across SYNC packets (Section 6.3), and reassembly of a dynamic window spanning more than one SYNC is out of scope for HCTP/1. Because HCTP supplies no confidentiality or peer authentication, it MUST be carried over a transport that provides them where those properties are required (Section 11). Ruvalcaba Expires 30 May 2027 [Page 22] Internet-Draft HCTP November 2026 11. Security Considerations *HCTP is not a secure channel by itself.* The static root, combined_hash, and content_hash are computed with an unkeyed hash function. They provide tamper-evidence against accidental corruption and against a party that cannot forge packets, but they provide *no* cryptographic authentication: an active attacker who can inject packets can recompute a consistent combined_hash and a consistent chain for any payload of the attacker's choosing. Authenticity, integrity against active attackers, and confidentiality MUST be provided by the underlying transport (for example TLS 1.3 [RFC8446] or QUIC [RFC9000]) or by an authenticated-encryption layer that wraps the HCTP packet. Absent such a layer, HCTP's integrity guarantees are meaningless. *No non-repudiation.* Either endpoint can construct a valid-looking chain from genesis; the chain proves internal consistency, not origin. Binding context to a long-term identity requires signatures and is out of scope. *Replay within a session.* The receiver verifies combined_hash before it consults any cached state (Section 6.3), so the cached-ACK path is never reached with a body that is inconsistent with its own combined_hash. That ordering does not make the digest comparison redundant: an attacker who injects a well-formed SYNC carrying the cached seq and a combined_hash recomputed over the attacker's own body passes the integrity check and reaches the duplicate check, and because its octets differ from those of the accepted SYNC its digest differs and the packet is silently discarded. Such an injection elicits silence, not the cached ACK. Once integrity holds, a SYNC whose seq is lower than last_seen_seq is silently discarded. A SYNC whose seq equals last_seen_seq is treated as a retransmission only if the SHA-256 digest of its received octets equals the digest recorded in ack_cache; in that case the cached ACK is resent and no block is folded twice, and in every other case the SYNC is silently discarded. The digest is taken over the octets exactly as received. Canonicality of those octets is established only on the accept path, where the digest that is stored was computed after the ingest validation of Section 6.3 had confirmed it, so the duplicate check on the earlier path compares raw received octets against a digest of raw received octets. The cache holds the pre-fold root, the ACK, and that digest, so its size is constant and does not grow with the size of the SYNC that was accepted, and the receiver does not retain the SYNC octets themselves. Because the comparison covers the whole received packet, dynamic_data included, the receiver itself verifies the property on which the cached-ACK path depends instead of assuming that the peer retransmits faithfully. A retransmission that is corrupted in transit yields a different digest and is silently Ruvalcaba Expires 30 May 2027 [Page 23] Internet-Draft HCTP November 2026 discarded; recovery from such corruption is the responsibility of the transport, since TLS and QUIC reject corrupted records before HCTP sees them. The static-root alignment check then rejects out-of- context injection. Every non-fatal rejection is silent and leaves state unchanged, so an injected packet elicits no response at the HCTP layer that could be used as an oracle. The fatal case is not silent: a static-root mismatch tears down the session, and an attacker able to observe that teardown learns that the injected packet reached the alignment check. Silence is not a substitute for transport authentication either, and an attacker able to observe the legitimate peer's traffic can still correlate its responses with the packets it sent. *Session freshness.* HCTP/1 defines one fixed genesis root and no session identifier and no session-specific genesis. Whole-session replay is therefore not detectable at the HCTP layer, and freshness is the responsibility of the layer beneath. An endpoint resets HCTP state only together with the end of the scope instance (Section 10); a reset while that instance continues is not permitted. A receiver whose state has just been reset has has_seen false and so skips the replay and duplicate checks entirely, and it accepts the first SYNC that satisfies the remaining checks however old that SYNC may be. Such a receiver cannot tell an old first SYNC of a previous session from a new one: after the reset, local_root is the fixed genesis root, and the first SYNC of any prior session also carries that root, so the alignment check does not separate the two. The guarantee against that replay is wholly supplied by the layer beneath, and it is bounded only by the freshness of the scope instance; the one outcome a receiver can observe at the HCTP layer is a static-root mismatch. Endpoints MUST carry HCTP within a scope instance whose layer provides freshness, for example a fresh TLS session or an enclosing session bound to authenticated participants, and MUST discard all session state, both the sender state and the receiver state enumerated in Section 6.1, when the scope instance ends (Section 6.6). A later exchange MUST start a new session from the fixed genesis root. Because state continues while an enclosing session moves between connections, a SYNC replayed onto a new connection of the same instance meets the replay and duplicate checks of Section 6.3 rather than a reset receiver. *Decompression resource exhaustion.* dynamic_data is attacker- influenced compressed input. A receiver MUST bound the maximum accepted decompressed size and the maximum number of blocks per SYNC, and MUST abort decompression that exceeds those bounds, to avoid a decompression "bomb" denial of service. dynamic_len itself MUST be bounded before allocation, against the same accepted bound the receiver enforces on decompressed output. Every receiver MUST accept at least the baseline limits MAX_BLOCKS_PER_SYNC_BASE (64 blocks) and Ruvalcaba Expires 30 May 2027 [Page 24] Internet-Draft HCTP November 2026 MAX_DECOMPRESSED_LEN_BASE (65536 octets) per SYNC and MAY accept more (Section 9); the accepted bound a receiver enforces MUST be at least those baselines, and a bound below them does not conform to this document. A sender MUST NOT exceed those baseline limits, and when the pending blocks would exceed them it MUST send them as successive SYNC packets under the sequential-part procedure of Section 6.2. A receiver MUST reject dynamic_data that is truncated, that sets FDICT, or that carries octets past the end of the zlib stream (Section 6.3). Those checks bound the input octets the decompressor consumes; they do not bound its output, and the output bound is enforced separately during decompression by aborting once the decompressed octets exceed the receiver's accepted limit or the block count exceeds its accepted maximum. *Confidentiality of summaries.* A block's summary may reveal the semantic content of a turn even though the raw text is not sent. Where the summary is sensitive, the transport MUST encrypt the packet. The content_hash likewise permits confirmation of a guessed plaintext; where raw texts are low-entropy or guessable, this MUST be considered. *Hash agility.* This version fixes SHA-256 and a fixed genesis seed. Collision resistance of the chain rests entirely on SHA-256. A future version of the protocol (indicated by the version octet) may specify an alternative hash; endpoints MUST reject versions they do not implement. 12. IANA Considerations 12.1. HCTP Packet Type Registry IANA is requested to create a new registry, "HCTP Packet Types", with a 1-octet unsigned integer identifier space, under a to-be-assigned HCTP-protocol registry group. The registration policy is "Specification Required" [RFC8126]. The initial contents are: +======================+============+===============+ | Value | Name | Reference | +======================+============+===============+ | 0x41 | ACK | This document | +----------------------+------------+---------------+ | 0x53 | SYNC | This document | +----------------------+------------+---------------+ | 0x00, 0x02-0x40, | Unassigned | | | 0x42-0x52, 0x54-0xFF | | | +----------------------+------------+---------------+ Table 1 Ruvalcaba Expires 30 May 2027 [Page 25] Internet-Draft HCTP November 2026 12.2. HCTP Version Registry IANA is requested to create a registry "HCTP Versions" with a 1-octet identifier space, registration policy "Specification Required", initially containing value 0x01 ("HCTP/1", this document). 12.3. Media Type Registration IANA is requested to register the "application/hctp" media type for HCTP packets carried over media-type-aware transports, per the procedures of [RFC6838]. Type name: application; Subtype name: hctp; Required parameters: none; Optional parameters: none; Encoding considerations: binary; Security considerations: see Section 11 of this document. 13. Normative References [RFC1950] Deutsch, P. and J-L. Gailly, "ZLIB Compressed Data Format Specification version 3.3", RFC 1950, May 1996, . [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification version 1.3", RFC 1951, May 1996, . [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997, . [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)", RFC 6234, May 2011, . [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type Specifications and Registration Procedures", BCP 13, RFC 6838, January 2013, . [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 8126, June 2017, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, May 2017, . Ruvalcaba Expires 30 May 2027 [Page 26] Internet-Draft HCTP November 2026 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, December 2017, . [RFC8785] Rundgren, A., Jordan, B., and S. Erdtman, "JSON Canonicalization Scheme (JCS)", RFC 8785, June 2020, . 14. Informative References [AGTP-SESSION] Hood, C., "AGTP Session Protocol", Work in Progress, Internet-Draft, draft-hood-agtp-session-01, 30 October 2026, . [RFC6455] Fette, I. and A. Melnikov, "The WebSocket Protocol", RFC 6455, December 2011, . [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, August 2018, . [RFC9000] Iyengar, J., Ed. and M. Thomson, Ed., "QUIC: A UDP-Based Multiplexed and Secure Transport", RFC 9000, May 2021, . Appendix A. Test Vectors This appendix gives a subset of the test vectors for this revision. The complete set is the file vectors-01.json, which also covers the escaped and unescaped characters of Section 3, a character outside the Basic Multilingual Plane, NFC and NFD forms of the same text, a summary of exactly MAX_SUMMARY_LEN code points, and 21 decompressed SYNC contents that a receiver MUST reject. Its SHA-256 digest, over the file as distributed by the author (UTF-8, LF line endings), is given below; a copy whose line endings have been changed will not match. c452fd2400f8dfd74d3d3b4c9fc8c217e5528017366fa50cd358391a31d17b99 Every octet string below is hexadecimal, so that no line break or space in the display can be mistaken for part of a value. Each canonical(B) is also given in vectors-01.json as JSON text. Ruvalcaba Expires 30 May 2027 [Page 27] Internet-Draft HCTP November 2026 A.1. Genesis Root root_0 = SHA256("hctp-genesis-v1"), the 15 ASCII octets with no trailing NUL: adf23ff0aaf06a7edceac586462522c16ba7869f5c122515032bb7f8a8181db9 A.2. Three ASCII Blocks Folding three blocks from root_0. These roots are unchanged from draft-ruvalcaba-hctp-00, because the blocks contain only ASCII. seq 0, raw text: Hello, agent. canonical(B) octets (126): 7b22636f6e74656e745f68617368223a22663134373538346161663136313932 3230653635626232343739313531613963643365396636306136316262333966 3833356132653135313135313031323463222c22726f6c65223a227573657222 2c22736571223a302c2273756d6d617279223a226772656574696e67227d root after fold: b83c934e3064759521013688ce3424284d6bdaa391706d8d9111148dc6645be0 seq 1, raw text: Hello. What do you need? canonical(B) octets (133): 7b22636f6e74656e745f68617368223a22383931346135376466353933373863 3539306333636565653435383131636561643631346430623465636534366663 3431366139343238323433343162306332222c22726f6c65223a226167656e74 222c22736571223a312c2273756d6d617279223a226772656574696e67207265 706c79227d root after fold: 9aa6829d8d6dac9ca8db70cb6f1ec593009de2cabb381ce81f8a9082468ed134 Ruvalcaba Expires 30 May 2027 [Page 28] Internet-Draft HCTP November 2026 seq 2, raw text: Summarise RFC 6234. canonical(B) octets (143): 7b22636f6e74656e745f68617368223a22386461303965326633393764383538 6438306137343535346431363564643037656436383930663266386238386339 3563303363373032353336333062336466222c22726f6c65223a227573657222 2c22736571223a322c2273756d6d617279223a2261736b7320666f7220524643 20363233342073756d6d617279227d root after fold: e2354b7bf5555847e57e5de40146b02c3deeafc616860576bd51fa1e07adbf01 A.3. Non-ASCII Block A block whose raw text and summary contain Latin and CJK characters, folded from root_0. canonical(B) carries them as raw UTF-8. Under the ASCII-escaped form, which Section 3 prohibits, the root would differ. canonical(B) octets (134): 7b22636f6e74656e745f68617368223a22353566323761363130613136653463 3666633661653161326131333064616536303632343631376562613761356230 3338653738626132336330316532323739222c22726f6c65223a227573657222 2c22736571223a302c2273756d6d617279223a22636166c3a920696e2054c58d 6b79c58d227d root after fold: e5c13f98509eea497a337e4caa0239d8da270db6d2a7df786b7c964cddeb2b36 A.4. SYNC and ACK A SYNC carrying the three ASCII blocks over root_0, and the ACK a receiver returns. The uncompressed content of dynamic_data is "[", the three canonical(B) encodings of Appendix A.2 separated by ",", and "]". DEFLATE output differs between implementations, so dynamic_data is given literally; a receiver checks combined_hash over the octets it receives. dynamic_len is 246, so the SYNC is 320 octets (74 + 246); the ACK is 38 octets. Ruvalcaba Expires 30 May 2027 [Page 29] Internet-Draft HCTP November 2026 uncompressed content of dynamic_data (406): 5b7b22636f6e74656e745f68617368223a226631343735383461616631363139 3232306536356262323437393135316139636433653966363061363162623339 663833356132653135313135313031323463222c22726f6c65223a2275736572 222c22736571223a302c2273756d6d617279223a226772656574696e67227d2c 7b22636f6e74656e745f68617368223a22383931346135376466353933373863 3539306333636565653435383131636561643631346430623465636534366663 3431366139343238323433343162306332222c22726f6c65223a226167656e74 222c22736571223a312c2273756d6d617279223a226772656574696e67207265 706c79227d2c7b22636f6e74656e745f68617368223a22386461303965326633 3937643835386438306137343535346431363564643037656436383930663266 3862383863393563303363373032353336333062336466222c22726f6c65223a 2275736572222c22736571223a322c2273756d6d617279223a2261736b732066 6f722052464320363233342073756d6d617279227d5d SYNC (320): 015300000002adf23ff0aaf06a7edceac586462522c16ba7869f5c122515032b b7f8a8181db9000000f678da6d904b6a43310c45b7f2f038034996fcc9b49005 745a4a916d3929cda77d2f198492bdd793d0420302210edc73d1cbb7aba7e3d9 8ee7b79d2e3bb7761d394a62d58e01331158905288634641cdb579cb3d80062c c5e79ebc28d940630089ab5bb9f9b4b79174596c1ed7625f6e0d635f0e079daf 036c67b3f3fb71eb6eab7ffa94915562eb927d4c5532545fcd8c252156d31690 1b14b66a1c7a650c9a9912b1672c50e957afdb117bf7e323ff34dbe7fefab045 53c846dde7d892a49640238b70c320ad41b41652864e3d95946a960abe4620f1 c143f1ad3f7e02fd2da1cbc732f5d33c3d6f9ea6409ea73bbbbdfe009ede790c 8f17a3c6d3932a515f9ce4f7139ba6c7033c718d66cd8c31fe128aeaaf05fcff ACK (38): 014100000002e2354b7bf5555847e57e5de40146b02c3deeafc616860576bd51 fa1e07adbf01 Appendix B. Changes since draft-ruvalcaba-hctp-00 This revision responds to review by an independent implementer whose Rust implementation, built from the -00 text alone, reproduced every value in the first test-vector set. The changes below address the questions that review raised and the ambiguities it identified. Test vectors are added as Appendix A; every value there, and in the complete vectors-01.json file it summarizes, is generated by code from the text of this revision. Canonical encoding * canonical(B) is now defined as the JSON Canonicalization Scheme [RFC8785] serialization of the block, with [RFC8259] and [RFC8785] added as normative references; the standalone term "canonical JSON" is no longer used (Section 3). Ruvalcaba Expires 30 May 2027 [Page 30] Internet-Draft HCTP November 2026 * The string serialization rule is stated explicitly, including the prohibition on escaping <, >, &, U+2028, U+2029, and U+007F, and the prohibition on the ASCII-escaped form (Section 3). * The spelling of seq is fixed to ASCII decimal digits with no sign, leading zeros, fraction, or exponent, and the spelling of content_hash to exactly 64 ASCII lowercase hexadecimal digits (Section 3). * The document now states that no Unicode normalization is applied to role, summary, or the raw turn text, and that canonically equivalent but octet-different text yields different roots (Section 3). * A role is now bounded by the new constant MAX_ROLE_LEN of 64 octets of well-formed UTF-8, replacing the untestable adjective "short" (Section 3 and Section 9). Packet validation and the receiver procedure * The conditions under which a received SYNC is rejected are now stated once, in a single ordered list in Section 6; Section 3, Section 5, and Section 10 define formats and point to that list. * The integrity check on combined_hash now precedes the cached-ACK path, so that path is never reached with a body inconsistent with its own combined_hash (Section 6). * The single replay step of -00 is split into a strict replay check for a lower seq and a duplicate check for an equal seq; the duplicate check answers only an exact retransmission, identified by a digest of the received octets held in ack_cache, and silently discards any other equal-seq packet (Section 6). * Ingest validation now covers the packet seq cross-check against the last block, strictly ascending and contiguous block seq values, the prohibition on an empty array, the member set, the field forms, and the zlib stream rules including a clear FDICT flag and full consumption of dynamic_data (Section 6). * "Reject" is defined as discard with no state change and no response, and the static-root alignment check is identified as the only fatal check (Section 6). * The receiver now keeps last_block_seq, the seq of the last block folded into local_root, and folds canonical(B) rather than the received octets (Section 6 and Section 3). Ruvalcaba Expires 30 May 2027 [Page 31] Internet-Draft HCTP November 2026 Sender procedure * The dynamic window is frozen while a SYNC is outstanding, and blocks originated during that period are queued and admitted only after the outstanding SYNC is acknowledged or abandoned (Section 6 and Section 6). * last_acked_seq is undefined until the first ACK is accepted, and an implementation is prohibited from initializing it to a numeric sentinel (Section 6). * On an ACK, the sender computes a candidate root over the frozen window without modifying state, and commits it only if it equals new_root; on mismatch the ACK is a fatal divergence and the sender tears the session down at once, retaining no state (Section 6.4). * Retransmission is now required to be octet-for-octet identical, and recovery from a retransmission corrupted in transit is assigned to the transport (Section 6). * After the bounded retransmit count is exhausted, the sender reports failure and discards all session state, including the queued blocks and the cached ACK (Section 6). Bidirectional operation * The chain to which a SYNC belongs is determined solely by the transport direction on which it is received; the role member is application data and is prohibited from selecting a chain (Section 6 and Section 7). * The seq space is per directional chain, each chain numbering independently from 0, and a one-way session has a single chain (Section 3 and Section 7). * Per-direction chains are the only synchronization strategy in this version; the text records why the turn-token alternative is not specified (Section 7). Limits * New constants MAX_BLOCKS_PER_SYNC_BASE (64 blocks) and MAX_DECOMPRESSED_LEN_BASE (65536 octets) are defined as minimum capacities per SYNC, with every receiver required to accept at least those baselines and permitted to accept more (Section 9). Ruvalcaba Expires 30 May 2027 [Page 32] Internet-Draft HCTP November 2026 * A sender is prohibited from exceeding either baseline in a single SYNC and must split the pending blocks across successive SYNCs when they do not fit (Section 9 and Section 6). * The receiver's accepted bound is required to be at least the baselines, and decompression is aborted once the accepted bound is exceeded (Section 6 and Section 11). Transport mapping * Each transport unit must carry exactly one HCTP packet and no other octets, and the receiver reads the 42-octet fixed header prefix of a SYNC before reading dynamic_data and combined_hash (Section 10). * Splitting is now sequential: each part carries the static_root resulting from the ACK of the preceding part, at most one part is outstanding, and the receiver is prohibited from reassembling blocks across SYNC packets (Section 6 and Section 10). * A session is scoped to one scope instance: one underlying connection by default, or an enclosing session, such as [AGTP-SESSION], that can move between connections. State is reset only when that instance ends. Over HTTP with no enclosing session, all requests and streams on one connection share one session, and a new connection starts a new session from the fixed genesis root (Section 6 and Section 10). Security considerations * The replay discussion now describes the integrity-first ordering, the digest-based duplicate check, and the constant size of ack_cache, and notes that every rejection other than a static-root mismatch is silent and leaves state unchanged (Section 11). * The text now states that this version defines one fixed genesis root and no session identifier, that whole-session replay is not detectable at the HCTP layer, and that freshness is the responsibility of the transport (Section 11). * The decompression discussion now states the baseline limits, the requirement that the accepted bound be at least those baselines, and the separate bounding of dynamic_len before allocation (Section 11). Removed Ruvalcaba Expires 30 May 2027 [Page 33] Internet-Draft HCTP November 2026 * The turn-token alternative in Section 7 of -00 is removed (Section 7). * The same-static_root receiver-reassembly sentence in Section 10 of -00 is removed and replaced by the sequential-part procedure (Section 10). * The phrase "fresh genesis root" and the claim that starting from a fresh genesis prevents cross-session replay are removed and replaced by the fixed genesis root and the transport-freshness statement (Section 6 and Section 11). * The literal "folds each pending block" and "clears the dynamic window" in Section 6.4 of -00 are removed and replaced by the frozen window, the explicit acknowledged set, and the tentative candidate root (Section 6). Design choices made in this revision The following are settled in this revision. Comment is welcome, but each is fully specified in the text. * String serialization follows [RFC8785]: raw UTF-8, with the ASCII- escaped form prohibited (Section 3). For a block that -00 also accepted and that is written the same way, this is the only change to its octets, and it affects only non-ASCII text: a history whose roles and summaries are all ASCII keeps its roots. * No Unicode normalization is applied (Section 3). * The seq space is per directional chain, starting at 0 (Section 7). * An empty SYNC is prohibited (Section 5). * A window too large for one SYNC is sent as sequential parts; cross-SYNC reassembly is not part of this version (Section 10). * The duplicate check compares a SHA-256 digest of the received octets of the accepted SYNC (Section 6). * No error packet is defined; a rejection is silent and non-fatal except for a static-root mismatch (Section 6). * A corrupted retransmission is discarded silently; recovery from corruption is the job of the transport (Section 6.5). Ruvalcaba Expires 30 May 2027 [Page 34] Internet-Draft HCTP November 2026 * The chain of a SYNC is determined by the direction of transfer within the scope instance, never by the role of a block (Section 7). * HCTP state is bound to a scope instance defined by the layer beneath, one connection by default or an enclosing session that can survive reconnection, and is reset only when that instance ends (Section 10). This replaces a proposal to tie state to one connection, which would have restarted HCTP from genesis on every reconnection of an enclosing session. Open questions The author has taken a provisional position on each of the following and invites comment. * The baseline limits of 64 blocks and 65536 octets per SYNC (Section 9) have not yet been checked against a target MTU budget. Should a later version let peers signal larger limits? * MAX_ROLE_LEN is 64 octets (Section 9); the alternative is to bound role only by the size limits of Section 11. * The single-writer turn-token strategy of -00 is removed rather than repaired (Section 7). Is there a use case that needs one agreed fold order across both directions? * Session freshness rests on the transport, with one fixed genesis root (Section 11). A session-specific genesis would need a nonce or a transport exporter and a new version. Acknowledgments The rolling-root delta-transfer design and the verifiable-summary block derive from an earlier reference implementation of the protocol. Author's Address Cristian Xavier Ruvalcaba Saluca LLC Email: cristian@saluca.com Ruvalcaba Expires 30 May 2027 [Page 35]