# ELI5 what are erasure codes?

Reading this article, I understand that erasure codes are a potential solution to the data availability issue in sharding. That is, a light node can have higher certainty regarding the contents of a block when erasure codes are used.

However, I couldn't find a straightforward explanation of the concept. Can someone shed some light on it?

ELI5:

• You have 2 numbers, X and Y, each in an envelope.
• In a 3rd envelope, you store X+Y.
• This 3rd envelope can be considered the erasure code.
• You will always be able to compute X and Y by only losing 1 envelope.
• The concept: to avoid losing data, you store additional data in a smart way. (In the example above, it would not help if the 3rd envelope stored X, because losing both envelopes that had X, will mean that X is lost forever.)

The source of the above example has a more interesting case. The data is X, Y, Z, W. The erasure code of X+Y+Z+W and X+2Y+4Z+8W allows the 4 pieces of data to be recovered if any 2 pieces are lost.

Related non-ELI5:

http://web.archive.org/web/20190620141650/https://github.com/ethereum/research/wiki/A-note-on-data-availability-and-erasure-coding

https://arxiv.org/abs/1809.09044