Skip to content

Commit

Permalink
Release v0.15.0 (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
feltroidprime authored Dec 9, 2024
1 parent 245c09f commit cc76cc3
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 165 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ Garaga currently supports:
- Scalar & Multi-scalar multiplication for any Weirstrass curve, including BN254, BLS12_381, SECP256/R1, and ED25519. You can add the one you need by specifying the curve parameters.
- Pairing operations for BN254 and BLS12_381.
- Groth16 smart contract verifiers generators for BN254 and BLS12_381.

Following supported schemes will be
- BLS signatures contract generators.
- Plonk based SNARKs verifier, especially Noir.
- Noir smart contract verifiers generators for ultra keccak honk flavour.


## Architecture overview
Expand All @@ -62,9 +59,9 @@ Currently, only Groth16 on BN254 and BLS12_381 is supported with automatic suppo
6. Run the `garaga declare` command in your terminal to declare the smart contract on Starknet and obtain its class hash. Note that this is an expensive operation.
7. Run the `garaga deploy` command in your terminal using the class hash obtained in the previous step to get the contract address.

7. Run the `garaga verify-onchain` command in your terminal using the contract address, the verification key, the proof and the public inputs to verify the proof against the SNARK verifier contract.
8. Run the `garaga verify-onchain` command in your terminal using the contract address, the verification key, the proof and the public inputs to verify the proof against the SNARK verifier contract.

For more details, please refer to the [documentation](https://felt.gitbook.io/garaga/).
For more details, please refer to the [documentation](https://garaga.gitbook.io/garaga/).

## Developer setup

Expand Down
32 changes: 16 additions & 16 deletions hydra/garaga/precompiled_circuits/honk.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def split_challenge(ch: bytes) -> tuple[int, int]:
hasher.update(int.to_bytes(pub_input, 32, "big"))

for g1_proof_point in [proof.w1, proof.w2, proof.w3]:
print(f"g1_proof_point: {g1_proof_point.__repr__()}")
# print(f"g1_proof_point: {g1_proof_point.__repr__()}")
x0, x1, y0, y1 = g1_to_g1_proof_point(g1_proof_point)
hasher.update(int.to_bytes(x0, 32, "big"))
hasher.update(int.to_bytes(x1, 32, "big"))
Expand All @@ -515,9 +515,9 @@ def split_challenge(ch: bytes) -> tuple[int, int]:
ch0 = hasher.digest_reset()
eta_three, _ = split_challenge(ch0)

print(f"eta: {hex(eta)}")
print(f"eta_two: {hex(eta_two)}")
print(f"eta_three: {hex(eta_three)}")
# print(f"eta: {hex(eta)}")
# print(f"eta_two: {hex(eta_two)}")
# print(f"eta_three: {hex(eta_three)}")
# Round 1 : ch0, lookup_read_counts, lookup_read_tags, w4

hasher.update(ch0)
Expand Down Expand Up @@ -570,16 +570,16 @@ def split_challenge(ch: bytes) -> tuple[int, int]:
ch3 = hasher.digest_reset()
gate_challenges[i], _ = split_challenge(ch3)

print(f"gate_challenges: {[hex(x) for x in gate_challenges]}")
print(f"len(gate_challenges): {len(gate_challenges)}")
# print(f"gate_challenges: {[hex(x) for x in gate_challenges]}")
# print(f"len(gate_challenges): {len(gate_challenges)}")
# Round 4: Sumcheck u challenges
ch4 = ch3
sum_check_u_challenges = [None] * CONST_PROOF_SIZE_LOG_N

print(f"len(sumcheck_univariates): {len(proof.sumcheck_univariates)}")
print(
f"len(proof.sumcheck_univariates[0]): {len(proof.sumcheck_univariates[0])}"
)
# print(f"len(sumcheck_univariates): {len(proof.sumcheck_univariates)}")
# print(
# f"len(proof.sumcheck_univariates[0]): {len(proof.sumcheck_univariates[0])}"
# )

for i in range(CONST_PROOF_SIZE_LOG_N):
# Create array of univariate challenges starting with previous challenge
Expand All @@ -601,8 +601,8 @@ def split_challenge(ch: bytes) -> tuple[int, int]:
# Split challenge to get sumcheck challenge
sum_check_u_challenges[i], _ = split_challenge(ch4)

print(f"sum_check_u_challenges: {[hex(x) for x in sum_check_u_challenges]}")
print(f"len(sum_check_u_challenges): {len(sum_check_u_challenges)}")
# print(f"sum_check_u_challenges: {[hex(x) for x in sum_check_u_challenges]}")
# print(f"len(sum_check_u_challenges): {len(sum_check_u_challenges)}")

# Rho challenge :
hasher.update(ch4)
Expand All @@ -612,7 +612,7 @@ def split_challenge(ch: bytes) -> tuple[int, int]:
c5 = hasher.digest_reset()
rho, _ = split_challenge(c5)

print(f"rho: {hex(rho)}")
# print(f"rho: {hex(rho)}")

# Gemini R :
hasher.update(c5)
Expand All @@ -626,7 +626,7 @@ def split_challenge(ch: bytes) -> tuple[int, int]:
c6 = hasher.digest_reset()
gemini_r, _ = split_challenge(c6)

print(f"gemini_r: {hex(gemini_r)}")
# print(f"gemini_r: {hex(gemini_r)}")

# Shplonk Nu :
hasher.update(c6)
Expand All @@ -636,7 +636,7 @@ def split_challenge(ch: bytes) -> tuple[int, int]:
c7 = hasher.digest_reset()
shplonk_nu, _ = split_challenge(c7)

print(f"shplonk_nu: {hex(shplonk_nu)}")
# print(f"shplonk_nu: {hex(shplonk_nu)}")

# Shplonk Z :
hasher.update(c7)
Expand All @@ -649,7 +649,7 @@ def split_challenge(ch: bytes) -> tuple[int, int]:
c8 = hasher.digest_reset()
shplonk_z, _ = split_challenge(c8)

print(f"shplonk_z: {hex(shplonk_z)}")
# print(f"shplonk_z: {hex(shplonk_z)}")

return cls(
eta=eta,
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ build-backend = "maturin"

[project]
name = "garaga"
version = "0.14.0"
version = "0.15.0"
requires-python = ">=3.10,<3.11"
dependencies = [
"fastecdsa",
"sympy",
"typer",
"python-dotenv",
"pysha3",
"starknet-py==0.24.2"
"starknet-py==0.24.3",
"requests",
]
description = "State-of-the-art Elliptic Curve operations and SNARKS verification for Cairo & Starknet 🐺."

Expand Down
2 changes: 1 addition & 1 deletion tools/garaga_rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/garaga_rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "garaga_rs"
version = "0.14.0"
version = "0.15.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
136 changes: 0 additions & 136 deletions tools/noir/parse_vk.py

This file was deleted.

2 changes: 1 addition & 1 deletion tools/npm/garaga_ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "garaga",
"version": "0.14.0",
"version": "0.15.0",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion tools/npm/garaga_ts/src/wasm/pkg/garaga_rs_bg.wasm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tools/npm/garaga_ts/src/wasm/pkg/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "garaga_rs",
"type": "module",
"version": "0.14.0",
"version": "0.15.0",
"files": [
"garaga_rs_bg.wasm",
"garaga_rs.js",
Expand Down

0 comments on commit cc76cc3

Please sign in to comment.