Author: Peter Todd 2012-11-28 08:33:06
Published on: 2012-11-28T08:33:06+00:00
In this email thread, Gavin Andresen suggests that JSON-encoded messages for invoices, payments, and receipts could be used, and that the Javascript Object Signing and Encryption (JOSE) working group at the IETF has a draft specification for signing JSON data. However, signing JSON data is complicated because JSON can encode the same data in multiple ways and there is at least one security-related issue that requires special JSON parsers for handling JSON-Web-Signed (JWS) data. Additionally, a binary message format would not have these complications and choosing an encoding format is largely a matter of taste, but Protocol Buffers is a simple, well-documented, and extensible format. In response to this suggestion, Peter Todd notes that while binary message formats are generally seen as superior due to their immutability, there are still many ways in which differences in binary encoding can occur even if the meaning of the message is the same. Furthermore, implementations of Protocol Buffers differ, with some dropping unknown fields entirely and others writing them in arbitrary order after known fields. Finally, while not specific to Protocol Buffers itself, Unicode encoding can also cause problems when converting between different formats. Despite these issues, Todd suggests that treating the binary message as immutable and never re-serializing a deserialized message is the best way to handle most of these problems, although he has personally created another binary serialization method for his own project.
Updated on: 2023-06-06T08:44:50.882599+00:00