-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from axiom-crypto/release/2.0.0
Axiom V2 Release
- Loading branch information
Showing
437 changed files
with
41,846 additions
and
16,705 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Lints | ||
|
||
on: | ||
push: | ||
branches: ["main", "develop"] | ||
pull_request: | ||
branches: ["main", "develop"] | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
override: false | ||
components: rustfmt, clippy | ||
|
||
- uses: Swatinem/rust-cache@v1 | ||
with: | ||
cache-on-failure: true | ||
|
||
- name: Run fmt | ||
run: | | ||
export AXIOM_SKIP_CONSTANT_GEN=1 | ||
cargo fmt --all -- --check | ||
- name: Run clippy | ||
run: cargo clippy --all -- -D warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
# axiom-eth | ||
# Axiom ZK Circuits | ||
|
||
This repository builds on [halo2-lib](https://github.com/axiom-crypto/halo2-lib/releases/tag/v0.3.0) and [snark-verifier](https://github.com/axiom-crypto/snark-verifier/tree/v0.1.1) to create a library of zero-knowledge proof circuits that [Axiom](https://axiom.xyz) uses to read data from the Ethereum virtual machine (EVM). | ||
This repository builds on [halo2-lib](https://github.com/axiom-crypto/halo2-lib/tree/main) and [snark-verifier](https://github.com/axiom-crypto/snark-verifier/) to create a library of zero-knowledge proof circuits that [Axiom](https://axiom.xyz) uses to read data from the Ethereum virtual machine (EVM). | ||
|
||
This monorepo consists of multiple crates: | ||
|
||
## `axiom-eth` | ||
|
||
This is the main library of chips and frameworks for building ZK circuits that prove data from the Ethereum virtual machine (EVM). For more details, see the [README](./axiom-eth/README.md). | ||
|
||
## `axiom-core` | ||
|
||
This contains the ZK circuits that generate proofs for the `AxiomV2Core` smart contract. These circuits read the RLP encoded block headers for a chain of blocks and verify that the block headers form a chain. They output a Merkle Mountain Range of the block hashes of the chain. This crate also contains aggregation circuits to aggregate multiple circuits for the purpose of proving longer chains. For more details, see the [README](./axiom-core/README.md). | ||
|
||
## `axiom-query` | ||
|
||
This contains the ZK circuits that generate proofs for the `AxiomV2Query` smart contract. For more details, see the [README](./axiom-query/README.md). | ||
|
||
### `axiom-codec` | ||
|
||
This crate does not contain any ZK circuits, but it contains Rust types for Axiom queries and specifies how to encode/decode them to field elements for in-circuit use. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[package] | ||
name = "axiom-codec" | ||
version = "0.2.0" | ||
authors = ["Intrinsic Technologies"] | ||
license = "MIT" | ||
edition = "2021" | ||
repository = "https://github.com/axiom-crypto/axiom-eth" | ||
readme = "README.md" | ||
description = "This crate contains Rust types for Axiom queries and specifies how to encode/decode them to field elements for in-circuit use." | ||
rust-version = "1.73.0" | ||
|
||
[dependencies] | ||
byteorder = { version = "1.4.3" } | ||
serde = { version = "1.0", default-features = false, features = ["derive"] } | ||
serde_json = { version = "1.0", default-features = false } | ||
serde_repr = "0.1" | ||
base64 = { version = "0.21", optional = true } | ||
serde_with = { version = "2.2", optional = true } | ||
anyhow = "1.0" | ||
|
||
# halo2, features turned on by axiom-eth | ||
axiom-eth = { version = "=0.4.0", path = "../axiom-eth", default-features = false } | ||
|
||
# ethereum | ||
ethers-core = { version = "2.0.10" } | ||
|
||
[dev-dependencies] | ||
hex = "0.4.3" | ||
|
||
[build-dependencies] | ||
serde_json = "1.0" | ||
serde = { version = "1.0", features = ["derive"] } | ||
|
||
[features] | ||
default = ["halo2-axiom"] | ||
# halo2-pse = ["axiom-eth/halo2-pse"] | ||
halo2-axiom = ["axiom-eth/halo2-axiom"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pub const ENCODED_K_BYTES: usize = 1; | ||
pub const ENCODED_VKEY_LENGTH_BYTES: usize = 1; | ||
pub const FIELD_IDX_BITS: usize = 32; | ||
pub const FIELD_IDX_BYTES: usize = 4; | ||
pub const MAX_SOLIDITY_MAPPING_KEYS: usize = 4; | ||
pub const MAX_SUBQUERY_INPUTS: usize = 13; | ||
pub const MAX_SUBQUERY_OUTPUTS: usize = 2; | ||
pub const NUM_SUBQUERY_TYPES: usize = 7; | ||
pub const SOURCE_CHAIN_ID_BYTES: usize = 8; | ||
pub const SUBQUERY_TYPE_BYTES: usize = 2; | ||
pub const USER_ADVICE_COLS: usize = 4; | ||
pub const USER_FIXED_COLS: usize = 1; | ||
pub const USER_INSTANCE_COLS: usize = 1; | ||
pub const USER_LOOKUP_ADVICE_COLS: usize = 1; | ||
pub const USER_MAX_OUTPUTS: usize = 128; | ||
pub const USER_MAX_SUBQUERIES: usize = 128; | ||
pub const USER_PROOF_LEN_BYTES: usize = 4; | ||
pub const USER_RESULT_BYTES: usize = 32; | ||
pub const USER_RESULT_FIELD_ELEMENTS: usize = 2; | ||
pub const USER_RESULT_LEN_BYTES: usize = 2; |
Oops, something went wrong.