lightning-dev

[PATCH v3] daemon: encrypted communication (version 3)

[PATCH v3] daemon: encrypted communication (version 3)

Original Postby Peter Todd

Posted on: October 27, 2015 20:40 UTC

Rusty Russell, a developer, explains in an email how unknown protobuf fields are handled in the protocol.

The even numbered fields are required and must be understood by all implementations. If they are not, the implementation should abort. On the other hand, odd numbered fields are optional and can be ignored by existing implementations. Rusty also suggests using protobuf field numbers to deliberately break backward compatibility in future versions of the protocol. For example, adding a new field for non-bitcoin transactions would require understanding it, and thus be an even numbered field. In contrast, an optional new field would be an odd numbered field. An analogous idea is OpenPGP’s “critical bit” which indicates that if the software doesn’t understand the packet, it should consider the signature invalid.