Skip to content

Commit

Permalink
Improve definition of channel encoding (#444)
Browse files Browse the repository at this point in the history
* make channel encoding algorithm clearer

* tweak

* tweak

* break line
  • Loading branch information
geoknee authored Oct 28, 2024
1 parent 0a021dd commit 0600bda
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions specs/protocol/derivation.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,15 +368,18 @@ where:
A channel is encoded by applying a streaming compression algorithm to a list of batches:

```text
rlp_batches = []
encoded_batches = []
for batch in batches:
rlp_batches.append(batch)
encoded_batches ++ batch.encode()
rlp_batches = rlp_encode(encoded_batches)
```

where:

- `batches` is the input, a sequence of batches byte-encoded as per the next section ("Batch Encoding")
- `rlp_batches` is the concatenation of the RLP-encoded batches
- `batches` is the input, a sequence of batches each with a byte-encoder
function `.encode()` as per the next section ("Batch Encoding")
- `encoded_batches` is a byte array: the concatenation of the encoded batches
- `rlp_batches` is the rlp encoding of the concatenated encoded batches

```text
channel_encoding = zlib_compress(rlp_batches)
Expand Down

0 comments on commit 0600bda

Please sign in to comment.