<?xml version="1.0" encoding="utf-8"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     category="std"
     docName="draft-ruvalcaba-nhe-mesh-00"
     ipr="trust200902"
     submissionType="IETF"
     consensus="true"
     xml:lang="en"
     tocInclude="true" tocDepth="3" symRefs="true" sortRefs="true" version="3">

  <front>
    <title abbrev="NHE Mesh">The NHE Mesh Protocol: Entity-to-Entity Messaging and Task Distribution</title>
    <seriesInfo name="Internet-Draft" value="draft-ruvalcaba-nhe-mesh-00"/>
    <author fullname="Cristian Xavier Ruvalcaba" initials="C.X." surname="Ruvalcaba">
      <organization>Saluca LLC</organization>
      <address><email>cristian@saluca.com</email></address>
    </author>
    <date year="2026" month="August" day="11"/>
    <area>Applications and Real-Time</area>
    <workgroup>Individual Submission</workgroup>
    <keyword>autonomous agent</keyword>
    <keyword>agent-to-agent</keyword>
    <keyword>task distribution</keyword>
    <keyword>messaging</keyword>

    <abstract>
      <t>The NHE Mesh Protocol lets independently operated Non-Human Entities
      (NHEs) exchange messages and distribute work without a central coordinator.
      It defines three things: a liveness/presence mechanism, an addressed message
      envelope, and a task lifecycle (create, claim, complete) that provides
      at-most-once assignment of a unit of work across mutually distrusting peers.
      Peers are named by their NHE identity and authenticated through the NHE
      identity interface; the Mesh Protocol carries the envelope and runs over a
      secure transport. This is a skeleton (-00): the framing, message set, and
      state machine are specified here, and the concrete on-the-wire encoding is
      deferred to the next revision.</t>
    </abstract>
  </front>

  <middle>

    <section numbered="true"><name>Introduction</name>
      <t>Persistent autonomous agents increasingly need to talk to one another and
      to hand work back and forth: one entity discovers that a peer is alive, sends
      it a message, or posts a unit of work that some peer claims and later
      completes. Today each system invents this afresh. This document specifies a
      minimal, transport-agnostic protocol for it, in the setting of the NHE
      reference architecture <xref target="I-D.ruvalcaba-nhe-arch"/>.</t>
      <t>The Mesh Protocol deliberately does the smallest useful thing: presence,
      addressed messages, and a three-state task lifecycle. Routing topology,
      discovery of unknown peers, and payload semantics are out of scope.</t>
    </section>

    <section numbered="true"><name>Relationship to the NHE Architecture</name>
      <t>This document specifies the Mesh interface of the NHE reference model
      <xref target="I-D.ruvalcaba-nhe-arch"/> and inherits that document's scope
      framing: an NHE is a functional artifact, not a living or sentient entity,
      and every participant remains subject to operator control, inspectability,
      and bounded authority. In particular, a peer's authority to create or claim
      tasks is conferred and revocable per that model; the Mesh Protocol conveys
      such actions but does not itself grant authority.</t>
      <t>Peer identity and authentication are provided by the NHE identity
      interface (a companion document), not redefined here. The Mesh Protocol
      assumes each participant has a verifiable identity and that message
      authentication binds to it.</t>
    </section>

    <section numbered="true"><name>Terminology</name>
      <t>The key words "MUST", "MUST NOT", "SHOULD", "MAY", and "OPTIONAL" are to
      be interpreted as described in BCP 14 <xref target="RFC2119"/>
      <xref target="RFC8174"/>.</t>
      <dl>
        <dt>Participant:</dt><dd>An NHE that sends or receives Mesh messages, named
        by its NHE identity.</dd>
        <dt>Message:</dt><dd>An addressed, authenticated envelope from one
        participant to another.</dd>
        <dt>Task:</dt><dd>A unit of work posted by a creator and executed by at
        most one claimant.</dd>
        <dt>Heartbeat:</dt><dd>A liveness/presence announcement.</dd>
      </dl>
    </section>

    <section numbered="true"><name>Protocol Overview</name>
      <t>The Mesh Protocol comprises two sub-protocols over a common envelope:</t>
      <ul>
        <li><strong>Messaging:</strong> HEARTBEAT (presence), SEND (addressed
        message), and inbox retrieval of messages addressed to a participant.</li>
        <li><strong>Task distribution:</strong> CREATE, CLAIM, and COMPLETE, plus
        enumeration of open tasks, providing at-most-once assignment.</li>
      </ul>

      <section numbered="true"><name>Messaging</name>
        <t>A participant periodically emits a HEARTBEAT carrying its identity and a
        monotonically increasing sequence, so peers can track liveness without
        polling. A SEND message carries sender identity, recipient identity, a
        message identifier, and an opaque payload. Delivery is to the recipient's
        inbox; retrieval and acknowledgment semantics are specified in
        <xref target="wire"/>. Message authentication MUST bind the envelope to the
        sender's identity; recipients MUST reject a message whose authentication
        does not verify against the claimed sender identity.</t>
      </section>

      <section numbered="true"><name>Task Lifecycle</name>
        <t>A task moves through a small state machine. CREATE posts a task with a
        task identifier, an addressing scope (which peers may claim it), and an
        opaque descriptor. CLAIM is an atomic mutual-exclusion operation: at most
        one participant may transition a task from OPEN to CLAIMED; concurrent
        claims MUST resolve so that exactly one succeeds and the others observe the
        task as already claimed. COMPLETE transitions CLAIMED to COMPLETED and
        carries an opaque result. A claimed-but-unfinished task MAY expire back to
        OPEN after a creator-specified deadline, so that a failed claimant does not
        strand the work.</t>
        <artwork type="ascii-art"><![CDATA[
   CREATE        CLAIM (atomic,      COMPLETE
     |            at-most-one)          |
     v                |                 v
  [ OPEN ] -----------+------> [ CLAIMED ] -----> [ COMPLETED ]
     ^                              |
     |     claim deadline expires   |
     +------------------------------+
]]></artwork>
        <t>At-most-once assignment is the core guarantee: the protocol ensures a
        unit of work is executed by no more than one claimant at a time. It does
        not by itself guarantee exactly-once execution across claimant failure;
        creators requiring that MUST make task descriptors idempotent.</t>
      </section>
    </section>

    <section anchor="wire" numbered="true"><name>Wire Format (to be specified in -01)</name>
      <t>This skeleton fixes the message set and the task state machine. The
      concrete encoding --- envelope layout, identifier sizes, the atomic-claim
      mechanism on the wire, heartbeat cadence, and inbox acknowledgment --- is
      deferred to the next revision. The intended design principles are: a compact
      binary envelope with a version and message-type octet (mirroring the
      approach of HCTP <xref target="I-D.ruvalcaba-hctp"/>); a registry-controlled
      message-type space (<xref target="iana"/>); identity binding via a signature
      or AEAD over the envelope, delegated to the identity/transport layers; and
      an idempotent, retry-safe CLAIM so that a lost response cannot cause a double
      assignment.</t>
    </section>

    <section anchor="security" numbered="true"><name>Security Considerations</name>
      <t>Participants are mutually distrusting. Every message and task operation
      MUST be authenticated to the acting participant's NHE identity; unauther-
      ticated or unverifiable operations MUST be rejected. Confidentiality and
      peer authentication are provided by the underlying secure transport (for
      example TLS <xref target="RFC8446"/> or QUIC <xref target="RFC9000"/>) and/or
      by the identity layer; the Mesh Protocol provides the envelope and the task
      semantics, not a secure channel of its own.</t>
      <t>The CLAIM operation is a mutual-exclusion primitive and is the primary
      abuse target: a malicious peer that claims work it will not complete can
      starve the mesh. The expiry-to-OPEN transition bounds this, and creators
      SHOULD scope who may claim a task. Replay of a CLAIM or COMPLETE MUST be
      detected (for example via task-state versioning) so that a replayed COMPLETE
      cannot overwrite a later state. Heartbeats reveal liveness and identity and
      SHOULD be sent over the protected transport where that is sensitive.</t>
      <t>All operations remain subject to the operator-control and bounded-
      authority invariants of <xref target="I-D.ruvalcaba-nhe-arch"/>: a
      participant's ability to create or claim tasks is a revocable grant.</t>
    </section>

    <section anchor="iana" numbered="true"><name>IANA Considerations</name>
      <t>A future revision will request two registries: "NHE Mesh Message Types"
      (for HEARTBEAT, SEND, and task operations CREATE/CLAIM/COMPLETE) and "NHE
      Mesh Task States" (OPEN, CLAIMED, COMPLETED, and any additions), each under a
      Specification Required policy <xref target="RFC8126"/>. No IANA action is
      requested by this skeleton revision.</t>
    </section>
  </middle>

  <back>
    <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 initials="S." surname="Bradner"/><date year="1997" month="March"/></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 initials="B." surname="Leiba"/><date year="2017" month="May"/></front>
        <seriesInfo name="BCP" value="14"/><seriesInfo name="RFC" value="8174"/></reference>
    </references>
    <references><name>Informative References</name>
      <reference anchor="I-D.ruvalcaba-nhe-arch">
        <front><title>An Architecture for Non-Human Entities (NHE)</title>
        <author initials="C.X." surname="Ruvalcaba"/><date year="2026" month="August"/></front>
        <seriesInfo name="Internet-Draft" value="draft-ruvalcaba-nhe-arch-00"/></reference>
      <reference anchor="I-D.ruvalcaba-hctp">
        <front><title>The Hash-Chain Context Transfer Protocol (HCTP)</title>
        <author initials="C.X." surname="Ruvalcaba"/><date year="2026" month="August"/></front>
        <seriesInfo name="Internet-Draft" value="draft-ruvalcaba-hctp-00"/></reference>
      <reference anchor="RFC8126" target="https://www.rfc-editor.org/info/rfc8126">
        <front><title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
        <author initials="M." surname="Cotton"/><author initials="B." surname="Leiba"/>
        <author initials="T." surname="Narten"/><date year="2017" month="June"/></front>
        <seriesInfo name="BCP" value="26"/><seriesInfo name="RFC" value="8126"/></reference>
      <reference anchor="RFC8446" target="https://www.rfc-editor.org/info/rfc8446">
        <front><title>The Transport Layer Security (TLS) Protocol Version 1.3</title>
        <author initials="E." surname="Rescorla"/><date year="2018" month="August"/></front>
        <seriesInfo name="RFC" value="8446"/></reference>
      <reference anchor="RFC9000" target="https://www.rfc-editor.org/info/rfc9000">
        <front><title>QUIC: A UDP-Based Multiplexed and Secure Transport</title>
        <author initials="J." surname="Iyengar" role="editor"/>
        <author initials="M." surname="Thomson" role="editor"/><date year="2021" month="May"/></front>
        <seriesInfo name="RFC" value="9000"/></reference>
    </references>
  </back>
</rfc>
