From d991c7c782e8b099142c2a551f74d4ed19379b36 Mon Sep 17 00:00:00 2001 From: Beau Date: Thu, 17 Nov 2022 11:58:07 +1100 Subject: [PATCH 1/5] fix: point directly to rustup cargo Maybe there is a better way to fix or document this, but for devs currently using a cargo installed by package manager i.e homebrew the example commands will fail. Noting for now mostly if anyone else runs into this too :) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fd386dc..314ff68 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,12 @@ In this example the prover generates a proof that proves integrity of a brainf** # generate the proof # use `-F parallel,asm` if not using an M1 Mac -cargo +nightly run -r -F parallel,asm,gpu --example brainfuck -- \ +$HOME/.cargo/bin/cargo +nightly run -r -F parallel,asm,gpu --example brainfuck -- \ prove ./examples/brainfuck/hello_world.bf \ --dst ./hello_world.proof # verify the proof -cargo +nightly run -r -F asm --example brainfuck -- \ +$HOME/.cargo/bin/cargo +nightly run -r -F asm --example brainfuck -- \ verify ./examples/brainfuck/hello_world.bf \ --output "Hello World" \ --proof ./hello_world.proof @@ -99,4 +99,4 @@ The representation of constraints in miniSTARK is much closer to a representatio - [StarkWare](https://starkware.co/) - The company started by the people who invented STARKs. There are so many great things to learn from the people at this company. It's great how public and open their educational material is. Check out: GOAT Eli Ben-Sasson's [STARK math thread](https://twitter.com/EliBenSasson/status/1578380154476208131), Cairo whitepaper ([Video](https://www.youtube.com/watch?v=DTVn0oYLVsE), [PDF](https://eprint.iacr.org/2021/1063.pdf)), [DEEP Method Medium article](https://medium.com/starkware/starkdex-deep-dive-the-stark-core-engine-497942d0f0ab). - [Alan Szepieniec](https://twitter.com/aszepieniec?lang=en) - The [Anatomy of a STARK](https://aszepieniec.github.io/stark-anatomy/) tutorial is (IMHO) the best end-to-end practical resource to understand STARKs. Read through this and the magic of STARKs will start to make sense. [BrainSTARK](https://aszepieniec.github.io/stark-brainfuck/brainfuck) is a fantastic sequel to the STARK Anatomy tutorial and is a practical guide to creating an AIR that proves programs written in the Brainf**k programming language. Check out miniSTARK's [brainf\*\*k example](examples/brainfuck/) which is an implementation of the BrainSTARK AIR. -- [Winterfell](https://github.com/novifinancial/winterfell) - A STARK prover and verifier developed at Facebook by [Bobbin Threadbare](https://twitter.com/bobbinth) and others. This repo was heavily used as a reference for several components: fast Merkle Tree, DEEP composition polynomial, channels, and STARK component traits. Bobbin has some great HackMD articles: [Miden VM program decoder](https://hackmd.io/_aaDBzbWRz6EwQQRtK1pzw), [Memory in Miden VM](https://hackmd.io/@bobbinth/HJr56BKKt), [u32 operations in Miden VM](https://hackmd.io/NC-yRmmtRQSvToTHb96e8Q#u32-operations-in-Miden-VM). \ No newline at end of file +- [Winterfell](https://github.com/novifinancial/winterfell) - A STARK prover and verifier developed at Facebook by [Bobbin Threadbare](https://twitter.com/bobbinth) and others. This repo was heavily used as a reference for several components: fast Merkle Tree, DEEP composition polynomial, channels, and STARK component traits. Bobbin has some great HackMD articles: [Miden VM program decoder](https://hackmd.io/_aaDBzbWRz6EwQQRtK1pzw), [Memory in Miden VM](https://hackmd.io/@bobbinth/HJr56BKKt), [u32 operations in Miden VM](https://hackmd.io/NC-yRmmtRQSvToTHb96e8Q#u32-operations-in-Miden-VM). From f4f2334e6dc067341974b0a12d1028f7f10930ad Mon Sep 17 00:00:00 2001 From: Beau Date: Thu, 17 Nov 2022 12:48:53 +1100 Subject: [PATCH 2/5] fix: add in prereq notes to run example --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 314ff68..2a05425 100644 --- a/README.md +++ b/README.md @@ -25,18 +25,22 @@ miniSTARK allows you to prove the integrity of arbitrary computations to anyone In this example the prover generates a proof that proves integrity of a brainf**k program that outputs "Hello World". The verifier uses the proof, brainf\*\*k source code and output to verify execution integrity without executing the program at all. To run this demo locally: ```bash +#prerequisites +Ensure $CC = gcc `echo $CC` i.e apples gcc distributed with xcode and `which gcc` points to /usr/bin/gcc (MacOSX users) +Ensure cargo is the rustup (i.e not homebrew rust install.. etc) version `which cargo` should point to $HOME/.cargo/bin/cargo + # compile shaders (M1 Mac only) # make sure the latest Xcode is installed (cd gpu-poly && make) # generate the proof # use `-F parallel,asm` if not using an M1 Mac -$HOME/.cargo/bin/cargo +nightly run -r -F parallel,asm,gpu --example brainfuck -- \ +cargo +nightly run -r -F parallel,asm,gpu --example brainfuck -- \ prove ./examples/brainfuck/hello_world.bf \ --dst ./hello_world.proof # verify the proof -$HOME/.cargo/bin/cargo +nightly run -r -F asm --example brainfuck -- \ +cargo +nightly run -r -F asm --example brainfuck -- \ verify ./examples/brainfuck/hello_world.bf \ --output "Hello World" \ --proof ./hello_world.proof From 21956d6d5e52ffe2ad66570ab91ef2e8df07f9d4 Mon Sep 17 00:00:00 2001 From: Beau Date: Thu, 17 Nov 2022 12:49:52 +1100 Subject: [PATCH 3/5] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a05425..9c77245 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,12 @@ miniSTARK allows you to prove the integrity of arbitrary computations to anyone In this example the prover generates a proof that proves integrity of a brainf**k program that outputs "Hello World". The verifier uses the proof, brainf\*\*k source code and output to verify execution integrity without executing the program at all. To run this demo locally: +### Prerequisites to run example +Ensure $CC = gcc `echo $CC` i.e apples gcc distributed with xcode and `which gcc` points to /usr/bin/gcc (MacOSX users) +Ensure cargo is the rustup (i.e not homebrew rust install.. etc) version `which cargo` should point to $HOME/.cargo/bin/cargo + ```bash -#prerequisites + Ensure $CC = gcc `echo $CC` i.e apples gcc distributed with xcode and `which gcc` points to /usr/bin/gcc (MacOSX users) Ensure cargo is the rustup (i.e not homebrew rust install.. etc) version `which cargo` should point to $HOME/.cargo/bin/cargo From 83740d470394b3a1432f5632d62872c77a020a5c Mon Sep 17 00:00:00 2001 From: Beau Date: Thu, 17 Nov 2022 12:50:16 +1100 Subject: [PATCH 4/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c77245..af9e206 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ miniSTARK allows you to prove the integrity of arbitrary computations to anyone In this example the prover generates a proof that proves integrity of a brainf**k program that outputs "Hello World". The verifier uses the proof, brainf\*\*k source code and output to verify execution integrity without executing the program at all. To run this demo locally: ### Prerequisites to run example -Ensure $CC = gcc `echo $CC` i.e apples gcc distributed with xcode and `which gcc` points to /usr/bin/gcc (MacOSX users) -Ensure cargo is the rustup (i.e not homebrew rust install.. etc) version `which cargo` should point to $HOME/.cargo/bin/cargo +- Ensure $CC = gcc `echo $CC` i.e apples gcc distributed with xcode and `which gcc` points to /usr/bin/gcc (MacOSX users) +- Ensure cargo is the rustup (i.e not homebrew rust install.. etc) version `which cargo` should point to $HOME/.cargo/bin/cargo ```bash From f035f0bd460f964554aafe37c2b767011b78009b Mon Sep 17 00:00:00 2001 From: Beau Date: Thu, 17 Nov 2022 12:54:17 +1100 Subject: [PATCH 5/5] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index af9e206..4ccb1ef 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,9 @@ miniSTARK allows you to prove the integrity of arbitrary computations to anyone In this example the prover generates a proof that proves integrity of a brainf**k program that outputs "Hello World". The verifier uses the proof, brainf\*\*k source code and output to verify execution integrity without executing the program at all. To run this demo locally: ### Prerequisites to run example -- Ensure $CC = gcc `echo $CC` i.e apples gcc distributed with xcode and `which gcc` points to /usr/bin/gcc (MacOSX users) -- Ensure cargo is the rustup (i.e not homebrew rust install.. etc) version `which cargo` should point to $HOME/.cargo/bin/cargo +- Ensure `echo $CC` returns `gcc` #prerequisites i.e apples gcc distributed with xcode and +- Ensure `which gcc` returns `/usr/bin/gcc` (MacOSX users) +- Ensure `which cargo` in PATH is the rustup (i.e not homebrew rust install.. etc) version, should return $HOME/.cargo/bin/cargo ```bash