Skip to content

Commit

Permalink
Add RowID, ColumnID custom types in crypto doc
Browse files Browse the repository at this point in the history
  • Loading branch information
hwwhww committed Jan 19, 2024
1 parent 2cc7c87 commit 6463c09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 3 additions & 5 deletions specs/_features/eip7594/das-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ We define the following Python custom types for type hinting and readability:
| `DataColumn` | `List[Cell, MAX_BLOBS_PER_BLOCK]` | The data of each column in EIP7594 |
| `ExtendedMatrix` | `List[Cell, MAX_BLOBS_PER_BLOCK * NUMBER_OF_COLUMNS]` | The full data with blobs and one-dimensional erasure coding extension |
| `FlatExtendedMatrix` | `List[BLSFieldElement, MAX_BLOBS_PER_BLOCK * FIELD_ELEMENTS_PER_BLOB * NUMBER_OF_COLUMNS]` | The flattened format of `ExtendedMatrix` |
| `LineIndex` | `uint64` | The index of the rows or columns in `FlatExtendedMatrix` matrix |

## Configuration

Expand All @@ -68,11 +67,10 @@ We define the following Python custom types for type hinting and readability:
#### `get_custody_lines`

```python
def get_custody_lines(node_id: NodeID, custody_size: uint64) -> Sequence[LineIndex]:
def get_custody_lines(node_id: NodeID, custody_size: uint64) -> Sequence[ColumnID]:
assert custody_size <= NUMBER_OF_COLUMNS
all_items = list(range(NUMBER_OF_COLUMNS))
line_index = node_id % NUMBER_OF_COLUMNS
return [LineIndex(all_items[(line_index + i) % len(all_items)]) for i in range(custody_size)]
column_index = node_id % NUMBER_OF_COLUMNS
return [ColumnID((column_index + i) % NUMBER_OF_COLUMNS) for i in range(custody_size)]
```

#### `compute_extended_data`
Expand Down
6 changes: 4 additions & 2 deletions specs/_features/eip7594/polynomial-commitments-sampling.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Public functions MUST accept raw bytes as input and perform the required cryptog
| `PolynomialCoeff` | `List[BLSFieldElement, 2 * FIELD_ELEMENTS_PER_BLOB]` | A polynomial in coefficient form |
| `Cell` | `Vector[BLSFieldElement, FIELD_ELEMENTS_PER_CELL]` | The unit of blob data that can come with their own KZG proofs |
| `CellID` | `uint64` | Cell identifier |
| `RowID` | `uint64` | Row identifier |
| `ColumnID` | `uint64` | Column identifier |

## Constants

Expand Down Expand Up @@ -415,8 +417,8 @@ def verify_cell_proof(commitment: KZGCommitment,

```python
def verify_cell_proof_batch(row_commitments: Sequence[KZGCommitment],
row_ids: Sequence[int],
column_ids: Sequence[int],
row_ids: Sequence[RowID],
column_ids: Sequence[ColumnID],
cells: Sequence[Cell],
proofs: Sequence[KZGProof]) -> bool:
"""
Expand Down

0 comments on commit 6463c09

Please sign in to comment.