diff --git a/barretenberg/README.md b/barretenberg/README.md index d7bc7366618c..0ab267b2bd96 100644 --- a/barretenberg/README.md +++ b/barretenberg/README.md @@ -101,7 +101,7 @@ bb write_vk --scheme ultra_honk -b ./target/hello_world.json -o ./target/vk You can now use the verification key to generate a Solidity verifier contract: ```bash -bb write_contract --scheme ultra_honk -k ./target/vk -c $CRS_PATH -b ./target/hello_world.json -o ./target/Verifier.sol +bb write_solidity_verifier --scheme ultra_honk -k ./target/vk -c $CRS_PATH -b ./target/hello_world.json -o ./target/Verifier.sol ``` > [!CAUTION] diff --git a/barretenberg/acir_tests/flows/sol_honk.sh b/barretenberg/acir_tests/flows/sol_honk.sh index bd0a4fb6ded6..1d3dcada3107 100755 --- a/barretenberg/acir_tests/flows/sol_honk.sh +++ b/barretenberg/acir_tests/flows/sol_honk.sh @@ -20,7 +20,7 @@ export VERIFIER_CONTRACT="$outdir/Verifier.sol" # Create a proof, write the solidity contract, write the proof as fields in order to extract the public inputs $BIN prove $PROVE_FLAGS -o $outdir $BIN verify $VERIFY_FLAGS -k $VK -p $PROOF -$BIN write_contract $FLAGS -k $VK -o $VERIFIER_CONTRACT +$BIN write_solidity_verifier $FLAGS -k $VK -o $VERIFIER_CONTRACT # Export the paths to the environment variables for the js test runner export VERIFIER_PATH="$outdir/Verifier.sol" diff --git a/barretenberg/acir_tests/flows/sol_honk_zk.sh b/barretenberg/acir_tests/flows/sol_honk_zk.sh index 8521ddbfd595..7475fe54d914 100755 --- a/barretenberg/acir_tests/flows/sol_honk_zk.sh +++ b/barretenberg/acir_tests/flows/sol_honk_zk.sh @@ -19,7 +19,7 @@ export VERIFIER_CONTRACT="$outdir/Verifier.sol" # Create a proof, write the solidity contract, write the proof as fields in order to extract the public inputs $BIN prove -o $outdir $FLAGS $BFLAG $PROTOCOL_FLAGS --output_format bytes_and_fields --write_vk $BIN verify -k $VK -p $PROOF $FLAGS $PROTOCOL_FLAGS -$BIN write_contract $FLAGS -k $VK -o $VERIFIER_CONTRACT --zk +$BIN write_solidity_verifier $FLAGS -k $VK -o $VERIFIER_CONTRACT --zk # Export the paths to the environment variables for the js test runner export VERIFIER_PATH="$outdir/Verifier.sol" diff --git a/barretenberg/cpp/src/barretenberg/api/api.hpp b/barretenberg/cpp/src/barretenberg/api/api.hpp index 0813b051c9fc..8d82d120125c 100644 --- a/barretenberg/cpp/src/barretenberg/api/api.hpp +++ b/barretenberg/cpp/src/barretenberg/api/api.hpp @@ -68,8 +68,8 @@ class API { virtual void gates(const Flags& flags, const std::filesystem::path& bytecode_path) = 0; - virtual void write_contract(const Flags& flags, - const std::filesystem::path& output_path, - const std::filesystem::path& vk_path) = 0; + virtual void write_solidity_verifier(const Flags& flags, + const std::filesystem::path& output_path, + const std::filesystem::path& vk_path) = 0; }; } // namespace bb diff --git a/barretenberg/cpp/src/barretenberg/api/api_client_ivc.cpp b/barretenberg/cpp/src/barretenberg/api/api_client_ivc.cpp index 7c4bc525fd38..363918c5a8ea 100644 --- a/barretenberg/cpp/src/barretenberg/api/api_client_ivc.cpp +++ b/barretenberg/cpp/src/barretenberg/api/api_client_ivc.cpp @@ -259,9 +259,9 @@ void ClientIVCAPI::gates([[maybe_unused]] const Flags& flags, gate_count_for_ivc(bytecode_path); } -void ClientIVCAPI::write_contract([[maybe_unused]] const Flags& flags, - [[maybe_unused]] const std::filesystem::path& output_path, - [[maybe_unused]] const std::filesystem::path& vk_path) +void ClientIVCAPI::write_solidity_verifier([[maybe_unused]] const Flags& flags, + [[maybe_unused]] const std::filesystem::path& output_path, + [[maybe_unused]] const std::filesystem::path& vk_path) { throw_or_abort("API function contract not implemented"); } diff --git a/barretenberg/cpp/src/barretenberg/api/api_client_ivc.hpp b/barretenberg/cpp/src/barretenberg/api/api_client_ivc.hpp index fc649a306cf9..4bbdf46fe2c4 100644 --- a/barretenberg/cpp/src/barretenberg/api/api_client_ivc.hpp +++ b/barretenberg/cpp/src/barretenberg/api/api_client_ivc.hpp @@ -25,9 +25,9 @@ class ClientIVCAPI : public API { void gates(const Flags& flags, const std::filesystem::path& bytecode_path) override; - void write_contract(const Flags& flags, - const std::filesystem::path& output_path, - const std::filesystem::path& vk_path) override; + void write_solidity_verifier(const Flags& flags, + const std::filesystem::path& output_path, + const std::filesystem::path& vk_path) override; void write_vk(const Flags& flags, const std::filesystem::path& bytecode_path, diff --git a/barretenberg/cpp/src/barretenberg/api/api_ultra_honk.cpp b/barretenberg/cpp/src/barretenberg/api/api_ultra_honk.cpp index 1abd9759a2ef..41382a28fc96 100644 --- a/barretenberg/cpp/src/barretenberg/api/api_ultra_honk.cpp +++ b/barretenberg/cpp/src/barretenberg/api/api_ultra_honk.cpp @@ -206,9 +206,9 @@ void UltraHonkAPI::gates([[maybe_unused]] const Flags& flags, gate_count(bytecode_path, flags.recursive, flags.honk_recursion); } -void UltraHonkAPI::write_contract(const Flags& flags, - const std::filesystem::path& output_path, - const std::filesystem::path& vk_path) +void UltraHonkAPI::write_solidity_verifier(const Flags& flags, + const std::filesystem::path& output_path, + const std::filesystem::path& vk_path) { using VK = UltraKeccakFlavor::VerificationKey; auto vk = std::make_shared(from_buffer(read_file(vk_path))); diff --git a/barretenberg/cpp/src/barretenberg/api/api_ultra_honk.hpp b/barretenberg/cpp/src/barretenberg/api/api_ultra_honk.hpp index 48ad8b918742..7a8e6ca58d8f 100644 --- a/barretenberg/cpp/src/barretenberg/api/api_ultra_honk.hpp +++ b/barretenberg/cpp/src/barretenberg/api/api_ultra_honk.hpp @@ -33,9 +33,9 @@ class UltraHonkAPI : public API { void gates(const Flags& flags, const std::filesystem::path& bytecode_path) override; - void write_contract(const Flags& flags, - const std::filesystem::path& output_path, - const std::filesystem::path& vk_path) override; + void write_solidity_verifier(const Flags& flags, + const std::filesystem::path& output_path, + const std::filesystem::path& vk_path) override; }; template diff --git a/barretenberg/cpp/src/barretenberg/bb/main.cpp b/barretenberg/cpp/src/barretenberg/bb/main.cpp index 60ec86d4169b..826487170e4f 100644 --- a/barretenberg/cpp/src/barretenberg/bb/main.cpp +++ b/barretenberg/cpp/src/barretenberg/bb/main.cpp @@ -319,21 +319,21 @@ int main(int argc, char* argv[]) add_recursive_flag(verify); /*************************************************************************************************************** - * Subcommand: write_contract + * Subcommand: write_solidity_verifier ***************************************************************************************************************/ - CLI::App* write_contract = - app.add_subcommand("write_contract", - "Write a smart contract suitable for verifying proofs of circuit " + CLI::App* write_solidity_verifier = + app.add_subcommand("write_solidity_verifier", + "Write a Solidity smart contract suitable for verifying proofs of circuit " "satisfiability for the circuit with verification key at vk_path. Not all " "hash types are implemented due to efficiency concerns."); - add_scheme_option(write_contract); - add_vk_path_option(write_contract); - add_output_path_option(write_contract, output_path); + add_scheme_option(write_solidity_verifier); + add_vk_path_option(write_solidity_verifier); + add_output_path_option(write_solidity_verifier, output_path); - add_verbose_flag(write_contract); - add_zk_option(write_contract); - add_crs_path_option(write_contract); + add_verbose_flag(write_solidity_verifier); + add_zk_option(write_solidity_verifier); + add_crs_path_option(write_solidity_verifier); /*************************************************************************************************************** * Subcommand: OLD_API @@ -669,8 +669,8 @@ int main(int argc, char* argv[]) if (verify->parsed()) { return api.verify(flags, proof_path, vk_path) ? 0 : 1; } - if (write_contract->parsed()) { - api.write_contract(flags, output_path, vk_path); + if (write_solidity_verifier->parsed()) { + api.write_solidity_verifier(flags, output_path, vk_path); return 0; } auto subcommands = app.get_subcommands(); diff --git a/barretenberg/cpp/src/barretenberg/bb/readme.md b/barretenberg/cpp/src/barretenberg/bb/readme.md index 612a3cece377..7a5fc5800bc6 100644 --- a/barretenberg/cpp/src/barretenberg/bb/readme.md +++ b/barretenberg/cpp/src/barretenberg/bb/readme.md @@ -91,7 +91,7 @@ Barretenberg UltraHonk comes with the capability to verify proofs in Solidity, i **WARNING:** Contract incomplete, do not use in production! ```bash - bb write_contract --scheme ultra_honk -k ./target/vk -b ./target/hello_world.json -o ./target/Verifier.sol + bb write_solidity_verifier --scheme ultra_honk -k ./target/vk -b ./target/hello_world.json -o ./target/Verifier.sol ``` #### Usage with MegaHonk diff --git a/noir-projects/noir-protocol-circuits/bootstrap.sh b/noir-projects/noir-protocol-circuits/bootstrap.sh index 2ee8f6a0f622..668dcde7b7d3 100755 --- a/noir-projects/noir-protocol-circuits/bootstrap.sh +++ b/noir-projects/noir-protocol-circuits/bootstrap.sh @@ -130,7 +130,7 @@ function compile { local verifier_path="$key_dir/${name}_verifier.sol" SECONDS=0 # Generate solidity verifier for this contract. - echo "$vk_bytes" | xxd -r -p | $BB write_contract --scheme ultra_honk -k - -o $verifier_path + echo "$vk_bytes" | xxd -r -p | $BB write_solidity_verifier --scheme ultra_honk -k - -o $verifier_path echo_stderr "VK output at: $verifier_path (${SECONDS}s)" # Include the verifier path if we create it. cache_upload vk-$hash.tar.gz $key_path $verifier_path &> /dev/null