From 76791548c1c7531ea112281540cf0ee1604c2651 Mon Sep 17 00:00:00 2001 From: Nacho Avecilla Date: Sat, 12 Oct 2024 15:26:01 -0300 Subject: [PATCH] hotfix(docs): fix broken section links (#1230) --- docs/1_introduction/0_about_aligned.md | 2 +- .../{3_use_cases.md => 2_use_cases.md} | 0 docs/1_introduction/2_zkquiz.md | 63 ------------------- docs/1_introduction/{4_faq.md => 3_faq.md} | 2 +- .../{5_why_zk.md => 4_why_zk.md} | 0 docs/3_guides/0_submitting_proofs.md | 4 +- docs/3_guides/1_SDK_how_to.md | 6 +- .../2_build_your_first_aligned_application.md | 8 +-- docs/3_guides/4_generating_proofs.md | 4 +- docs/SUMMARY.md | 6 +- 10 files changed, 14 insertions(+), 81 deletions(-) rename docs/1_introduction/{3_use_cases.md => 2_use_cases.md} (100%) delete mode 100644 docs/1_introduction/2_zkquiz.md rename docs/1_introduction/{4_faq.md => 3_faq.md} (99%) rename docs/1_introduction/{5_why_zk.md => 4_why_zk.md} (100%) diff --git a/docs/1_introduction/0_about_aligned.md b/docs/1_introduction/0_about_aligned.md index 9e5b58b21..0372b2483 100644 --- a/docs/1_introduction/0_about_aligned.md +++ b/docs/1_introduction/0_about_aligned.md @@ -3,7 +3,7 @@ Aligned is a decentralized network that verifies Zero-Knowledge/validity proofs and posts the results to Ethereum. It is designed to provide high throughput, cheap proof verification with low latency. {% hint style="info" %} -If you are unfamiliar with ZK and why this is useful, see [Why ZK and Aligned?](./5_why_zk.md) +If you are unfamiliar with ZK and why this is useful, see [Why ZK and Aligned?](./4_why_zk.md) {% endhint %} ## Mission diff --git a/docs/1_introduction/3_use_cases.md b/docs/1_introduction/2_use_cases.md similarity index 100% rename from docs/1_introduction/3_use_cases.md rename to docs/1_introduction/2_use_cases.md diff --git a/docs/1_introduction/2_zkquiz.md b/docs/1_introduction/2_zkquiz.md deleted file mode 100644 index c7b287b79..000000000 --- a/docs/1_introduction/2_zkquiz.md +++ /dev/null @@ -1,63 +0,0 @@ -# ZK Quiz - -## Introduction - -This program leverages Aligned's ZK verification infrastructure to run a small quiz. The proof allows any party to check that the quiz was answered right or wrong. If answered correctly, the user receives an NFT. - -The process is as follows: - -1. The user runs ZKQuiz and answers the questions. -2. ZKQuiz generates a ZK Proof of correct answers. -3. The proof is posted on Aligned. -4. Upon verification, ZKQuiz mints an NFT via a Smart Contract. - -The NFT is only granted if the user's answers correctly. -Incorrect answers or tampering with the ZKQuiz code will result in proof generation failure or mismatched checksums, -preventing NFT minting. - -Next, we will see how to execute ZKQuiz to get your own ZKQuiz NFT! - -## Requirements - -1. [Rust](https://www.rust-lang.org/tools/install) -2. [Foundry](https://getfoundry.sh) - -## Usage - -### 1 - Create Keystore - -{% hint style="warning" %} -When creating a new wallet keystore and private key please use strong passwords for your own protection. -{% endhint %} - -You can use cast to create a local keystore. -If you already have one, you can skip this step. - -```bash -cast wallet new-mnemonic -``` - -Then you can import your created keystore using: - -```bash -cast wallet import --interactive -``` - -Then you need to get some funds to pay for gas and proof verification. -You can do this by using this [faucet](https://cloud.google.com/application/web3/faucet/ethereum/holesky) - -### 2 - Answer Quiz - -To answer quiz questions run: - -```bash -make answer_quiz KEYSTORE_PATH= -``` - -This will: - -1. Ask quiz questions -2. Generate ZK proof -3. Pay & submit proof to aligned for verification -4. Wait for proof to be verified in aligned -5. Claim NFT if proof is verified \ No newline at end of file diff --git a/docs/1_introduction/4_faq.md b/docs/1_introduction/3_faq.md similarity index 99% rename from docs/1_introduction/4_faq.md rename to docs/1_introduction/3_faq.md index fec8f4a10..ef95245b4 100644 --- a/docs/1_introduction/4_faq.md +++ b/docs/1_introduction/3_faq.md @@ -166,7 +166,7 @@ Verifiable computation allows developers to build applications that help Ethereu ### What are the use cases for Aligned? -We believe that there are many things that will be built using Aligned that we have not even imagined yet. For some possible use cases please see [this page](../1_introduction/3_use_cases.md). +We believe that there are many things that will be built using Aligned that we have not even imagined yet. For some possible use cases please see [this page](../1_introduction/2_use_cases.md). ### Why don’t you run Aligned on top of a virtual machine? diff --git a/docs/1_introduction/5_why_zk.md b/docs/1_introduction/4_why_zk.md similarity index 100% rename from docs/1_introduction/5_why_zk.md rename to docs/1_introduction/4_why_zk.md diff --git a/docs/3_guides/0_submitting_proofs.md b/docs/3_guides/0_submitting_proofs.md index ee6e0fa84..f87d93ae5 100644 --- a/docs/3_guides/0_submitting_proofs.md +++ b/docs/3_guides/0_submitting_proofs.md @@ -1,6 +1,6 @@ # Submitting Proofs -Make sure you have Aligned installed as specified [here](../1_introduction/1_getting_started.md#Quickstart). +Make sure you have Aligned installed as specified [here](../1_introduction/1_try_aligned.md#quickstart). If you run the examples below, make sure you are in Aligned's repository root. @@ -100,7 +100,7 @@ These commands allow the usage of the following flags: ## 3. Submit your proof to the batcher -This guide will focus on how to submit proofs using the Aligned CLI. To integrate the proof submission process into your application, check the [First Aligned Application tutorial](../3_guides/2_build_your_first_aligned_application.md#app) where we explain how a program to generates a submit a proof looks like using the Aligned SDK. +This guide will focus on how to submit proofs using the Aligned CLI. To integrate the proof submission process into your application, check the [First Aligned Application tutorial](../3_guides/2_build_your_first_aligned_application.md#app) where we explain how to generate and submit a proof using the Aligned SDK. Proof submission is done via the `submit` command of the Aligned CLI. The arguments for the submit command are: diff --git a/docs/3_guides/1_SDK_how_to.md b/docs/3_guides/1_SDK_how_to.md index 6b261c083..10eb13259 100644 --- a/docs/3_guides/1_SDK_how_to.md +++ b/docs/3_guides/1_SDK_how_to.md @@ -47,7 +47,7 @@ fn main() { Or you can make a more complex call to submit a proof: -(code extract from [ZKQuiz](../1_introduction/2_zkquiz.md)) +(code extract from [ZKQuiz example](../3_guides/2_build_your_first_aligned_application.md#app)) ```rust const BATCHER_URL: &str = "wss://batcher.alignedlayer.com"; @@ -67,7 +67,9 @@ fn main() { let wallet = LocalWallet::decrypt_keystore(args.keystore_path, &keystore_password) .expect("Failed to decrypt keystore") .with_chain_id(17000u64); - let max_fee: U256 = estimate_fee(&rpc_url, PriceEstimate::Default).await.unwrap(); + let max_fee = estimate_fee(&rpc_url, PriceEstimate::Instant) + .await + .expect("failed to fetch gas price from the blockchain"); // Call to SDK: match submit_and_wait_verification( diff --git a/docs/3_guides/2_build_your_first_aligned_application.md b/docs/3_guides/2_build_your_first_aligned_application.md index 94a5580ce..27689eba6 100644 --- a/docs/3_guides/2_build_your_first_aligned_application.md +++ b/docs/3_guides/2_build_your_first_aligned_application.md @@ -147,17 +147,11 @@ It is not mandatory to create an Smart Contract. You can make off-chain apps tha **Program Identifier Validation** The contract first checks that the commitment of the program matches with the one that we expect. - -In our zkquiz example, we get the following elf_commitment: +In our zkquiz example, we get the following elf commitment: ```solidity // contracts/src/VerifierContract.sol - bytes32 public elfCommitment = 0x3f99615fdf3b67a01e41b38eee75a32c778ee2fa631bd74e01c89afc2f70f5de; - -if (elfCommitment != provingSystemAuxDataCommitment) { - revert InvalidElf(provingSystemAuxDataCommitment); -} ``` You can generate the expected commitment without actually generating and submitting a proof using the Aligned CLI tool running: diff --git a/docs/3_guides/4_generating_proofs.md b/docs/3_guides/4_generating_proofs.md index bf3593739..96919ec6e 100644 --- a/docs/3_guides/4_generating_proofs.md +++ b/docs/3_guides/4_generating_proofs.md @@ -9,7 +9,7 @@ This guide assumes that: - sp1 prover installed (instructions [here](https://succinctlabs.github.io/sp1/getting-started/install.html)) - sp1 project to generate the proofs (instructions [here](https://succinctlabs.github.io/sp1/generating-proofs/setup.html)) -- aligned installed (instructions [here](../1_introduction/1_getting_started.md#quickstart)) +- aligned installed (instructions [here](../1_introduction/1_try_aligned.md#quickstart)) ### How to generate a proof @@ -106,7 +106,7 @@ This guide assumes that: - Risc0 toolchain installed (instructions [here](https://dev.risczero.com/api/zkvm/quickstart#1-install-the-risc-zero-toolchain)) - Risc0 project to generate the proofs (instructions [here](https://dev.risczero.com/api/zkvm/quickstart#2-create-a-new-project)) -- Aligned installed (instructions [here](../1_introduction/1_getting_started.md#quickstart)) +- Aligned installed (instructions [here](../1_introduction/1_try_aligned.md#quickstart)) ### How to generate a proof diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 6459a788b..ae3b200e5 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -4,9 +4,9 @@ * [About Aligned](1_introduction/0_about_aligned.md) * [Try Aligned](1_introduction/1_try_aligned.md) -* [Use cases](1_introduction/3_use_cases.md) -* [FAQ](1_introduction/4_faq.md) -* [Why ZK and Aligned?](1_introduction/5_why_zk.md) +* [Use cases](1_introduction/2_use_cases.md) +* [FAQ](1_introduction/3_faq.md) +* [Why ZK and Aligned?](1_introduction/4_why_zk.md) ## Architecture