lightning-dev

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

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

Original Postby Rusty Russell

Posted on: October 28, 2015 00:32 UTC

The Lightning network is a protocol that uses even and odd numbered protobuf fields to break backwards compatibility in future after some transition.

Rusty Russell, the developer of the network, explains that if they want to add an optional new field, they would make it odd, and existing implementations could ignore it. However, even numbered fields are required and should be understood. This concept is similar to OpenPGP's "critical bit" for packets which indicates that if the software doesn't understand the packet, it should consider the signature invalid. In lightning, you should probably never send an implementation a packet it won't understand (after the initial handshake stage), but it still serves as belt-and-braces check. If a field is added with the intent to eventually make it optional, it would be added as two optional fields, say 11 and 12. You could set one or the other, not both, but accept either. In a few years' time, implementations would stop using 11.