Return-Path: <bryan@blueskyweb.xyz>
X-Original-To: atp@mail2.ietf.org
Delivered-To: atp@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1])
	by mail2.ietf.org (Postfix) with ESMTP id 2D54612C85D0A
	for <atp@mail2.ietf.org>; Wed, 19 Aug 2026 16:19:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ietf.org; s=ietf1;
	t=1787181551; bh=pK4nQ/ysB+rj9OvZ6YXtK79uorCfX74Lk7QZMhzeKfc=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=Ekfptsyo+ypnIrENyQoVr/FxHGxQL4JY5UvUV5BZ2mLAnf+PDqMcUdu7Wtp8pdUvM
	 IY1GZSB/ilhQScBvlHmNT01SvX2Th+x5g5t7NF2C51z/l1iSsWz+5mUpVBCnTE0Uii
	 GtdVS2tkw40I2cqhlC/h30IpBe/GJZukV2En/RPg=
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: 0.409
X-Spam-Level: 
X-Spam-Status: No, score=0.409 tagged_above=-999 required=5
	tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499,
	HTML_MESSAGE=0.001, PDS_OTHER_BAD_TLD=1.999,
	RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	T_KAM_HTML_FONT_INVALID=0.01] autolearn=no autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key)
	header.d=blueskyweb.xyz
Received: from mail2.ietf.org ([166.84.6.31])
	by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id jeIKoaSZqU3L for <atp@mail2.ietf.org>;
	Wed, 19 Aug 2026 16:19:10 -0700 (PDT)
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [IPv6:2a00:1450:4864:20::534])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256)
	(No client certificate requested)
	by mail2.ietf.org (Postfix) with ESMTPS id 9791712C85D05
	for <atp@ietf.org>; Wed, 19 Aug 2026 16:19:10 -0700 (PDT)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-6a082b3671fso2422312a12.3
        for <atp@ietf.org>; Wed, 19 Aug 2026 16:19:10 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1787181549; cv=none;
        d=google.com; s=arc-20260327;
        b=Ul04V/bS2pBbecGWLR4wL7DftnHVBHP2cAuLdZtPChirjKtxNCh5+T99SoZE2ZPsvp
         QseAKU6cmb3b2KvG4Q7L/pewPjsoT2rowehh+x7ivkg4pwIB1jPUKrVMWkKZqh+mrkS1
         LDiP7oP+HKIgu4E5mIY5lsIDpznK6bCjckRv3cusxJ4Q/0Woihel0UeDMGDYAPSx/Pim
         2P7W9ukeoQgiynQ6v3z8Hn2JR1dqWkpsWRVZBMvIr/rnBkQTC+S9tiVwejaNS14VDXLH
         FoOZToJgwnsdHUuLrUYiwP3ZM2Ceme6nQYZVsPaGXlI8rqxRKcmma34FmqlZsfkNQ4XC
         /biA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
 s=arc-20260327;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature;
        bh=ktct5IKbA97f1LnhpdxVEU8/DzO/x4aindqVv85owt4=;
        fh=BmSlwiDcL9VOtC3iYIQyvky2SESceTIcRDew5TMx6dM=;
        b=XBvfTog4smIwI61U5jtrkQQ+PAfWMRew7bgAdkIQPpKycvimwVxXaiAKR/jyow9V5z
         6hqdDGbEbVeBrwWPtL+l3rWgO0bCNRjK00BxxJ3b/bqEnQ+wTw5cKIiPBcFbULxBDneH
         wtBZ5DcF8CFuweZxnT2FqxIbmRxC2YUNTRCZhZy8eRqAq2AjgoywTeMc32cl5H184Lph
         ooirhiejstU8W5ekhJB/u6TgULDZ7TsCKGY3lK9ajwTG2g0pFk1ERW3DsyrCr7HY58bZ
         lj7pOAMEg/IqRd+DrrpkUQvL7fJrXTFCcdT/3Yyh0VL3BSnAQk2xw/3FpQakQX/tVKhk
         pyBw==;
        darn=ietf.org
ARC-Authentication-Results: i=1; mx.google.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=blueskyweb.xyz; s=google; t=1787181549; x=1787786349; darn=ietf.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=ktct5IKbA97f1LnhpdxVEU8/DzO/x4aindqVv85owt4=;
        b=bgzAOfmu2U7Tj/CM/2MY+ypMshRzUXNR2ghtElXF0tp8Vw6rNA2lhMQHr7rdD1iWVl
         eQ4cVmTwgw4eyHfj2KWwMHt57FBnfpeDGpAHf6FwxFUZ1U5tJ8jV6Mk1kKuBYTQDCgpI
         dJOYdifBNt7wViv6R/bJkRGohiIwnyDN2wlpoA33MBuuH1PEDQ4yUfClkHR+mY8B3KVI
         PNG1Z04WdrAi10I5tpNODuQqWIx1Wy+rdMaRvVeP4xGColUxkJ3wbXoPdh7yjGpwq9XT
         cklUBEFH4EY4a+sjzAKxX53ZQZwEiG4/stDfoEnrX4hoDXMnyZr1TMdb4O8mk6GoYV2a
         kcIA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20251104; t=1787181549; x=1787786349;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=ktct5IKbA97f1LnhpdxVEU8/DzO/x4aindqVv85owt4=;
        b=LOHL1WIAmo/e+97ExfxPTEvTA4TPX83LzYHM9re1dgxx730rOV1UZdDyyH48f3XcXV
         DqRg5U9QIu58i4wy3gf0S97L+A6ZrUl73EC7aAxmb9Ub8C8M0E6SiZr7comd1P5vb5LJ
         iJMgMIrJbp6vx/XLEXKup+FmNXi/7LrycNB0Z4lsfTFl5qxb3OQZzPFUDulSvXdHwCas
         KeWXy4255LtvldBszOcpRZtYq+o4JWdhqS4LSkFYYDcp4mBGId+mGlfErWI047Zzu2Be
         EcRZR7pIZsCeCjo5jSNsGE9Vke53m5YpVF/upZY8e12XwUmg/kfrL2p0Cqp6Oe+0x81m
         P1Cw==
X-Gm-Message-State: AFuF++nUvMm3AFg+2AJEfpPeZTUJUN/ioNt0guij6Dt/j8UNqm26ylG2
	ED39Btcf2LKDsd98QLHFwcMkVwNXin1/J3OYwr31tMY7bdVY3k/jXnQD9PjKU5ghoDCj0rUpENI
	YVNBEu3/Gx4v7cxKnSeI7NOyOxtyk71weWmqXE7v7
X-Gm-Gg: AR+sD11L0oFSjZZAuyDvPZX9qy5nxezRmxp0sY2CwZdBNoHqXRTJTipp6khIWdbsKjs
	DVidG7WEiLcJs94bp9AifSL+iy8fJ4WCPqmhwUJx6m6mokVcGSdJ6HsRyNjBy/poik+wawkk2kQ
	GgkVMNiuE+YhBYjOM2NNQFlPoyt1JPQ30VLIEWvk+Go+ZVOWMr6qrzEWlcha91g+mglwUoppNkT
	BUnV2gY7HqAq9vgd++i/9CayyUICW43d4Bv1TyW3Fj5VAVhkRYvO814LqyaL2lMLquC+GP6ldze
	PULznNE29vxv7LPIO+RaazxoX2P8805qBcbibnvkXwdalTeorY2mpXswzj8GWak6F2X1KCrJMf+
	ZxuJG9jiq4zhWFsVX53BNlefCRa1ujBNt
X-Received: by 2002:a05:6402:2403:b0:6a3:e813:8457 with SMTP id
 4fb4d7f45d1cf-6a4032f9c61mr5808015a12.12.1787181549496; Wed, 19 Aug 2026
 16:19:09 -0700 (PDT)
MIME-Version: 1.0
References: 
 <CA+aD3u20G_LzmpXhuPhVz5e4w=VjJuvhVrgrHj48O05HV-SQRg@mail.gmail.com>
In-Reply-To: 
 <CA+aD3u20G_LzmpXhuPhVz5e4w=VjJuvhVrgrHj48O05HV-SQRg@mail.gmail.com>
From: Bryan Newbold <bryan@blueskyweb.xyz>
Date: Wed, 19 Aug 2026 16:18:58 -0700
X-Gm-Features: AcwNN1V3wgJML2oBiGvNm2Qp0XeehVjNE3d5Db4OGcZq9S4ag2xwxOHWwrdPxSw
Message-ID: 
 <CABFYohgybcwM1FMR5ZG2zsVtnUSqq_s0kOznbWYX9rxgF_rGJQ@mail.gmail.com>
To: Michiel de Jong <michiel@unhosted.org>
Content-Type: multipart/alternative; boundary="00000000000068369e06596ea130"
Message-ID-Hash: MTFO3IVZV4L3GSFUH2PSTC36MZGGBCIP
X-Message-ID-Hash: MTFO3IVZV4L3GSFUH2PSTC36MZGGBCIP
X-MailFrom: bryan@blueskyweb.xyz
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency;
 loop; banned-address; member-moderation; nonmember-moderation; administrivia;
 implicit-dest; max-recipients; max-size; news-moderation; no-subject;
 digests; suspicious-header
CC: atp@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: =?utf-8?q?=5BAtp=5D_Re=3A_Removing_dependency_on_RFC_7049_=28legacy_CBOR_map?=
	=?utf-8?q?_key_ordering=29=3F?=
List-Id: Authenticated Transfer <atp.ietf.org>
Archived-At: 
 <https://mailarchive.ietf.org/arch/msg/atp/TQk-t4fX1O3RCgy-hboOXMYJMMI>
List-Archive: <https://mailarchive.ietf.org/arch/browse/atp>
List-Help: <mailto:atp-request@ietf.org?subject=help>
List-Owner: <mailto:atp-owner@ietf.org>
List-Post: <mailto:atp@ietf.org>
List-Subscribe: <mailto:atp-join@ietf.org>
List-Unsubscribe: <mailto:atp-leave@ietf.org>

--00000000000068369e06596ea130
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Michiel,

Thanks for contributing!

To summarize that discussion, it sounds like in the case of CBOR string map
keys with explicit string length (which are the only supported map key data
type in the ATP data model), the three canonical sorting specifications are
the same:

- CBOR RFC-7049 (obsolete) Section 3.9 "Canonical CBOR"
- CBOR RFC-8949 (current) Section 4.2 "Deterministically Encoded CBOR",
sub-section 4.2.1 "Core Deterministic Encoding Requirements"
- CBOR RFC-8949 (current) Section 4.2 "Deterministically Encoded CBOR",
sub-section 4.2.3 "Length-First Map Key Ordering"

The current repo draft text (draft-holmgren-at-repository-02) says:

> *  All arrays, maps, and strings are encoded with explicit lengths; CBOR'=
s
indefinite-length encoding is not used
> *  Map keys are sorted using the legacy length-first ordering of Section
3.9 of [RFC7049]
> *  Maps MUST NOT contain duplicate keys

We definitely need to clarify that map keys must be strings. This is the
case in the deployed network, but wasn't noted in the draft text, or the
previous atproto written specification[0].

I think we should definitely reference RFC-8949 Section 4.2, and not call
this a "legacy" mode. But I think continuing to mention RFC-7049 Section
3.9 could reduce confusion. Perhaps:

> *  All arrays, maps, and strings are encoded with explicit lengths; CBOR'=
s
indefinite-length encoding is not used
> *  Map keys MUST have string type (and per above, an explicit length)
> *  Maps MUST NOT contain duplicate keys
> *  Map keys MUST be sorted using length-first bytewise lexicographic
order of the encoded key. Because all map keys are strings encoded with a
length prefix, this sorting order is described by both [RFC8949] Section
4.2.1 and Section 4.2.3, as well as the earlier [RFC7049] Section 3.9.

A related question is whether map keys can be empty strings. This isn't
mentioned in either the draft text or the existing specifications, only
buried in a separate guide document[1]. I think we can reopen that
question, i'm not sure which implementations do what in the current
network, and it might be simpler not to have an additional idiosyncratic
restriction like this. Eg, I don't see any such restriction in RFC-7493
(I-JSON). Either way, the ATP draft text should clarify the "empty string
map key" question.

--bryan

On Tue, Aug 4, 2026 at 6:22=E2=80=AFAM Michiel de Jong <michiel@unhosted.or=
g> wrote:

> Hi,
>
> First of all, great to see this WG here!
>
> I would like to discuss Volker's observation from June
> https://github.com/ietf-wg-atp/drafts/issues/6 and its possible
> consequences.
>
> With this, it seems the reference to the deprecated RFC 7049 can be
> removed. That would mean implementers could use an off-the-shelf CBOR
> library instead of a custom one.
>
> It's worth looking at this carefully though, because discovering a
> forgotten edge case after changing the text could cause an ugly network
> split. :)
>
>
> Cheers,
> Michiel de Jong
> (from Unhosted.org)
> _______________________________________________
> Atp mailing list -- atp@ietf.org
> To unsubscribe send an email to atp-leave@ietf.org
>

--00000000000068369e06596ea130
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Michiel,<div><br></div><div>Thanks for contributing!</d=
iv><div><br></div><div>To summarize that discussion, it sounds like in the =
case of CBOR string map keys with explicit string length (which are the onl=
y supported map key data type in the ATP data model), the three canonical s=
orting specifications are the same:</div><div><br></div><div>- CBOR RFC-704=
9 (obsolete) Section 3.9 &quot;Canonical CBOR&quot;</div><div>- CBOR RFC-89=
49 (current) Section 4.2 &quot;Deterministically Encoded CBOR&quot;, sub-se=
ction 4.2.1 &quot;<span style=3D"background-color:transparent">Core Determi=
nistic Encoding Requirements&quot;</span></div><div><div>- CBOR RFC-8949 (c=
urrent) Section 4.2 &quot;Deterministically Encoded CBOR&quot;, sub-section=
 4.2.3 &quot;Length-First Map Key Ordering<span style=3D"background-color:t=
ransparent">&quot;</span></div></div><div><br></div><div>The current repo d=
raft text (<span style=3D"background-color:transparent">draft-holmgren-at-r=
epository-02) says:</span></div><div><span style=3D"background-color:transp=
arent"><br></span></div><div><span style=3D"background-color:transparent">&=
gt; *=C2=A0</span><span style=3D"background-color:transparent">=C2=A0All ar=
rays, maps, and strings are encoded with explicit lengths;=C2=A0</span><spa=
n style=3D"background-color:transparent">CBOR&#39;s indefinite-length encod=
ing is not used</span></div><div><span style=3D"background-color:transparen=
t">&gt;</span><span style=3D"background-color:transparent">=C2=A0* =C2=A0Ma=
p keys are sorted using the legacy length-first ordering of </span><span st=
yle=3D"background-color:transparent">Section 3.9 of [RFC7049]</span></div><=
div>&gt; * =C2=A0Maps MUST NOT contain duplicate keys<span style=3D"backgro=
und-color:transparent"></span></div><div><br></div><div>We definitely need =
to clarify that map keys must be strings. This is the case in the deployed =
network, but wasn&#39;t noted in the draft text, or the previous atproto wr=
itten specification[0].</div><div><br></div><div>I think we should definite=
ly reference=C2=A0<span style=3D"background-color:transparent">RFC-8949 Sec=
tion 4.2, and not call this a &quot;legacy&quot; mode. But I think continui=
ng to mention=C2=A0</span><span style=3D"background-color:transparent">RFC-=
7049 Section 3.9 could reduce confusion. Perhaps:</span></div><div><span st=
yle=3D"background-color:transparent"><br></span></div><div><div><span style=
=3D"background-color:transparent">&gt; *=C2=A0</span><span style=3D"backgro=
und-color:transparent">=C2=A0All arrays, maps, and strings are encoded with=
 explicit lengths;=C2=A0</span><span style=3D"background-color:transparent"=
>CBOR&#39;s indefinite-length encoding is not used</span></div><div><div><d=
iv>&gt; *=C2=A0 Map keys MUST have string type (and per above, an explicit =
length)</div><div>&gt; *=C2=A0 Maps MUST NOT contain duplicate keys</div></=
div></div><div><span style=3D"background-color:transparent">&gt;</span><spa=
n style=3D"background-color:transparent">=C2=A0* =C2=A0Map keys MUST be sor=
ted using length-first=C2=A0</span><span style=3D"background-color:transpar=
ent">bytewise lexicographic order of the encoded key. Because all map keys =
are strings encoded with a length prefix, this sorting order is described b=
y both [RFC8949] Section 4.2.1 and Section 4.2.3, as well as the earlier [R=
FC7049] Section 3.9.</span></div><div><br></div></div><div>A related questi=
on is whether map keys can be empty strings. This isn&#39;t mentioned in ei=
ther the draft text or the existing specifications, only buried in a separa=
te guide document[1]. I think we can reopen that question, i&#39;m not sure=
 which implementations do what in the current network, and it might be simp=
ler not to have an additional idiosyncratic restriction like this. Eg, I do=
n&#39;t see any such restriction in RFC-7493 (I-JSON). Either way, the ATP =
draft text should clarify the &quot;empty string map key&quot; question.</d=
iv><div><br></div><div><div>--bryan</div></div></div><br><div class=3D"gmai=
l_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Tue=
, Aug 4, 2026 at 6:22=E2=80=AFAM Michiel de Jong &lt;<a href=3D"mailto:mich=
iel@unhosted.org">michiel@unhosted.org</a>&gt; wrote:<br></div><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">Hi,<div><br></div><d=
iv>First of all, great to see this WG here!<br><div><br></div><div>I would =
like to discuss<span style=3D"background-color:transparent">=C2=A0Volker&#3=
9;s observation</span><span style=3D"background-color:transparent">=C2=A0</=
span><span style=3D"background-color:transparent">from June</span>=C2=A0<a =
href=3D"https://github.com/ietf-wg-atp/drafts/issues/6" target=3D"_blank">h=
ttps://github.com/ietf-wg-atp/drafts/issues/6</a> and its possible conseque=
nces.</div><div><span style=3D"background-color:transparent"><br></span></d=
iv><div>With this, it seems the reference to the deprecated RFC 7049 can be=
 removed. That would mean implementers could use an off-the-shelf CBOR libr=
ary instead of a custom one.</div><div><br></div><div>It&#39;s worth lookin=
g at this carefully though, because discovering a forgotten edge case after=
 changing the text could cause an ugly network split. :)</div><div><br></di=
v><div><br></div><div>Cheers,</div><div>Michiel de Jong</div><div>(from Unh=
osted.org)</div></div></div>
_______________________________________________<br>
Atp mailing list -- <a href=3D"mailto:atp@ietf.org" target=3D"_blank">atp@i=
etf.org</a><br>
To unsubscribe send an email to <a href=3D"mailto:atp-leave@ietf.org" targe=
t=3D"_blank">atp-leave@ietf.org</a><br>
</blockquote></div>

--00000000000068369e06596ea130--

