Skip to content

Commit e7363d7

Browse files
docs(primitives): kzg intro (bluealloy#1209)
* docs: primitive * docs: KZG primitive * fixed mistake * fixed lint error * fixed book test * refactor: coinbase to beneficiary * mod: workspace test * Revert "refactor: coinbase to beneficiary" This reverts commit dc89385. * Revert "fixed book test" This reverts commit 47062f0. * revert beneficiary to conbase * mod: resolved comment * fixed typo * del .DS_store * del .DS_store * del .DS_store * mod: update .gitginore
1 parent 61f8771 commit e7363d7

File tree

6 files changed

+20
-4
lines changed

6 files changed

+20
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/target/
22
**/*.rs.bk
3+
**/.DS_Store
34

45
target
56
.vscode

crates/revm/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use std::boxed::Box;
1717

1818
/// Main Context structure that contains both EvmContext and External context.
1919
pub struct Context<EXT, DB: Database> {
20-
/// Evm Context.
20+
/// Evm Context (internal context).
2121
pub evm: EvmContext<DB>,
2222
/// External contexts.
2323
pub external: EXT,

crates/revm/src/evm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub const CALL_STACK_LIMIT: u64 = 1024;
2525
pub struct Evm<'a, EXT, DB: Database> {
2626
/// Context of execution, containing both EVM and external context.
2727
pub context: Context<EXT, DB>,
28-
/// Handler of EVM that contains all the logic. Handler contains specification id
28+
/// Handler is a component of the of EVM that contains all the logic. Handler contains specification id
2929
/// and it different depending on the specified fork.
3030
pub handler: Handler<'a, Self, EXT, DB>,
3131
}

documentation/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- [precompile](./crates/primitives/precompile.md)
2828
- [state](./crates/primitives/state.md)
2929
- [utils](./crates/primitives/utils.md)
30+
- [kzg](./crates/primitives/kzg.md)
3031
- [Precompile](./crates/precompile.md)
3132
- [blake2](./crates/precompile/blake2.md)
3233
- [bn128 curve](./crates/precompile/bn128.md)

documentation/src/crates/primitives.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ It is set up to be compatible with environments that do not include Rust's stand
1717
- [specification](./primitives/specifications.md): This module defines types related to Ethereum specifications (also known as hard forks).
1818
- [state](./primitives/state.md): This module provides types and functions for managing Ethereum state, including accounts and storage.
1919
- [utilities](./primitives/utils.md): This module provides utility functions used in multiple places across the EVM implementation.
20+
- [kzg](./primitives/kzg.md): This module provides types and functions related to KZG commitment, it is empolyed visibly in the Point Evalution Precompile.
2021

2122
### External Crates:
2223

@@ -27,6 +28,7 @@ It is set up to be compatible with environments that do not include Rust's stand
2728
- `hex_literal`: The hex_literal crate provides a macro for including hexadecimal data directly in the source code.
2829
- `hashbrown`: The hashbrown crate provides high-performance hash map and hash set data structures.
2930
- `ruint`: The ruint crate provides types and functions for big unsigned integer arithmetic.
31+
- `c-kzg`: A minimal implementation of the Polynomial Commitments API for EIP-4844, written in C. (With rust bindings)
3032

3133
### Type Aliases:
3234

@@ -40,5 +42,5 @@ It is set up to be compatible with environments that do not include Rust's stand
4042
- `U256`: A 256-bit unsigned integer type from the `ruint` crate.
4143
- `HashMap` and `HashSet`: High-performance hash map and hash set data structures from the hashbrown crate.
4244

43-
### Re-exported Modules:
44-
All types, constants, and functions from the `bytecode`, `constants`, `env`, `log`, `precompile`, `result`, `specification`, `state`, and `utilities` modules are re-exported, allowing users to import these items directly from the `primitives` crate.
45+
Re-exported Modules:
46+
All types, constants, and functions from the `bytecode`, `constants`, `env`, `log`, `precompile`, `result`, `specification`, `state`, `utilities`, `KzgSettings`, `EnvKzgSettings`, `trusted_setup_points` types and methods were all re-exported, allowing users to import these items directly from the `primitives` crate.
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# KZG
2+
3+
With the introduction of [EIP4844](https://eips.ethereum.org/EIPS/eip-4844), this use of blobs for a more efficent short term storage is employed, the validity of this blob stored in the consensus layer is verified using the `Point Evaluation` pre-compile, a fancy way of verifing that and evaluation at a given point of a commited polynomial is vaild, in a much more bigger scale, implies that `Data is Available`.
4+
5+
This module houses;
6+
7+
1. `KzgSettings`: Stores the setup and parameters needed for computing and verify KZG proofs.
8+
9+
The `KZG` premitive provides a default `KZGSettings` obtained from [this]( https://ceremony.ethereum.org/) trusted setup ceremony, a provision is also made for using a custom `KZGSettings` if need be, this is available in the `env.cfg`.
10+
11+
12+
2. `trusted_setup_points`: This module contains functions and types used for parsing and utilizing the [Trusted Setup]( https://ceremony.ethereum.org/) for the `KzgSettings`.

0 commit comments

Comments
 (0)