<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.39 (Ruby 3.2.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-kohbrok-mimi-transport-01" category="info" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.18.0 -->
  <front>
    <title abbrev="MT">MIMI Transport</title>
    <seriesInfo name="Internet-Draft" value="draft-kohbrok-mimi-transport-01"/>
    <author initials="K." surname="Kohbrok" fullname="Konrad Kohbrok">
      <organization>Phoenix R&amp;D</organization>
      <address>
        <email>konrad.kohbrok@datashrine.de</email>
      </address>
    </author>
    <author initials="R." surname="Robert" fullname="Raphael Robert">
      <organization>Phoenix R&amp;D</organization>
      <address>
        <email>ietf@raphaelrobert.com</email>
      </address>
    </author>
    <date year="2023" month="September" day="21"/>
    <area>Security</area>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <?line 24?>

<t>This document defines an HTTPS based transport layer for use with the MIMI
Protocol.</t>
    </abstract>
    <note removeInRFC="true">
      <name>Discussion Venues</name>
      <t>Discussion of this document takes place on the
    More Instant Messaging Interoperability Working Group mailing list (mimi@ietf.org),
    which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/mimi/"/>.</t>
      <t>Source for this draft and an issue tracker can be found at
    <eref target="https://github.com/kkohbrok/mimi-transport"/>.</t>
    </note>
  </front>
  <middle>
    <?line 29?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>This document describes an HTTP-based transport layer protocol for use with all
MIMI sub-protocols. The MIMI transport protocol provides an envelope for for
MIMI transaction types and takes care of message authentication.</t>
      <t>This document also describes the endpoints that are served by the individual
MIMI functionalities.</t>
    </section>
    <section anchor="authentication">
      <name>Authentication</name>
      <t>The MIMI transport protocol uses the mutually authenticated mode of TLS to
provide authentication for server-to-server communication.</t>
      <t>TODO: More information specific to how TLS should be used, i.e. mandate best
practices that make sense in a mutually authenticated scenario that involves two
WebPKI based certificates.</t>
    </section>
    <section anchor="framing">
      <name>Framing</name>
      <t>The MIMI transport protocol uses a simple framing structure that includes the
transaction payload, as well as a small header that signals the protocol
version, as well as the transaction type contained in the envelope.</t>
      <artwork><![CDATA[
enum {
    reserved(0),
    mimi10(1),
    (65535)
} ProtocolVersion;

// See the "MIMI Transaction Types" IANA registry for values
// e.g. "mimi.delivery-service.add"
opaque TransactionType;

struct {
  ProtocolVersion version = mimi10;
  TransactionType transaction_type;
  opaque serialized_transaction<V>;
} TransactionEnvelope;
]]></artwork>
    </section>
    <section anchor="endpoint-discovery">
      <name>Endpoint Discovery</name>
      <t>A messaging provider that wants to query the endpoint of another messaging
provider first has to discover the fully qualified domain name under which
Delivery Service of that provider can be reached. It does so by performing a GET
request to <tt>provider.com/.well-known/mimi/ds-domain</tt>. provider.com could for
example answer by providing the domain <tt>ds.provider.com</tt> (assuming that this is
where it responds to the REST endpoints defined below).</t>
    </section>
    <section anchor="rest-endpoints">
      <name>REST Endpoints</name>
      <t>The following REST endpoints can then be used to access the different
functionalities of the Delivery Service.</t>
      <t>As the Delivery Service relies on TLS encoded structs, all requests to endpoints
described below should be marked as <tt>Content-type: application/octet-stream</tt>.</t>
      <t>All structs and concepts referred to below are defined in
draft-robert-mimi-delivery-service, where their underlying functionality is
defined in more detail.</t>
      <section anchor="process-group-message">
        <name>Process Group Message</name>
        <artwork><![CDATA[
POST /group_operation
Content-type: application/octet-stream

Body
TLS serialized DSRequest

Response
TLS serialized DSResponse
]]></artwork>
        <t>This REST endpoint provides access to all operations associated with an existing
MLS group on the Delivery Service such as delivering application messages,
adding group members, removing group members, updating key material, etc. The
payloads for this endpoint are generally provided (and signed) by a member of
the corresponding group rather than the service provider of that member. The
exact operation, as well as the target group ID is determined by the payload
itself rather than an HTTP header, the path or any other query parameter.</t>
      </section>
      <section anchor="welcome-information">
        <name>Welcome Information</name>
        <artwork><![CDATA[
GET /welcome_information
Content-type: application/octet-stream

Body
TLS serialized DSRequest

Response
TLS serialized DSResponse
]]></artwork>
        <t>Through this endpoint, a provider can obtain information required to join the
group for clients that have already received a Welcome message. The DS responds
with the group’s RatchetTree, as well as authentication information of existing
group members.</t>
      </section>
      <section anchor="external-commit-information">
        <name>External Commit Information</name>
        <artwork><![CDATA[
GET /external_commit_information
Content-type: application/octet-stream

Body
TLS serialized DSRequest

Response
TLS serialized DSResponse
]]></artwork>
        <t>Guest providers can use this endpoint to obtain information that allows a client
to join a group without a Welcome message from an existing group member.</t>
      </section>
      <section anchor="verification-key">
        <name>Verification Key</name>
        <artwork><![CDATA[
GET /verification_key
Content-type: application/octet-stream

Body
TLS serialized VerificationKeyRequest

Response
TLS serialized VerificationKeyResponse
]]></artwork>
        <t>This allows guest providers to obtain the verification key of this provider.
This allows other providers to authenticate queries originating from this
provider.</t>
      </section>
      <section anchor="deliver-connection-request">
        <name>Deliver Connection Request</name>
        <artwork><![CDATA[
POST /connection_request
Content-type: application/octet-stream

Body
TLS serialized QueueingServiceRequest

Response
TLS serialized QueueingServiceResponse
]]></artwork>
        <t>This endpoint lets other providers deliver connection establishment request to
clients of this provider.</t>
      </section>
      <section anchor="deliver-message">
        <name>Deliver Message</name>
        <artwork><![CDATA[
POST /deliver_message
Content-type: application/octet-stream

Body
TLS serialized QueueingServiceRequest

Response
TLS serialized QueueingServiceResponse
]]></artwork>
        <t>An owning provider can deliver messages from one of its owned groups to this
endpoint, if one of the group’s clients is associated with this provider.</t>
      </section>
      <section anchor="connection-keypackage-retrieval">
        <name>Connection KeyPackage Retrieval</name>
        <artwork><![CDATA[
POST /connection_key_packages
Content-type: application/octet-stream

Body
TLS serialized ConnectionKeyPackageRequest

Response
TLS serialized ConnectionKeyPackageResponse
]]></artwork>
        <t>Allows another provider to retrieve KeyPackages for use during the connection
establishment process between two users.</t>
      </section>
      <section anchor="group-keypackage-retrieval">
        <name>Group KeyPackage Retrieval</name>
        <artwork><![CDATA[
POST /group_key_packages
Content-type: application/octet-stream

Body
TLS serialized GroupKeyPackageRequest

Response
TLS serialized GroupKeyPackageResponse
]]></artwork>
        <t>Allows another provider to retrieve KeyPackages that can be used to add another
user or one of its clients to an existing group.</t>
      </section>
    </section>
    <section anchor="rate-limiting">
      <name>Rate-limiting</name>
      <t>The MIMI transport protocol itself doesn’t include any rate-limiting measures.
However, traditional rate-limiting (e.g. based on sender IP) can be applied, as
well as rate-limiting based on information in the message body such as Group ID
(e.g. in the case of the <tt>/welcome_information</tt> endpoint) or group member (in
the case of the <tt>/group_operation</tt> endpoint). More fine-grained rate-limiting
can be applied through the use of the emerging Privacy Pass protocol
(draft-ietf-privacypass-auth-scheme).</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>IANA has created the following registries:
* Transaction Types</t>
      <section anchor="transaction-types">
        <name>Transaction Types</name>
        <t>An transaction type denotes the nature of a given payload in the context of the
MIMI protocol. The transaction type is a string that is composed of substrings
separated by dots.</t>
        <t>The first substring is "mimi", followed by the document that defines the
corresponding transaction payload, which in turn is followed by the name of the
transaction. The MIMI transaction specified in the MIMI DS document that signals
the addition of a client would for example be denoted by the string
~~~
"mimi.delivery-service.add"
~~~</t>
      </section>
    </section>
  </middle>
  <back>






  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA81ZbW8cSRH+3r+ilUjIRp61cyhIbACdOYecZUKMbd19QMju
nendbTwzPdfd480eIuJv8Pf4JTxV3fO2uyFBQcBJp1vP9NTLU1VPVddlWSaC
CaWey7eXby/lnVO1b6wLQi0WTj/h8Z0obF6rCkcKp5Yhe7TrhbOPWWUqk4Xu
g+zshchV0CvrtnNp6qUVwjRuLoNrffjq7OwXZ18J5bSay1udt86ErXjU2411
xVxe1kG7WofsgjQI4YOqi3tV2hpat9qLxszlH4PNT6SHLqeXHr+2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