Internet Engineering Task Force (IETF)                        C. Bormann
Request for Comments: 8949                        Universitat Bremen TZI
STD: 94                                                       P. Hoffman
Obsoletes: 7049                                                    ICANN
Category: Standards Track                                  December 2020
ISSN: 2070-1721


              Concise Binary Object Representation (CBOR)

Abstract

   The Concise Binary Object Representation (CBOR) is a data format
   whose design goals include the possibility of extremely small code
   size, fairly small message size, and extensibility without the need
   for version negotiation.  These design goals make it different from
   earlier binary serializations such as ASN.1 and MessagePack.

   This document obsoletes RFC 7049, providing editorial improvements,
   new details, and errata fixes while keeping full compatibility with
   the interchange format of RFC 7049.  It does not create a new version
   of the format.

Status of This Memo

   This is an Internet Standards Track document.
   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at
   https://www.rfc-editor.org/info/rfc8949.

Table of Contents

   1.  Introduction
     1.1.  Objectives
     1.2.  Terminology
   2.  CBOR Data Models
     2.1.  Extended Generic Data Models
     2.2.  Specific Data Models
   3.  Specification of the CBOR Encoding
     3.1.  Major Types
     3.2.  Indefinite Lengths for Some Major Types
       3.2.1.  The "break" Stop Code
       3.2.2.  Indefinite-Length Arrays and Maps
       3.2.3.  Indefinite-Length Byte Strings and Text Strings
       3.2.4.  Summary of Indefinite-Length Use of Major Types
     3.3.  Floating-Point Numbers and Values with No Content
     3.4.  Tagging of Items
       3.4.1.  Standard Date/Time String
       3.4.2.  Epoch-Based Date/Time
       3.4.3.  Bignums
       3.4.4.  Decimal Fractions and Bigfloats
       3.4.5.  Content Hints
       3.4.6.  Self-Described CBOR
   4.  Serialization Considerations
     4.1.  Preferred Serialization
     4.2.  Deterministically Encoded CBOR
       4.2.1.  Core Deterministic Encoding Requirements
       4.2.2.  Additional Deterministic Encoding Considerations
       4.2.3.  Length-First Map Key Ordering
   5.  Creating CBOR-Based Protocols
     5.1.  CBOR in Streaming Applications
     5.2.  Generic Encoders and Decoders
     5.3.  Validity of Items
     5.4.  Validity and Evolution
     5.5.  Numbers
     5.6.  Specifying Keys for Maps
     5.7.  Undefined Values
   6.  Converting Data between CBOR and JSON
     6.1.  Converting from CBOR to JSON
     6.2.  Converting from JSON to CBOR
   7.  Future Evolution of CBOR
     7.1.  Extension Points
     7.2.  Curating the Additional Information Space
   8.  Diagnostic Notation
     8.1.  Encoding Indicators
   9.  IANA Considerations
     9.1.  CBOR Simple Values Registry
     9.2.  CBOR Tags Registry
     9.3.  Media Types Registry
     9.4.  CoAP Content-Format Registry
     9.5.  Structured Syntax Suffix Registry
   10. Security Considerations
   11. References
     11.1.  Normative References
     11.2.  Informative References
   Appendix A.  Examples of Encoded CBOR Data Items
   Appendix B.  Jump Table for Initial Byte
   Appendix C.  Pseudocode
   Appendix D.  Half-Precision
   Appendix E.  Comparison of Other Binary Formats to CBOR's Design Objectives
   Appendix F.  Well-Formedness Errors and Examples
   Appendix G.  Changes from RFC 7049
   Acknowledgements
   Authors' Addresses

[NOTE: This file contains the header, abstract, and table of contents
 of RFC 8949. The full specification text is available at:
   https://www.rfc-editor.org/rfc/rfc8949
   https://www.rfc-editor.org/rfc/rfc8949.txt  (text)
   https://www.rfc-editor.org/rfc/rfc8949.pdf  (PDF)

 Full document: 66 pages, December 2020
 Authors: Carsten Bormann (Universitat Bremen TZI), Paul Hoffman (ICANN)
 DOI: 10.17487/RFC8949
 Obsoletes: RFC 7049
 STD: 94]
