lightning-dev

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

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

Original Postby Rusty Russell

Posted on: October 27, 2015 19:41 UTC

In a conversation between Pierre and Rusty, Rusty explains how unknown protobuf fields are handled in the protocol.

According to Rusty, odd numbered fields are optional and backwards compatible, while even numbered fields are required and cause an abort if received. This numbering system can be used to deliberately break backwards compatibility in the future after some transition. For example, if a "currency identifier" field was added to HTLC for non-bitcoin transactions, it would be an even numbered field since it is necessary to understand it. However, if an optional new field were added, it would be odd and existing implementations could ignore it. Rusty suggests documenting this information in Matsjj's lightning-core docs repository.