Rusty Russell [ARCHIVE] on Nostr: 📅 Original date posted:2015-10-27 📝 Original message: Pierre <pm+lists at ...
📅 Original date posted:2015-10-27
📝 Original message:
Pierre <pm+lists at acinq.fr> writes:
> Hi Rusty,
>
>> 5) Unknown protobuf fields are handled in the protocol as follows
>> (including in the initial Authenticate packet):
>>
>> 1) Odd numbered fields are optional, and backwards compatible.
>> 2) Even numbered fields are required; abort if you get one.
>
> I don't get it, what is it about ?
Yes, I really need to write this up in Matsjj's lightning-core docs
repository.
Since protobuf fields are explicitly numbered, we can use this to
deliberately break backwards compatibility in future after some
transition.
For example, if we want to add a "currency identifier" field in HTLC,
for non-bitcoin transactions. That would be an even numbered field,
since you need to understand it. (There would also need to be some way
to indicate you support those, during connection setup or something).
But if we want to add an optional new field, we'd make it odd, and
existing implementations could ignore it.
Cheers,
Rusty.
Published at
2023-06-09 12:44:56Event JSON
{
"id": "5ef698da31c6574bc249644be53e0a6123c58e7154b930c1d1c465402e049f5e",
"pubkey": "13bd8c1c5e3b3508a07c92598647160b11ab0deef4c452098e223e443c1ca425",
"created_at": 1686314696,
"kind": 1,
"tags": [
[
"e",
"8f7f2db21682c914495fbd222b86e1fdad7235916c75551e48ed09d538570897",
"",
"root"
],
[
"e",
"187da4719c9271f055d326424fb851efe4baa8e11eb21966fb1b54de256e97b0",
"",
"reply"
],
[
"p",
"208e7a4699791a0264a0298ffa60456c51ac8d8992096a1b67389965eccc82ff"
]
],
"content": "📅 Original date posted:2015-10-27\n📝 Original message:\nPierre \u003cpm+lists at acinq.fr\u003e writes:\n\u003e Hi Rusty,\n\u003e\n\u003e\u003e 5) Unknown protobuf fields are handled in the protocol as follows\n\u003e\u003e (including in the initial Authenticate packet):\n\u003e\u003e\n\u003e\u003e 1) Odd numbered fields are optional, and backwards compatible.\n\u003e\u003e 2) Even numbered fields are required; abort if you get one.\n\u003e\n\u003e I don't get it, what is it about ?\n\nYes, I really need to write this up in Matsjj's lightning-core docs\nrepository.\n\nSince protobuf fields are explicitly numbered, we can use this to\ndeliberately break backwards compatibility in future after some\ntransition.\n\nFor example, if we want to add a \"currency identifier\" field in HTLC,\nfor non-bitcoin transactions. That would be an even numbered field,\nsince you need to understand it. (There would also need to be some way\nto indicate you support those, during connection setup or something).\n\nBut if we want to add an optional new field, we'd make it odd, and\nexisting implementations could ignore it.\n\nCheers,\nRusty.",
"sig": "09bac16eb00f55db8f1aa9735641230a081be7eb8be05049f7ac3e63b150455246cadf53b4cae3ec366812c2533fb855f7e3cc17dc099cfea55f4d42e3c8fa2a"
}