BOLT-8 Edits#311
Conversation
More clarity and copyediting. I also removed quite a few `s that didn't seem to match general usage for "code".
| the responder. This provides a degree of identity hiding for the | ||
| responder, as its public key is _never_ transmitted during the handshake. Instead, | ||
| authentication is achieved implicitly via a series of Elliptic-Curve | ||
| Diffie-Hellman (ECDH) operations followed by a MAC check. |
There was a problem hiding this comment.
The term "pre-message" is taken from the Noise spec, https://noiseprotocol.org/noise.html#handshake-patterns.
There was a problem hiding this comment.
Changed back to "As a pre-message" (and it reads better now with the changes to the rest of the sentence).
| The initiator should produce the given output when fed this input. | ||
| The comments reflect internal state for debugging. | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Technically indentation serves the same purpose as triple-quote in markdown, but there's nothing wrong with both AFAICT.
rustyrussell
left a comment
There was a problem hiding this comment.
Nice, much more consistent with rest of spec formatting (@Roasbeef wrote this really early on when we were still shaking that stuff loose).
| encryption keys (`ck` the chaining key and `k` the encryption key), and finally | ||
| an `AEAD` payload with a zero length cipher text is sent. As this payload is | ||
| of length zero, only a `MAC` is sent across. The mixing of `ECDH` outputs into | ||
| steps. During each "act" of the handshake: some (possibly encrypted) keying |
There was a problem hiding this comment.
original comma was correct, as the first clause is a prepositional phrase, not a complete sentence
There was a problem hiding this comment.
I prefer the clarity of leading off semi-colon separated lists with a colon, so I've changed the first clause into a sentence to allow this.
| which act is being executed, with the result mixed into the current set of | ||
| encryption keys (`ck` the chaining key and `k` the encryption key); and | ||
| an AEAD payload with a zero-length cipher text is sent. As this payload is | ||
| length zero, only a MAC is sent across. The mixing of ECDH outputs into |
There was a problem hiding this comment.
...payload has no length, only...
There was a problem hiding this comment.
Better sounding. Changed.
| new ephemeral key with strong cryptographic randomness. | ||
|
|
||
| * `s`: A party's **static public key** (`ls` for local, `rs` for remote) | ||
| * `s`: A party's **static public key** (`ls` for local, `rs` for remote). |
There was a problem hiding this comment.
stylesheet rule is to only use periods at end of list items if they are complete sentences, so original is consistent with stylesheet
There was a problem hiding this comment.
Thanks; must have intended that for the previous item!
| * where `m[0]` is the _first_ byte of `m`, `m[1:33]` are the next `33` | ||
| bytes of `m` and `m[34:]` is the last 16 bytes of `m` | ||
| * Read _exactly_ 50 bytes from the network buffer. | ||
| * Parse out the read message (`m`) into `v = m[0]`, `re = m[1:33]` and `c = m[34:]`. |
There was a problem hiding this comment.
...re = m[1:33], and...
|
|
||
| the responder | ||
| * The final encryption keys to be used for sending and | ||
| receiving messages for the duration of the session are generated. |
There was a problem hiding this comment.
the final...generated
There was a problem hiding this comment.
It's a complete sentence, not in a requirements list, so it should be capitalized and have a period, yes?
There was a problem hiding this comment.
Oops, sorry you're right.
There was a problem hiding this comment.
Great! I was momentarily confused!
| * Read _exactly_ `66-bytes` from the network buffer. | ||
|
|
||
|
|
||
| * Read _exactly_ 66-bytes from the network buffer. |
|
|
||
| the initiator | ||
| * The final encryption keys to be used for sending and | ||
| receiving messages for the duration of the session are generated |
There was a problem hiding this comment.
period is appropriate here
| * let `l = len(m)` | ||
| * where `len` obtains the length in bytes of the Lightning message | ||
| * Serialize `l` into 2 bytes encoded as a big-endian integer. | ||
| * Encrypt `l` using `ChaChaPoly-1305`, `sn`, and `sk`, to obtain `lc` |
There was a problem hiding this comment.
...1 (using...sk), to...
There was a problem hiding this comment.
Changed three instances of this.
|
|
||
|
|
||
| * Decrypt `c` using `ChaCha20-Poly1305`, `rn`, and `rk` to obtain decrypted | ||
| * Decrypt `c` using `ChaCha20-Poly1305`, `rn`, and `rk`, to obtain decrypted |
There was a problem hiding this comment.
...obtain the decrypted
There was a problem hiding this comment.
Changed three instances of this.
| Changing keys regularly and forgetting the previous key is useful for | ||
| preventing decryption of old messages in the case of later key leakage (ie. | ||
| Changing keys regularly and forgetting previous keys is useful to | ||
| prevent the decryption of old messages in the case of later key leakage (i.e. |
(1) addressed review items from @rustyrussell and @toadlyBroodle ; and (2) added table of contents courtesy of @bcongdon in #310
Added fix for duplicate word courtesy of @dimitris-t in #306.
| new ephemeral key with strong cryptographic randomness. | ||
|
|
||
| * `s`: A party's **static public key** (`ls` for local, `rs` for remote). | ||
| * `s`: A party's **static public key** (`ls` for local, `rs` for remote) |
More clarity and copyediting. I also removed quite a few `s that didn't seem to match general usage for "code".