[Atp] Re: ATP records from arbitrary JSON

Ryan Barrett <public@ryanb.org> Wed, 29 July 2026 14:51 UTC

Return-Path: <public@ryanb.org>
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 E9B711208AC01 for <atp@mail2.ietf.org>; Wed, 29 Jul 2026 07:51:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ietf.org; s=ietf1; t=1785336709; bh=dex13WVOcANW3XRGb8gLTyFhZp19Peordd+9SmGlA2I=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=cJO8ZwmwTRqnzsfqOkyJ+zFVTn6GvwoUrnL+rrbkJBbR7w4KT1OspNCPSjk4pknhK jfFnvZS4q1tbDt7c1iDoLqIrWrGFfu8TGxXO4/YBhmHbqYqWBOAi+LlSD7oesX6k6t 49jSFJw5kGWU2NXEBM1ki+y7+mvR0ut/kC1e14Bw=
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -0.101
X-Spam-Level:
X-Spam-Status: No, score=-0.101 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, HTML_MESSAGE=0.001, PDS_OTHER_BAD_TLD=1.999, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=ryanb.org
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 u0I9ONQ6PoBw for <atp@mail2.ietf.org>; Wed, 29 Jul 2026 07:51:48 -0700 (PDT)
Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id 69C041208ABF7 for <atp@ietf.org>; Wed, 29 Jul 2026 07:51:48 -0700 (PDT)
Received: by mail.gandi.net (Postfix) with ESMTPSA id 40AB23ECC9 for <atp@ietf.org>; Wed, 29 Jul 2026 14:51:41 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ryanb.org; s=gm1; t=1785336701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SHHoi7KAo3ldehKwto9CZrEe5VXHY2Ze+Sk6OkJN8Og=; b=dU6yayAKklhHqohF6HD4lw73fmsOFdv+dNQeSfqfPkJxViJQOoVnbaMD6OUP0T35Rpr5mw 2EEw0FTebCw7djiDi8ctRLsqto0Y+iw29fM6S5BxNvoIq2cjnRKjPAsQBgkHIIgkbpaKuE Kyuwmmtg/bY7UEnPZD3sj8ghNu091uze8TfzRGO0VViJsUHxlgh62Sk0ol/yTM6Xeph5YM CsHOt2Zl80GP1x9KJ/I/Cx0IGCsTW/z8rYXmsGPawXXkPXM82cTitZz5+SFlfClfEDm84W fI1+6WIzAdrp8wrff3kvqsTVJ1UBB4cxWlZGQCFk+iDRl0OmXzf7udwsgPzKIg==
Received: by mail-qv1-f47.google.com with SMTP id 6a1803df08f44-902e4af2d9dso17272316d6.0 for <atp@ietf.org>; Wed, 29 Jul 2026 07:51:41 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AHgh+RrNEAvLubQhF3u2ZB1ayiHCiN34uvXTwdT03uBUmbtfMv3MwzK+I9cgLnkGE8stquPfZ3c=@ietf.org
X-Gm-Message-State: AOJu0YxPQO+NOfJLWoPfPWiG3tvmmQZCRXh4fMj4yUsESYrK6oe6Bm62 XF1bjvsjB3/G8woDUjP5Y/sI4mORqPXjWZE6XqM5Lbi6DJPLV3kZ47qEVy+41AGWxO1B2aRV5QE h1xdt+6hBWpMrgmfg1HNsqNwQQLemuSc=
X-Received: by 2002:ad4:5768:0:b0:8f1:74b0:a4ec with SMTP id 6a1803df08f44-908227a38fdmr25840716d6.4.1785336699979; Wed, 29 Jul 2026 07:51:39 -0700 (PDT)
MIME-Version: 1.0
References: <5ee1d379-a566-4610-a988-d2960a78ea12@gmail.com> <CA+caGh_VVV0bk+b7dfgmHZnpQtWY7sd-=bqKWLWYucDpWieVnA@mail.gmail.com> <CABFYohhq9pummuPgpnVyCu7s9knFNvWTECUaUK=D1fLtGdCX+g@mail.gmail.com> <ggREjyaX5fVHvcJThr3UO01pS0PRV3G5XAocenzYy6EyBRBH1eGvLWKBP420fm86X2GI4Y7JtGcoR9wQnpPovNMh2EsNpAnV_aaoR6z0TSY=@learningproof.xyz>
In-Reply-To: <ggREjyaX5fVHvcJThr3UO01pS0PRV3G5XAocenzYy6EyBRBH1eGvLWKBP420fm86X2GI4Y7JtGcoR9wQnpPovNMh2EsNpAnV_aaoR6z0TSY=@learningproof.xyz>
From: Ryan Barrett <public@ryanb.org>
Date: Wed, 29 Jul 2026 07:51:02 -0700
X-Gmail-Original-Message-ID: <CA+caGh923uS71p_aYj5wJB9ZSuK7jDyw1VeDtCgxU0FUEYkCsQ@mail.gmail.com>
X-Gm-Features: AUfX_mz3QSCjMX-Ane5B6RPolKXZwbXWfwQpnMayuPogqAKTIrKDDRZgfAIyno0
Message-ID: <CA+caGh923uS71p_aYj5wJB9ZSuK7jDyw1VeDtCgxU0FUEYkCsQ@mail.gmail.com>
To: bumblefudge von CASA <bumblefudge@learningproof.xyz>
Content-Type: multipart/alternative; boundary="000000000000ce91a20657c11772"
X-GND-Sasl: public@ryanb.org
X-GND-Cause: dmFkZTFf6XclkTAx7fGxyvNZfI1GQHWYuq0NivOcFL2Lybm//wEyMuqbxYwRa5fhS7003rdaz1MwjLf2x+6/CWsL7hEky9/QSW5bwG5zzfcAfwDfLZTyQh2VurrGRihxxkbTh2dz5N9p/i5ZC9jYQ7uSssCISBBI6eaO+NPDwdlMEr1WYqutEKmyjBAliYQsmT1/RJJQ6mTxo9C2et6yRTAhFYOAXYOzHE0NlX5R0NZ3tbbDKrBhbC66XUvE0qsnKVROteocmYIXdVU0+eQLA2hm/RLnLqcwB24bMWD/ZplpWlurJwKQRlvZ40lXC5b8RKtAo7WFdLMLduvuLeMWiHAE1pbvRUZiZBmyzr3O8Rhgb9UvN76p8Iz1VRJobkNNto3JmnLmDCf8xdKyqqDLVP+OH5RgcMsADnfTqYbDZ9MUWOwsctZQq11AsyJnbbhI9fLIhEQq8t5rR3fXv5r8l6uym8tMg/RDrGFtsJvi5Ob4IXK61+RfdmjfJvy1yenj4dIYfCNpzMkrN/HSpN3esUC0O4rxxdmi3HVqtGqzVby/flFPCOavlfSJOhVIwGsoxowpz7TyRDmDMVACo5PNGojiFwkEFH/j288q0SsKQ1tzYqsl16TDlaY7V7Bz8CHHtR7rifT45kU4u3SX5SiR6E6QSjpnwXUZCqRXTA43Dfa4EqIelA
X-GND-State: clean
X-GND-Score: -77
Message-ID-Hash: YKCOENAH3FYHCIE36MNQJXRWA4RUX5FN
X-Message-ID-Hash: YKCOENAH3FYHCIE36MNQJXRWA4RUX5FN
X-MailFrom: public@ryanb.org
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: Bryan Newbold <bryan=40blueskyweb.xyz@dmarc.ietf.org>, Volker Mische <volker.mische@gmail.com>, atp@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [Atp] Re: ATP records from arbitrary JSON
List-Id: Authenticated Transfer <atp.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/atp/Ak4ze_f9hWdg8uTjgSo2bU_TxlY>
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>

On Wed, Jul 29, 2026 at 2:49 AM bumblefudge von CASA <
bumblefudge@learningproof.xyz> wrote:

>
> Yes, as our slides mentioned, the `$type=unknown` hatch is how many of
> the illicit floats have dodged validation and snuck into the protocol's
> current data plane, but our argument is that this is the wrong tradeoff for
> a global protocol, and that floats deserve first-class treatment rather
> than "void your warranty" status.
>

Sure, of course. I understand the relationship between arbitrary JSON and
float handling, but I interpreted OP here as mainly about the former, not
the latter. I don't think $type: unknown or "void your warranty" arbitrary
JSON are the right ways to do floats long term either. Apologies if I
implied otherwise.




> `type=unknown` embedding of otherwise bog-standard JSON suspends
> validation at the lexicon level and basically signs over the JSON as
> serialized, which is suboptimal for many reasons! Our basic argument is
> that "floats are hard" is an inadequate justification for pushing float
> verification into userspace at the expense of protocol-wide efficiencies of
> scale and stability, when float validation and translation are essentially
> solved problems.
>
> The "suspend validation, here are some bytes" option makes sense for
> things that genuinely break the limitations of a data language expressed in
> JSON Schema or protocol-specific constraints (like Bryan's examples of
> absolute size limits, or top-level versus embedded requirements), or things
> that are inherently unstable in JSON itself.  Our argument is that floats
> should be taken out of that category and integrated into the lexicon type
> system so that floats can get the same "first-class treatment" other JSON
> Numbers have grown accustomed to.
>
> Bryan wrote:
> > One motivating question is whether developers should expect to be able
> to embed existing JSON data cleanly in to atproto records. Can you just
> take arbitrary DID documents and stuff them in there? GeoJSON? JSON-LD?
>
> This feels more like a reductio ad absurdum than devilish advocacy, as we
> aren't arguing that 100% of the JSON on today's web should be embeddable,
> just that the vast majority of scientific data would instantly become
> embeddable if floats were handled natively. I agree that basic constraints
> on what JSON can be embedded are fair for any data/schema language-- size
> constraints and top-level constraints are both perfectly reasonable
> tradeoffs for this data system.  But unlike the case of JSON-LD (which in
> some cases gets canonicalizes differently than "flat JSON"),
> reasonably-sized floats get canonicalized as IEEE754/CBOR-42-compatible
> floats *already* by JCS[^1] and from there get translated stably to and
> from CBOR, and to and from every major language... in the vast majority of
> modern JSON APIs on the web, that's how floats are handled, so the actual
> question here is whether banning floats is a justifiable trade-off for this
> set of JSON APIs.
>
> If [the IETF version] of ATP is intended to be a global-scale,
> general-purpose protocol rather than a sync protocol for microblogging
> apps, I'm not convinced it should drop floats just because the flagship
> implementation didn't need them. But maybe "how much free reign should
> future, independent implementations have" is a bigger upstream question
> than just the type system of Atproto's schema language, about which I
> should probably start a separate thread.
>
> Thanks,
> __bf
>
> [^1]: https://www.rfc-editor.org/rfc/rfc8785.html#section-appendix.b
>
> ---
> bumblefudge
> janitor @Chain Agnostic Standards Alliance
> <https://github.com/chainagnostic/CASA>
> contractable via learningProof UG <https://learningproof.xyz>
> mostly berlin-based
>
> On Tuesday, July 28th, 2026 at 6:36 PM, Bryan Newbold <bryan=
> 40blueskyweb.xyz@dmarc.ietf.org> wrote:
>
> I think this is a great framing question. And i'm not sure if my answer
> would be a "Yes".
>
> One motivating question is whether developers should expect to be able to
> embed existing JSON data cleanly in to atproto records. Can you just take
> arbitrary DID documents and stuff them in there? GeoJSON? JSON-LD? In many
> cases I would at least carefully consider *not* doing this, even using the
> 'unknown' Lexicon schema type. Even if the data types and structure were
> compatible today, they might not be in the future. We even debated this
> when designing the 'com.atproto.lexicon.schema' Lexicon publication
> meta-schema, and nearly went with JSON blobs or JSON wrapped as 'bytes' in
> the record.
>
> One place friction can come up is reasonable limits on record data size
> and complexity. I wrote up a record data validation guide at one point[0],
> and I think the operational considerations document under our current
> charter should cover a similar scope. It touches on things like maximum
> record data size, nesting depth, string and byte-array lengths, etc. This
> results in another large caveat around permitting arbitrary JSON data.
>
> Another caveat is that the top-level record data "MUST" be of object type
> (not arbitrary JSON data, which might be a string or number), and "MUST"
> contain a '$type' field, and that field "MUST" be of string type, and that
> string "MUST" not be empty, etc, etc. This is a slightly different caveat
> from data simply not containing a dollar-prefixed field.
>
> Instead of maximizing permissiveness of arbitrary JSON data, we might
> instead say that record data is intended to support record data which
> conforms to some Lexicon schema. This might give us more flexibility in
> evolving the data model over time, though there could be tension with the
> 'unknown' data type.
>
> I do think that there is interest/demand in being able to insert arbitrary
> JSON data in to atproto. But it might be better to provide a mechanism (or
> at least a recommended design pattern) for achieving this which has fewer
> caveats.
>
> This reply is a bit of a provocation / devil's advocacy. Maybe the caveats
> aren't actually too hard to satisfy in most situations. But I do think
> there are multiple considerations to take in to account.
>
> --bryan
>
> [0]: https://atproto.com/guides/data-validation
>
> On Tue, Jul 28, 2026 at 1:34 AM Ryan Barrett <public@ryanb.org> wrote:
>
>> This is a good one! And the good news here is, ATProto largely already
>> supports arbitrary JSON-shaped data in records. It's not encouraged, for a
>> number of reasons, but it is explicitly provided for. The lexicon spec includes
>> an unknown field type <https://atproto.com/specs/lexicon#unknown> that
>> designers can use to indicate that they expect arbitrary data, but you can
>> also put arbitrary data (of any type, including objects) into fields that
>> *aren't* defined in a lexicon. PDSes and other consuming services are
>> explicitly required to allow all this
>> <https://atproto.com/specs/lexicon#authority-and-control>, for a few
>> reasons, eg changing lexicons (backward compatibly) over time.
>>
>> (...subject to some caveats, like you mention, eg floats and some $...
>> names!)
>>
>> On Fri, Jul 24, 2026 at 5:04 AM Volker Mische <volker.mische@gmail.com>
>> wrote:
>>
>>> Hi all,
>>>
>>> over the past few weeks I realized that I started the whole floats
>>> discussion from within too deep into the rabbit hole. I want to start
>>> again from a higher level, hence a separate thread: Do we want ATP
>>> records to be able to support arbitrary JSON?
>>>
>>> I think the answer is: yes, as much as we can.
>>>
>>> In order to reduce the edge cases, let's assume for this thread that the
>>> "arbitrary JSON" is valid I-JSON [1].
>>>
>>> Of course fully arbitrary isn't possible, which is true for all JSON
>>> based systems that need to signal custom things. In Apache CouchDB it is
>>> top-level fields starting with an underscore which are reserved, hence
>>> cannot be used in your arbitrary JSON input. For ATProto it is all
>>> fields starting with a dollar sign.
>>>
>>> So if your data doesn't contain any key starting with a dollar sign,
>>> then I think it should be possible to store it as an ATP record without
>>> any further limitations.
>>>
>>> I hope we can find agreement that this is a goal to pursue and we can
>>> then take the next step and discuss on how to get there.
>>>
>>> [1]: https://www.rfc-editor.org/info/rfc7493/
>>>
>>> Cheers,
>>> Volker
>>>
>>> _______________________________________________
>>> Atp mailing list -- atp@ietf.org
>>> To unsubscribe send an email to atp-leave@ietf.org
>>>
>>
>>
>> --
>> https://snarfed.org/
>> _______________________________________________
>> Atp mailing list -- atp@ietf.org
>> To unsubscribe send an email to atp-leave@ietf.org
>>
>
>

-- 
https://snarfed.org/