From decker.christian at gmail.com Thu Nov 15 20:12:53 2018 From: decker.christian at gmail.com (Christian Decker) Date: Thu, 15 Nov 2018 21:12:53 +0100 Subject: [Lightning-dev] type,len,value standard In-Reply-To: <CAFfwr8E4ABY9EKV-YLeU+kwU8Tnzc_z9X5c67hmv1tdgSU3UCw@mail.gmail.com> References: <tAsEGaTyxtClWC6cq8zyU_kksqhswhq-liTi2j_RTMQ3g2V-ZEWrh_TAGWjqqY751PGp6UiE3ve3k9kl1A5EM78MctPJzvZ6ZvAmTOJ2n6o=@protonmail.com> <CAFfwr8E4ABY9EKV-YLeU+kwU8Tnzc_z9X5c67hmv1tdgSU3UCw@mail.gmail.com> Message-ID: <8736s2f6be.fsf@gmail.com> Conner Fromknecht <conner at lightning.engineering> writes: >> For a sequence of `type,len,value`, the `type`s must be in ascending order >> -- not explicitly accepted or rejected. It would be easier to check >> uniqueness > (the previous rule we accepted) here for a naive parser (keep >> track of some "minimum allowed type" that initializes at zero, check current >> type >= this, update to current type + 1) if `type`s are in ascending order. > > Yep ascending makes sense to me, for the reasons you stated. Definitely a good idea, especially because it results in a canonical serialization format, which is important to ensure signatures over messages can be verified even when reserializing parsed messages.