-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc43d72
commit 812d0aa
Showing
10 changed files
with
118 additions
and
58 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
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,15 @@ | ||
[package] | ||
name = "cairo-platinum-prover-cli" | ||
version.workspace = true | ||
edition.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
|
||
[[bin]] | ||
name = "cairo-platinum-prover-cli" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
lambdaworks-math = { workspace = true , features = ["lambdaworks-serde"] } | ||
stark-platinum-prover = { workspace = true, features = ["wasm"] } | ||
cairo-platinum-prover = { workspace = true} |
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,22 @@ | ||
.PHONY: test coverage clippy clean | ||
|
||
build: | ||
cargo build --release | ||
|
||
prove: build | ||
cargo run --release prove $(PROGRAM_PATH) $(PROOF_PATH) | ||
|
||
verify: build | ||
cargo run --release verify $(PROOF_PATH) | ||
|
||
run_all: build | ||
cargo run --release prove_and_verify $(PROGRAM_PATH) | ||
|
||
clippy: | ||
cargo clippy --workspace --all-targets -- -D warnings | ||
|
||
docker_build_cairo_compiler: | ||
docker build -f cairo_compile.Dockerfile -t cairo . | ||
|
||
docker_compile_cairo: | ||
docker run -v $(ROOT_DIR):/pwd cairo --proof_mode /pwd/$(PROGRAM) > $(OUTPUT) |
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,66 @@ | ||
<div align="center"> | ||
|
||
# Lambdaworks Cairo Platinum Prover CLI | ||
|
||
</div> | ||
|
||
## ⚠️ Disclaimer | ||
|
||
CLI currently runs with 100 bits of conjecturable security | ||
|
||
## [Cairo Platinum Prover Docs]([lambdaclass.github.io/lambdaworks/](https://github.com/lambdaclass/lambdaworks/blob/main/provers/cairo/README.md)) | ||
|
||
## Requirements | ||
|
||
- Cargo 1.69+ | ||
|
||
## Usage | ||
|
||
Note: to use cairo compiler with docker, build the image by running: | ||
|
||
```bash | ||
make docker_build_cairo_compiler | ||
``` | ||
|
||
### 🚀 Prove and verify | ||
Sample Cairo 0 programs can be found [here](https://github.com/lambdaclass/lambdaworks/tree/main/provers/cairo/cairo_programs/cairo0) (need to be compiled first). | ||
|
||
Notice for compilation either `cairo-lang` or `docker` is required | ||
|
||
#### Usage: | ||
|
||
To create prove for a program you can use: | ||
|
||
```bash | ||
make prove PROGRAM_PATH=<compiled_program_path> PROOF_PATH=<output_proof_path> | ||
``` | ||
|
||
For example: | ||
|
||
```bash | ||
make prove PROGRAM_PATH=cairo_programs/cairo0/fibonacci_5.json PROOF_PATH=program_proof.proof | ||
``` | ||
|
||
To verify a proof you can use: | ||
|
||
```bash | ||
make verify PROOF_PATH=<proof_path> | ||
``` | ||
|
||
For example: | ||
|
||
```bash | ||
make verify PROOF_PATH=fibonacci_5.proof | ||
``` | ||
|
||
To prove and verify with a single command you can use: | ||
|
||
```bash | ||
make run_all PROOF_PATH=<proof_path> | ||
``` | ||
|
||
For example: | ||
|
||
```bash | ||
make run_all PROOF_PATH=fibonacci_5.proof | ||
``` |
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,11 @@ | ||
FROM python:3.9-slim | ||
|
||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends g++ libgmp3-dev | ||
|
||
COPY requirements.txt / | ||
|
||
RUN pip install -r /requirements.txt | ||
|
||
ENTRYPOINT ["cairo-compile"] |
File renamed without changes.
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