diff --git a/p2p/shred.md b/p2p/shred.md index d65f0b9..d515a53 100644 --- a/p2p/shred.md +++ b/p2p/shred.md @@ -312,7 +312,8 @@ When using Merkle authentication, the interpretation of "data shred" used for erasure coding begins immediately after the signature field and ends immediately before the Merkle proof section. -Let $x_{i,b}$ be the $b$-th byte of the $i$-th data shred of the FEC set (numbered $0, 1, \ldots, N-1$) interpreted as an element of the finite field $GF(2^8)$ (i.e. $\mathbb{F}_2[\gamma] / (\gamma^8 + \gamma^4 + \gamma^3 + \gamma^2 + 1)$). +Let $x_{i,b}$ be the $b$-th byte of the $i$-th data shred of the FEC set (numbered $0, 1, \ldots, N-1$) interpreted as an element of the finite field $GF(2^8)$ (i.e. + $\mathbb{F}_2[\gamma] / (\gamma^8 + \gamma^4 + \gamma^3 + \gamma^2 + 1)$ Taking one $b$ at a time, define the polynomial $P_b(x)$ of order less than $N$ such that $P_b(i) = x_i$ for all $0\le i < N$ (interpreting the byte value of $i$ as an element of $GF(2^8)$). This polynomial is unique. @@ -322,7 +323,8 @@ More precisely, let $y_{j,b}$ be the $b$-th byte of the $j$-th code shred for $0 Then $y_{j,b} = P_b(N+j)$, where $N+j$ is computed as an integer and then interpreted as an element of $GF(2^8)$. Equivalently, this is a linear operation, so it can also be described as a matrix-vector product over $GF(2^8)$: -$$ M \left( \begin{array}{c} +$$ +M \left( \begin{array}{c} x_{0,b} \\ x_{1,b} \\ \vdots \\ @@ -330,7 +332,11 @@ x_{N-1,b} \end{array} \right) = \left( \begin{array}{c} y_{0,b} \\ y_{1,b} \\ \vdots \\ -y_{K-1,b} \end{array} \right).$$ +y_{K-1,b} \end{array} \right) +$$ +![image](https://github.com/solana-foundation/specs/assets/88841339/88db191a-8e0d-400e-88bc-f8b2ff2c3644) + + The matrix $M$ depends only on $N$ and $K$. There are various ways to compute $M$, but one description is