In Nomos DA v2, we currently have two viable options for securely performing data encoding, particularly when addressing small data sets (less than 1 MB).
Scenario 1: Variable Matrix Sizes
In this scenario, for datasets larger than 1 MB, we use a 1024x1024 matrix. However, for datasets smaller than 1 MB, smaller matrix sizes are necessary to satisfy the subspace distance check. For comparison, we assume a 256x256 matrix for small data.
In the existing Nomos DA v1, the protocol operates over 2048 subnetworks. Adhering to this constraint, we propose the following design:
- For large data:
- Validators within each subnet are responsible for specific rows and columns.
- Initially, validators must download 17 rows and 1 column to verify the encoding.
- Although validators store these rows, when light clients request samples, validators primarily provide the row and column assigned to them.
- For small data:
- After encoding, data is replicated fourfold and distributed across subnetworks.
- Subnetworks are first divided into 4 groups, each receiving the replicated data.
- Validators in each subnet still handle specific rows and columns similarly.
- When performing sampling, light clients first select a group and then the relevant rows and columns.
Scenario 2: Using Field Extension
Alternatively, by employing field extension, a consistent 1024x1024 matrix can be used for all data sizes, both below and above 1 MB:
- For datasets ≤ 1 MB, the column size is expanded using field extension.
- For datasets > 1 MB, the original method from Scenario 1 applies without field extension.
The main disadvantage of this scenario is the limitation to row-wise reconstruction only. However, this scenario reduces the total data per subnetwork, benefiting from the uniform 1024x1024 matrix size.
Below is a comparative analysis of the total data per subnetwork for both scenarios:
Scenario 1 (Variable Matrix Sizes)
- 256x256 Matrix:
- 128 KB → 27.56 KB per subnet
- 256 KB → 50.56 KB per subnet
- 512 KB → 96.56 KB per subnet
- 1 MB → 188.56 KB per subnet
- 1024x1024 Matrix:
- 8 MB → 418.69 KB per subnet
- 16 MB → 830.69 KB per subnet
- 32 MB → 1654.69 KB per subnet
Scenario 2 (Field Extension, 1024x1024 Matrix)
- 128 KB → 21.94 KB per subnet
- 256 KB → 28.19 KB per subnet
- 512 KB → 40.69 KB per subnet
- 1 MB → 63.69 KB per subnet