From 552291dc6318322623675b42353cce208582c822 Mon Sep 17 00:00:00 2001 From: "kristen@oreilly.com" Date: Fri, 19 Nov 2021 11:56:36 -0800 Subject: [PATCH] Edited 13_wire_protocol.asciidoc with Atlas code editor --- 13_wire_protocol.asciidoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/13_wire_protocol.asciidoc b/13_wire_protocol.asciidoc index 3ce49d9..b7b96f1 100644 --- a/13_wire_protocol.asciidoc +++ b/13_wire_protocol.asciidoc @@ -11,7 +11,7 @@ that have been built into the protocol. === Messaging Layer in the Lightning Protocol Suite -((("Lightning Network Protocol","messaging layer")))((("wire protocol","messaging layer in the Lightning Protocol Suite")))The messaging layer, which is detailed in this chapter, consists of "Framing and message format," "Type-Length-Value (TLV)" encoding, and "Feature bits." These components are highlighted by an outline in the protocol suite, shown in <>. +((("Lightning Network Protocol","messaging layer")))((("wire protocol","messaging layer in the Lightning Protocol Suite")))The messaging layer, which is detailed in this chapter, consists of "Framing and message format," "Type-Length-Value" encoding, and "Feature bits." These components are highlighted by an outline in the protocol suite, shown in <>. [[LN_protocol_wire_message_highlight]] .Messaging layer in the Lightning protocol suite @@ -102,7 +102,7 @@ including the prefix type of the message along with the contents of its message body.(((range="endofrange", startref="ix_13_wire_protocol-asciidoc2")))(((range="endofrange", startref="ix_13_wire_protocol-asciidoc1"))) [[tlv_message_extensions]] -=== Type-Length-Value (TLV) Message Extensions +=== Type-Length-Value Message Extensions ((("Type-Length-Value (TLV) message extensions","message extensions in wire protocol")))((("wire protocol","TLV message extensions")))Earlier in this chapter we mentioned that messages can be up to 65 KB in size, and if while parsing a message, extra bytes are left over, then those bytes @@ -151,7 +151,7 @@ transactions they don't understand, then they simply ignore them as their funds aren't using those new features. [[tlv]] -=== Type-Length-Value (TLV) Format +=== Type-Length-Value Format ((("Type-Length-Value (TLV) format", id="ix_13_wire_protocol-asciidoc3", range="startofrange")))((("Type-Length-Value (TLV) format","wire protocol and", id="ix_13_wire_protocol-asciidoc4", range="startofrange")))((("wire protocol","TLV format", id="ix_13_wire_protocol-asciidoc5", range="startofrange")))To be able to upgrade messages in a manner that is both forward and backward compatible, in addition to feature bits (more on that later), the Lightning Network utilizes a custom message serialization format plainly called Type-Length-Value, or TLV for short. The format was inspired by the widely used Protobuf @@ -167,7 +167,7 @@ implementation of the TLV message format weighs in at only 2.3k lines of code With the necessary background presented, we're now ready to describe the TLV format in detail. A TLV message extension is said to be a stream of -individual TLV records. A single TLV record has three components: the type of +individual pass:[TLV records]. A single TLV record has three components: the type of the record, the length of the record, and finally the opaque value of the record: