diff --git a/src/init.cpp b/src/init.cpp index 107e3e4760a..dbf3001281a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1,5 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers +// Copyright (c) 2019 The Hush developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -752,15 +753,11 @@ static void ZC_LoadParams( struct timeval tv_start, tv_end; float elapsed; - boost::filesystem::path pk_path = ZC_GetParamsDir() / "sprout-proving.key"; - boost::filesystem::path vk_path = ZC_GetParamsDir() / "sprout-verifying.key"; boost::filesystem::path sapling_spend = ZC_GetParamsDir() / "sapling-spend.params"; boost::filesystem::path sapling_output = ZC_GetParamsDir() / "sapling-output.params"; boost::filesystem::path sprout_groth16 = ZC_GetParamsDir() / "sprout-groth16.params"; if (!( - boost::filesystem::exists(pk_path) && - boost::filesystem::exists(vk_path) && boost::filesystem::exists(sapling_spend) && boost::filesystem::exists(sapling_output) && boost::filesystem::exists(sprout_groth16) @@ -775,10 +772,10 @@ static void ZC_LoadParams( return; } - LogPrintf("Loading verifying key from %s\n", vk_path.string().c_str()); + //LogPrintf("Loading verifying key from %s\n", vk_path.string().c_str()); gettimeofday(&tv_start, 0); - pzcashParams = ZCJoinSplit::Prepared(vk_path.string(), pk_path.string()); + //pzcashParams = ZCJoinSplit::Prepared(vk_path.string(), pk_path.string()); gettimeofday(&tv_end, 0); elapsed = float(tv_end.tv_sec-tv_start.tv_sec) + (tv_end.tv_usec-tv_start.tv_usec)/float(1000000); @@ -796,6 +793,7 @@ static void ZC_LoadParams( LogPrintf("Loading Sapling (Sprout Groth16) parameters from %s\n", sprout_groth16.string().c_str()); gettimeofday(&tv_start, 0); + // TODO: Unfortunately there is no way to initialize things without groth16, unless Rust code is modified. librustzcash_init_zksnark_params( reinterpret_cast(sapling_spend_str.c_str()), sapling_spend_str.length(), diff --git a/zcutil/fetch-params.sh b/zcutil/fetch-params.sh index 522de809910..1ccdc424611 100755 --- a/zcutil/fetch-params.sh +++ b/zcutil/fetch-params.sh @@ -1,20 +1,21 @@ #!/bin/bash +# Copyright 2019 The Hush developers set -eu +# We do not declare our own location because we can use the params +# from any other installed coins if [[ "$OSTYPE" == "darwin"* ]]; then PARAMS_DIR="$HOME/Library/Application Support/ZcashParams" else PARAMS_DIR="$HOME/.zcash-params" fi -SPROUT_PKEY_NAME='sprout-proving.key' -SPROUT_VKEY_NAME='sprout-verifying.key' SAPLING_SPEND_NAME='sapling-spend.params' SAPLING_OUTPUT_NAME='sapling-output.params' SAPLING_SPROUT_GROTH16_NAME='sprout-groth16.params' -SPROUT_URL="https://z.cash/downloads" -SPROUT_IPFS="/ipfs/QmZKKx7Xup7LiAtFRhYsE1M7waXcv9ir9eCECyXAFGxhEo" +URL="https://z.cash/downloads" +IPFS="/ipfs/QmZKKx7Xup7LiAtFRhYsE1M7waXcv9ir9eCECyXAFGxhEo" SHA256CMD="$(command -v sha256sum || echo shasum)" SHA256ARGS="$(command -v sha256sum >/dev/null || echo '-a 256')" @@ -38,7 +39,7 @@ function fetch_wget { cat <> "$README_PATH" <