From 2d5ceb7520c601b512a7e27a6758cf5a1f77bc72 Mon Sep 17 00:00:00 2001 From: saleel Date: Tue, 22 Apr 2025 18:44:58 +0400 Subject: [PATCH] chore(docs): minor updates in solidity doc --- docs/docs/how_to/how-to-solidity-verifier.mdx | 10 +--------- .../how_to/how-to-solidity-verifier.mdx | 10 +--------- .../how_to/how-to-solidity-verifier.mdx | 16 ++++------------ 3 files changed, 6 insertions(+), 30 deletions(-) diff --git a/docs/docs/how_to/how-to-solidity-verifier.mdx b/docs/docs/how_to/how-to-solidity-verifier.mdx index 06a08533260..f4d706433a9 100644 --- a/docs/docs/how_to/how-to-solidity-verifier.mdx +++ b/docs/docs/how_to/how-to-solidity-verifier.mdx @@ -10,7 +10,6 @@ keywords: smart contract, blockchain, compiler, - plonk_vk.sol, EVM blockchain, verifying Noir programs, proving backend, @@ -43,13 +42,6 @@ Generating a Solidity Verifier with Barretenberg contract is actually a one-comm 2. How to compile the smart contract in the RemixIDE 3. How to deploy it to a testnet -:::info[Which proving system to use?] - -Barretenberg currently provides two provers: `UltraPlonk` and `UltraHonk`. In a nutshell, `UltraHonk` is faster and uses less RAM, but its verifier contract is much more expensive. `UltraPlonk` is optimized for on-chain verification, but proving is more expensive. - -In any case, we provide instructions for both. Choose your poison ☠️ - -::: ## Step 1 - Generate a contract @@ -67,7 +59,7 @@ This will compile your source code into a Noir build artifact to be stored in th bb write_vk -b ./target/.json -o ./target --oracle_hash keccak # Generate the Solidity verifier from the vkey -bb write_solidity_verifier -k ./target/vk -o ../target/Verifier.sol +bb write_solidity_verifier -k ./target/vk -o ./target/Verifier.sol ``` replacing `` with the name of your Noir project. A `Verifier.sol` contract is now in the target folder and can be deployed to any EVM blockchain acting as a verifier smart contract. diff --git a/docs/versioned_docs/version-1.0.0-beta.4/how_to/how-to-solidity-verifier.mdx b/docs/versioned_docs/version-1.0.0-beta.4/how_to/how-to-solidity-verifier.mdx index 06a08533260..f4d706433a9 100644 --- a/docs/versioned_docs/version-1.0.0-beta.4/how_to/how-to-solidity-verifier.mdx +++ b/docs/versioned_docs/version-1.0.0-beta.4/how_to/how-to-solidity-verifier.mdx @@ -10,7 +10,6 @@ keywords: smart contract, blockchain, compiler, - plonk_vk.sol, EVM blockchain, verifying Noir programs, proving backend, @@ -43,13 +42,6 @@ Generating a Solidity Verifier with Barretenberg contract is actually a one-comm 2. How to compile the smart contract in the RemixIDE 3. How to deploy it to a testnet -:::info[Which proving system to use?] - -Barretenberg currently provides two provers: `UltraPlonk` and `UltraHonk`. In a nutshell, `UltraHonk` is faster and uses less RAM, but its verifier contract is much more expensive. `UltraPlonk` is optimized for on-chain verification, but proving is more expensive. - -In any case, we provide instructions for both. Choose your poison ☠️ - -::: ## Step 1 - Generate a contract @@ -67,7 +59,7 @@ This will compile your source code into a Noir build artifact to be stored in th bb write_vk -b ./target/.json -o ./target --oracle_hash keccak # Generate the Solidity verifier from the vkey -bb write_solidity_verifier -k ./target/vk -o ../target/Verifier.sol +bb write_solidity_verifier -k ./target/vk -o ./target/Verifier.sol ``` replacing `` with the name of your Noir project. A `Verifier.sol` contract is now in the target folder and can be deployed to any EVM blockchain acting as a verifier smart contract. diff --git a/docs/versioned_docs/version-v1.0.0-beta.3/how_to/how-to-solidity-verifier.mdx b/docs/versioned_docs/version-v1.0.0-beta.3/how_to/how-to-solidity-verifier.mdx index d33d0bd3681..7dd941fb553 100644 --- a/docs/versioned_docs/version-v1.0.0-beta.3/how_to/how-to-solidity-verifier.mdx +++ b/docs/versioned_docs/version-v1.0.0-beta.3/how_to/how-to-solidity-verifier.mdx @@ -10,7 +10,6 @@ keywords: smart contract, blockchain, compiler, - plonk_vk.sol, EVM blockchain, verifying Noir programs, proving backend, @@ -43,13 +42,6 @@ Generating a Solidity Verifier with Barretenberg contract is actually a one-comm 2. How to compile the smart contract in the RemixIDE 3. How to deploy it to a testnet -:::info[Which proving system to use?] - -Barretenberg currently provides two provers: `UltraPlonk` and `UltraHonk`. In a nutshell, `UltraHonk` is faster and uses less RAM, but its verifier contract is much more expensive. `UltraPlonk` is optimized for on-chain verification, but proving is more expensive. - -In any case, we provide instructions for both. Choose your poison ☠️ - -::: ## Step 1 - Generate a contract @@ -67,7 +59,7 @@ This will compile your source code into a Noir build artifact to be stored in th bb write_vk -b ./target/.json -o ./target --oracle_hash keccak # Generate the Solidity verifier from the vkey -bb write_solidity_verifier -k ./target/vk -o ../target/Verifier.sol +bb write_solidity_verifier -k ./target/vk -o ./target/Verifier.sol ``` replacing `` with the name of your Noir project. A `Verifier.sol` contract is now in the target folder and can be deployed to any EVM blockchain acting as a verifier smart contract. @@ -140,14 +132,14 @@ Barretenberg attaches the public inputs to the proof, which in this case it's no ```bash PROOF_HEX=$(cat ./target/proof | od -An -v -t x1 | tr -d $' \n' | sed 's/^.\{8\}//') -NUM_PUBLIC_INPUTS=2 +NUM_PUBLIC_INPUTS=1 # Replace this with the number of public inputs in your circuit HEX_PUBLIC_INPUTS=${PROOF_HEX:0:$((32 * $NUM_PUBLIC_INPUTS * 2))} -SPLIT_HEX_PUBLIC_INPUTS=$(sed -e 's/.\{64\}/0x&,/g' <<<$HEX_PUBLIC_INPUTS) +SPLIT_HEX_PUBLIC_INPUTS=$(sed -e 's/.\{64\}/"0x&",/g' <<<$HEX_PUBLIC_INPUTS) PROOF_WITHOUT_PUBLIC_INPUTS="${PROOF_HEX:$((NUM_PUBLIC_INPUTS * 32 * 2))}" echo 0x$PROOF_WITHOUT_PUBLIC_INPUTS -echo [$SPLIT_HEX_PUBLIC_INPUTS] +echo "[${SPLIT_HEX_PUBLIC_INPUTS}]" ``` You can pass the proof and public inputs from above to the `verify` function in Remix.