Re: [Cbor] Unusual map labels, dCBOR and interop

"lgl island-resort.com" <lgl@island-resort.com> Thu, 28 March 2024 19:55 UTC

Return-Path: <lgl@island-resort.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 47AE8C14F619 for <cbor@ietfa.amsl.com>; Thu, 28 Mar 2024 12:55:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.898
X-Spam-Level:
X-Spam-Status: No, score=-6.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UcY6isDu8ZQ1 for <cbor@ietfa.amsl.com>; Thu, 28 Mar 2024 12:55:30 -0700 (PDT)
Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2135.outbound.protection.outlook.com [40.107.96.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3DBD9C14F71B for <cbor@ietf.org>; Thu, 28 Mar 2024 12:55:29 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mouyNhkf5IqlV0+o0kj1rkEF8vQXbBeXSsxZGQIC/ZcZ0eZEdHpiYSrqhNhN6z1F8MKvOZik0JLKGvdGobJnxYxEqlZ2qCYp4pYnXF3lgU3GevbZ53gNfdCITXlMQMygn6+TecuimHPQWcz0Vrzsr2GBI/V0Yf6Oq8iuiilaUHbS8S2VKZJG+jYsrzG0n0Em3aLlPy7r0QDocsrtMHyhMozyV3wE51OZQfw5DD+nyQ3GpK/z3ndiu5ExTeDOJuI3Ogbgopavlto03JhpGyTeXWdTRXBEF8337/AHKPgHt5tZJ6v8FH0t6Q2pM85UN16BzRNUbIL1TQ6raUpCFDwbew==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RdHdGuxVXL2seQE3Mf7KuO+CFD8iR+9WQmHrh7wvbUY=; b=bUw9KT2NS+OZQ+oniw1k6N2DnGqTjAPjQ/GRwpUCw8FRqazDeRis49625ChlgrZ4g8syBt7vGBfmbZYGBV1sa3akNkaL4Jfo42wtYNJfZA0bOZWAIWAhSEoJsQo79DOs086TYkCw+Dc816TlzK/jNSNrSAivu9SMK7VChdcbCnSulGkqRxXhUOrxO1s8Zx6rlmyPHCIVN29xKcIfQFIGfOnboKCDs7EHRJ9WJfnhqZWpAJ0aNSU4PZ2Pb6yanXvcIClHMuF1GEvTWhkTbi8a1bHXrv0fD7lHg5przmqGPdjPD56EC2M0Y7kSXP8tX6b0rjXn0hQBunlsh5UdrUp6cA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=island-resort.com; dmarc=pass action=none header.from=island-resort.com; dkim=pass header.d=island-resort.com; arc=none
Received: from PH7PR22MB3092.namprd22.prod.outlook.com (2603:10b6:510:13b::8) by CH3PR22MB4539.namprd22.prod.outlook.com (2603:10b6:610:195::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.33; Thu, 28 Mar 2024 19:55:25 +0000
Received: from PH7PR22MB3092.namprd22.prod.outlook.com ([fe80::1cab:7344:221c:bb8e]) by PH7PR22MB3092.namprd22.prod.outlook.com ([fe80::1cab:7344:221c:bb8e%5]) with mapi id 15.20.7409.031; Thu, 28 Mar 2024 19:55:24 +0000
From: "lgl island-resort.com" <lgl@island-resort.com>
To: Wolf McNally <wolf@wolfmcnally.com>
CC: Carsten Bormann <cabo@tzi.org>, "cbor@ietf.org" <cbor@ietf.org>
Thread-Topic: [Cbor] Unusual map labels, dCBOR and interop
Thread-Index: AQHaeJqz5sU3csZdl0K76nI1ITZeVrE8YKeAgASbiQCAAB6MAIAGNQgAgAUciQCAATYvgA==
Date: Thu, 28 Mar 2024 19:55:24 +0000
Message-ID: <6AA6FFE2-FEC6-4E67-B1DA-B598E68C76A7@island-resort.com>
References: <8C245824-1990-4616-AB70-FFD4FACB1AE9@island-resort.com> <11E8A8A5-D891-49FF-AF16-697C06F463B3@tzi.org> <9A0CE364-C141-4EBE-9703-292C416D12F5@island-resort.com> <3D62C4F0-D570-4EE4-AF6A-163C708AA6BE@tzi.org> <58BA8F8C-0C63-4534-9BF7-255C32D02C16@island-resort.com> <5F1E1133-4565-4D0A-98EE-A13C6F5F67AA@wolfmcnally.com>
In-Reply-To: <5F1E1133-4565-4D0A-98EE-A13C6F5F67AA@wolfmcnally.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: PH7PR22MB3092:EE_|CH3PR22MB4539:EE_
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: FAAW8Cc6jTeaXySsIzKvcYndZTs7HqWCIvz3bvO5g57AJq07zk/XOEQqZCypTLb7b/RNUZ+5OXP6+lOdP7ab6VjpWAKg91HGy2DW+5CNKo8rlDf/Eo717oa4v7Zz9MMIOpvhspS/o6UcmvB6vEIx3kRvN867ncJ4bOkF3iwXyl51s0vdA462PYaQS8Nec5G4vkohr+f9DoaGgKk3aKw2HTbJwisUO8nORk5Yur5pxrd+DUI5C7Aj8vaftXayd78J0iohqY6OmwI2lIBusbKXwbH2a2YCUUqC1wSMOSYvVHuDSjAjOP7F4Rs7WxmgEcyLmbQlt5k2WXBC48mYKL+bz/jFfVPzIQQ3zJfNvdGL197GkSJLqGrTcwsMluv6forHoWaJl2v742tqqYByudcogJhfsFX/i1sQm4hNEA1YOPFk7CYV7bS7Ymb0CfryQJYZhg7yY+rxnWQ5KX1R0Ze+FkuEsHjPUH0D+yRohlSDPKrIbERESusvZbZTURJiPCgwvlN/c3FZpt1Ht9fAEnMaG6/O4qdd1PnRlRWbcOBNdeBS3tw3vBVQit2CCuGjaFFBXFWVK2VMaM61GfouylufQaIjUL12va4SA0Ro9CsrCMuqUccg+UIwhLO3TbqS7+HuzeTmTTH0t30tHC0Lxz5ZotgQypRITbcg+/iChgyirjY=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR22MB3092.namprd22.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(376005)(1800799015); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: 0DGtejSK8GfOX21VePtagV2+amLHFkwOglwQzsExy+KFBUfHkwBmToczAOMDuTm4qaYHJzvBKVdd1e5ATIQUntgUEZ9TA5qqIjZwFGeijspROaUmwl4uzmOHsJaNB5vh4ETnBlhsxOCGhwgQEmmgzxFVhlJkus9kkkgOGV5jcT2U20Ncfi/i2MuVhebEnVscaej3j1zgcWhaoMYMEp3Wmh5urxZiQcG5kbc5m1IY14w+dtqNv05p8wzju0gj8t3oSFxxWws9OpWgyMeC04WwSq1XuAxbsKfI2pKaoDDv+ZPgMW+cgeHAr+lZcYMAVFiyw/SqbdBKL6chuzKttao+w77wu2akimtW9B4oYhiJmsMpkf0hzIlYSI1dwBI7fCVR4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ty0tIkjQLBo8U1mrNtbAVXlCS2jZ369yJ9M5AYl4Fivh2qD8DE6INJR37Dnkff4zIc0EMJrAcGOg7YHZHk4okqmkbUCigrFGoXMGF2uw6TUG9xxQnK6NHI5cbYtgiUpCPxbWkOa7Cjfv2tlEVPZCN8YjI+oC+HGSu0KnipJnJhTWBcI7w==
Content-Type: multipart/alternative; boundary="_000_6AA6FFE2FEC64E67B1DAB598E68C76A7islandresortcom_"
MIME-Version: 1.0
X-OriginatorOrg: island-resort.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PH7PR22MB3092.namprd22.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 241296f0-6ec6-48c3-e4c9-08dc4f610239
X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Mar 2024 19:55:24.7157 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: ad4b5b91-a549-4435-8c42-a30bf94d14a8
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: aXvYvWF4MI3biK240oskZ3wSXPhzOldoPyZ61ZhXBIaFSvGUXQc6mTErUbmeKuhGR9O6pz10BqUMPknGzICpwA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR22MB4539
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/lsolAKRCQkDo1kEs97Auj32tX7Q>
Subject: Re: [Cbor] Unusual map labels, dCBOR and interop
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Mar 2024 19:55:34 -0000

On Mar 27, 2024, at 6:25 PM, Wolf McNally <wolf@wolfmcnally.com> wrote:

LL,

On Mar 24, 2024, at 12:21 PM, lgl island-resort.com <lgl@island-resort.com> wrote:

For dCBOR, I’d like to see map labels very restricted. I’m not a JSON user/expert, but it is a Jupiter-sized data point for me. It has massive use with only string labels.

I’ll propose integers and strings (major types 0-3) to start discussion. Maps and arrays seem too much. Only strings might be OK.

I’m not sure whether the issue you’re having is coming from a place of design advice, or implementation complexity. From a protocol design perspective, in the vast majority of cases I agree that using integers or strings for map keys makes the most sense. From an implementation perspective, our code simply incrementally manages maps by using the serialized CBOR of a key as the “real” key and keeps the map in sorted order, even though it hides this fact from the user. This lets us skip the sorting step during serialization, and facilitates the validation step during deserialization. It also lets us support arbitrary map keys per the CBOR spec. Obviously this isn’t the only approach that works to keeping the serialized map supported, its keys unique, and also support complex keys.

Wolf, thank you kindly for taking the time to write a clear explanation. Makes the discussion converge faster (for me anyway).

I don’t have an issue. Just thought it was something worth discussing. Here are some reasons.

Implementation complexity — To implement non-scalar map labels, you’d probably do so in an OO environment where the label is an object. That’s a little out of line with the embedded goals of CBOR. Also, implementing maps as map labels in my embedded-oriented QCBOR project wouldn’t really work (but QCBOR is just one data point).

Alignment with JSON — Seems like lots of CBOR protocols will get translated to/from JSON because so much of the world runs on JSON. For example, I pushed hard for EAT to be realizable in both CBOR and JSON because I thought the attestation ecosystem would benefit. I was supported by the RATS WG to complete this. CDDL has been evolved to support CBOR+JSON better.

Simplicity/adoption — I think JSON succeeded because it is so simple. CBOR is handicapped in comparison. Seems that maps as map labels is something you do to show how clever you are, not because it is good design or gives expressive power not otherwise available.


I can imagine many use cases other than the Gordian Envelope finding dCBOR highly desirable because it eliminates all the CBOR stuff that is variable and a lot of stuff that is hard to understand. Most people aren’t as smart or as into this stuff as we are. Simple map labels line up with this.

Again, the goal of dCBOR wasn’t “simple CBOR,” although it has some of that flavor, but “deterministic CBOR” as its name suggests, and I’ve kept that foremost in the design choices I made in its specification. I can see why someone might define an “sCBOR” protocol that further restricts dCBOR, but inasmuch as dCBOR meets its original goals, I don’t see the point of restricting it further.

I have a personal view that some sort of “simple CBOR” would be good for the CBOR ecosystem because I see smart IETFers often confused about serialization, determinism and other. If they’re confused, think about the masses of IT people.

dCBOR seems like it could serve both that and Gordian.

This is not something I personally want to put a lot of energy into especially if there isn’t big WG consensus and it is a push up hill. Just thought it was worth some discussion, clarification and consideration.

LL