From b6bda4cc22f1bcf3eb4e5b34d5db167191101976 Mon Sep 17 00:00:00 2001 From: Justin Traglia <95511699+jtraglia@users.noreply.github.com> Date: Fri, 29 Mar 2024 06:08:40 -0500 Subject: [PATCH] docs: link to point evaluation documentation (#1241) --- documentation/src/crates/precompile.md | 3 ++- documentation/src/crates/precompile/point_evaluation.md | 5 ++--- documentation/src/crates/precompile/secp256k1.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/src/crates/precompile.md b/documentation/src/crates/precompile.md index e4f82c73ae..643ba75942 100644 --- a/documentation/src/crates/precompile.md +++ b/documentation/src/crates/precompile.md @@ -11,6 +11,7 @@ There are 6 precompiles implemented in REVM, and they are: `blake2`, `bn128` cur - [bn128](./precompile/bn128.md): Implements precompiled contracts for addition, scalar multiplication, and optimal ate pairing check on the `alt_bn128` elliptic curve. - [hash](./precompile/hash.md): Implements the `SHA256` and `RIPEMD160` hash functions. - [identity](./precompile/identity.md): Implements the `Identity` precompile, which returns the input data unchanged. +- [point_evaluation](./precompile/point_evaluation.md): Implements the point evaluation precompile for [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844). - [modexp](./precompile/modexp.md): Implements the big integer modular exponentiation precompile. - [secp256k1](./precompile/secp256k1.md): Implements the ECDSA public key recovery precompile, based on `secp256k1` curves. @@ -42,5 +43,5 @@ There are 6 precompiles implemented in REVM, and they are: `blake2`, `bn128` cur ### Re-exported Functionality: -- `Precompiles` provides a static method for each Ethereum hard fork specification (e.g., `homestead`, `byzantium`, `istanbul`, `berlin`, and `latest`), each returning a set of precompiles for that specification. +- `Precompiles` provides a static method for each Ethereum hard fork specification (e.g., `homestead`, `byzantium`, `istanbul`, `berlin`, `cancun`, and `latest`), each returning a set of precompiles for that specification. - `Precompiles` also provides methods to retrieve the list of precompile addresses (`addresses`), to check if a given address is a precompile (`contains`), to get the precompile at a given address (`get`), to check if there are no precompiles (`is_empty`), and to get the number of precompiles (`len`). diff --git a/documentation/src/crates/precompile/point_evaluation.md b/documentation/src/crates/precompile/point_evaluation.md index 9356a89a9f..df982cfe43 100644 --- a/documentation/src/crates/precompile/point_evaluation.md +++ b/documentation/src/crates/precompile/point_evaluation.md @@ -1,6 +1,5 @@ # Point Evaluation Precompile -This precompile is introduced in [EIP4844](https://eips.ethereum.org/EIPS/eip-4844) and is used to verify KZG commitments of blobspace. The precompile allows for efficient verification of commitments to blog transactions. The blob-space transaction contains a large amount of data that cannot be accessed by EVM execution, but has a commitment that can be accessed and verified. The EIP is designed to be forward compatible with danksharding architecture while giving L2s access to cheaper L1 commitments. This precompiled contract resides at the hardcoded Ethereum address `0x000000000000000000000000000000000000000A`. +This precompile is introduced in [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) and is used to verify KZG commitments of blobs. The precompile allows for efficient verification of commitments to blob transactions. Blob transactions contain a large amount of data that cannot be accessed by EVM execution, but has a commitment that can be accessed and verified. The EIP is designed to be forward compatible with [Danksharding](https://ethereum.org/en/roadmap/danksharding/) architecture while giving L2s access to cheaper L1 commitments. This precompiled contract resides at the hardcoded Ethereum address `0x000000000000000000000000000000000000000A`. - -A useful resource is the python reference implementation for the precompile, which can be found [here](https://github.com/ethereum/consensus-specs/blob/86fb82b221474cc89387fa6436806507b3849d88/specs/deneb/polynomial-commitments.md). This implementation uses the [c-kzg](https://github.com/ethereum/c-kzg-4844) audited foreign function interface bindings from the Ethereum Foundation. \ No newline at end of file +A useful resource is the Python reference implementation for the precompile, which can be found [here](https://github.com/ethereum/consensus-specs/blob/86fb82b221474cc89387fa6436806507b3849d88/specs/deneb/polynomial-commitments.md). The implementation in REVM uses [c-kzg-4844](https://github.com/ethereum/c-kzg-4844), via its [foreign function interface](https://en.wikipedia.org/wiki/Foreign_function_interface) bindings, from the Ethereum Foundation. \ No newline at end of file diff --git a/documentation/src/crates/precompile/secp256k1.md b/documentation/src/crates/precompile/secp256k1.md index 757fa577a1..4146448c1e 100644 --- a/documentation/src/crates/precompile/secp256k1.md +++ b/documentation/src/crates/precompile/secp256k1.md @@ -1,6 +1,6 @@ # Secp256k1 -This implementation Ethereum's precompiled contract `ECRECOVER`, an elliptic curve digital signature algorithm (ECDSA) recovery function that recovers the Ethereum address (public key hash) associated with a given signature. The implementation features two versions, each contingent on whether the secp256k1 cryptographic library is enabled, which depends on the build configuration. +This implements Ethereum's precompiled contract `ECRECOVER`, an elliptic curve digital signature algorithm (ECDSA) recovery function that recovers the Ethereum address (public key hash) associated with a given signature. The implementation features two versions, each contingent on whether the secp256k1 cryptographic library is enabled, which depends on the build configuration. Both versions define a `secp256k1` module that includes an `ecrecover` function. This function takes a digital signature and a message as input, both represented as byte arrays, and returns the recovered Ethereum address. It performs this operation by using the signature to recover the original public key used for signing, then hashing this public key with `Keccak256`, Ethereum's chosen hash function. The hash is then truncated to match Ethereum's 20-byte address size.