From 669edd50909c923851daf994721c7fc24a08d0cc Mon Sep 17 00:00:00 2001 From: Jon Layton Date: Fri, 9 Feb 2018 13:09:51 -0600 Subject: [PATCH 1/9] Update readme with snapshot and fork dates --- README.md | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index e8ff6e91..302f5d46 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,16 @@ -Bitcoin Private v1.0.10-1 - -NOTICE, the default ports have changed! The p2p port is now 7933 and rpcport is 7932 - -What is Bitcoin Private? +Bitcoin Private ---------------- -Bitcoin Private is financial freedom. +--- +**Bitcoin Private v1.0.10-1** + +P2P Port: 7933 +RPC Port: 7932 + +Bitcoin Private is a fork of Zclassic, merging in the UTXO set of Bitcoin. BTCP is financial freedom. + +### Info + +The snapshot will take place on February 28th. The fork (creation of BTCP) will occur shortly after, on March 2nd. Install ----------------- @@ -22,7 +28,7 @@ Install ```{r, engine='bash'} # Build ./btcputil/build.sh -j$(nproc) -# fetch key +# Fetch Zcash ceremony keys ./btcputil/fetch-params.sh # Run ./src/btcpd @@ -69,7 +75,7 @@ Install About -------------- -[Bitcoin Private](http://zclassic.org/), like [Zcash](https://z.cash/), is an implementation of the "Zerocash" protocol. +[Bitcoin Private](http://zclassic.org/), like [Zclassic](https://zclassic.org/) and [Zcash](https://z.cash/), is an implementation of the "Zerocash" protocol. Based on Bitcoin's code, it intends to offer a far higher standard of privacy through a sophisticated zero-knowledge proving scheme that preserves confidentiality of transaction metadata. Technical details are available @@ -80,13 +86,15 @@ of Bitcoin Private transactions; depending on the speed of your computer and net connection, the synchronization process could take a day or more once the blockchain has reached a significant size. +It includes both `btcpd` (the daemon) and `btcp-cli` (the command line tools) + Security Warnings ----------------- See important security warnings in [doc/security-warnings.md](doc/security-warnings.md). -**Bitcoin Private and Zcash are unfinished and highly experimental.** Use at your own risk. +**Bitcoin Private is unfinished and highly experimental.** Use at your own risk. Deprecation Policy ------------------ @@ -99,27 +107,26 @@ height and can be explicitly disabled. Where do I begin? ----------------- We have a guide for joining the main Bitcoin Private network: -https://github.com/BTCPrivate/BitcoinPrivate/wiki/1.0-User-Guide +https://github.com/zcash/zcash/wiki/1.0-User-Guide ### Need Help? -* See the documentation at the [Bitcoin Private Wiki](https://github.com/BTCPrivate/BitcoinPrivate/wiki) +* See documentation at the [Zcash Wiki](https://github.com/zcash/zcash/wiki) and the [Zclassic Wiki](https://github.com/z-classic/zclassic/wiki) for help and more information. -* Ask for help on the [Bitcoin Private](http://zcltalk.tech/index.php) forum. ### Want to participate in development? * Code review is welcome! -* If you want to get to know us join our slack: http://zclassic.herokuapp.com/ +* If you want to get to know us join our Discord: https://discord.gg/9xezcaK -Participation in the Zcash project is subject to a +Participation in the Bitcoin Private project is subject to a [Code of Conduct](code_of_conduct.md). Building -------- -Build Zcash along with most dependencies from source by running +Build BTCP along with most dependencies from source by running `./btcputil/build.sh`. Currently only Linux is officially supported. License From f8aef28faad9962f7c5302833fa02a2d4395debc Mon Sep 17 00:00:00 2001 From: Jon Layton Date: Fri, 9 Feb 2018 13:12:14 -0600 Subject: [PATCH 2/9] tinyfixes --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 302f5d46..f29221fa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Bitcoin Private ---------------- ---- + **Bitcoin Private v1.0.10-1** P2P Port: 7933 @@ -16,7 +16,7 @@ Install ----------------- ### Linux -Get dependencies +Get dependencies: ```{r, engine='bash'} sudo apt-get install \ build-essential pkg-config libc6-dev m4 g++-multilib \ @@ -24,7 +24,7 @@ sudo apt-get install \ zlib1g-dev wget bsdmainutils automake ``` -Install +Install: ```{r, engine='bash'} # Build ./btcputil/build.sh -j$(nproc) @@ -35,7 +35,7 @@ Install ``` ### Windows -Get dependencies +Get dependencies: ```{r, engine='bash'} sudo apt-get install \ build-essential pkg-config libc6-dev m4 g++-multilib \ @@ -43,7 +43,7 @@ sudo apt-get install \ zlib1g-dev wget bsdmainutils automake mingw-w64 ``` -Install (Cross-Compiled, building on Windows is not supported yet) +Install (Cross-Compiled, building on Windows is not supported yet): ```{r, engine='bash'} # Build ./btcputil/build-win.sh -j$(nproc) @@ -51,7 +51,7 @@ Install (Cross-Compiled, building on Windows is not supported yet) The exe will save to `src` which you can then move to a windows machine ### Mac -Get dependencies +Get dependencies: ```{r, engine='bash'} #install xcode xcode-select --install @@ -62,7 +62,7 @@ brew install cmake autoconf libtool automake coreutils pkgconfig gmp wget brew install gcc5 --without-multilib ``` -Install +Install: ```{r, engine='bash'} # Build ./btcputil/build-mac.sh -j$(sysctl -n hw.physicalcpu) @@ -76,17 +76,17 @@ About -------------- [Bitcoin Private](http://zclassic.org/), like [Zclassic](https://zclassic.org/) and [Zcash](https://z.cash/), is an implementation of the "Zerocash" protocol. -Based on Bitcoin's code, it intends to offer a far higher standard of privacy +Based on Zclassic's code, it intends to offer a far higher standard of privacy through a sophisticated zero-knowledge proving scheme that preserves confidentiality of transaction metadata. Technical details are available in the Zcash [Protocol Specification](https://github.com/zcash/zips/raw/master/protocol/protocol.pdf). This software is the Bitcoin Private client. It downloads and stores the entire history -of Bitcoin Private transactions; depending on the speed of your computer and network +of Bitcoin Private transactions. Depending on the speed of your computer and network connection, the synchronization process could take a day or more once the blockchain has reached a significant size. -It includes both `btcpd` (the daemon) and `btcp-cli` (the command line tools) +It includes both `btcpd` (the daemon) and `btcp-cli` (the command line tools). Security Warnings ----------------- From 916697eaa945304ab28328105812570051f64fe2 Mon Sep 17 00:00:00 2001 From: jc Date: Sat, 3 Feb 2018 09:55:16 -0500 Subject: [PATCH 3/9] add a difficulty bomb at height 600000 --- src/chainparams.cpp | 5 +++++ src/consensus/params.h | 2 ++ src/pow.cpp | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index fa0f24cf..7733effd 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -50,6 +50,7 @@ public: consensus.nPowMaxAdjustUp = 16; // 16% adjustment up consensus.nPowTargetSpacing = 2.5 * 60; consensus.fPowAllowMinDifficultyBlocks = false; + consensus.nPowDifficultyBombHeight = 600000; pchMessageStart[0] = 0xa8; pchMessageStart[1] = 0xea; @@ -209,6 +210,8 @@ public: consensus.powLimit = uint256S("07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow); consensus.fPowAllowMinDifficultyBlocks = true; + consensus.nPowDifficultyBombHeight = 600000; + pchMessageStart[0] = 0xf6; pchMessageStart[1] = 0x1b; pchMessageStart[2] = 0xf6; @@ -300,6 +303,8 @@ public: assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow); consensus.nPowMaxAdjustDown = 0; // Turn off adjustment down consensus.nPowMaxAdjustUp = 0; // Turn off adjustment up + consensus.nPowDifficultyBombHeight = 600000; + pchMessageStart[0] = 0xaa; pchMessageStart[1] = 0xe8; pchMessageStart[2] = 0x3f; diff --git a/src/consensus/params.h b/src/consensus/params.h index 9987f2e7..7d7c04ec 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -50,6 +50,8 @@ struct Params { int64_t AveragingWindowTimespan() const { return nPowAveragingWindow * nPowTargetSpacing; } int64_t MinActualTimespan() const { return (AveragingWindowTimespan() * (100 - nPowMaxAdjustUp )) / 100; } int64_t MaxActualTimespan() const { return (AveragingWindowTimespan() * (100 + nPowMaxAdjustDown)) / 100; } + + int nPowDifficultyBombHeight; }; } // namespace Consensus diff --git a/src/pow.cpp b/src/pow.cpp index 83e83e9e..837c1522 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -9,6 +9,7 @@ #include "chain.h" #include "chainparams.h" #include "crypto/equihash.h" +#include "main.h" #include "primitives/block.h" #include "streams.h" #include "uint256.h" @@ -23,11 +24,16 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params) { unsigned int nProofOfWorkLimit = UintToArith256(params.powLimit).GetCompact(); + unsigned int nProofOfWorkBomb = UintToArith256(uint256S("000000000000000000000000000000000000000000000000000000000000ffff")).GetCompact(); // Genesis block if (pindexLast == NULL) return nProofOfWorkLimit; + // difficulty bomb + else if(pindexLast->nHeight > params.nPowDifficultyBombHeight) + return nProofOfWorkBomb; + // Find the first block in the averaging interval const CBlockIndex* pindexFirst = pindexLast; arith_uint256 bnTot {0}; From 6a9c62705aa98bbd8ec081871877c65438f2aca3 Mon Sep 17 00:00:00 2001 From: sken Date: Thu, 15 Feb 2018 01:31:23 -0600 Subject: [PATCH 4/9] add windows cross compiling instructions --- README.md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f29221fa..3cb0be9f 100644 --- a/README.md +++ b/README.md @@ -35,20 +35,63 @@ Install: ``` ### Windows -Get dependencies: +There are two proven ways to build BTCP for Windows: + +* On Linux using [Mingw-w64](https://mingw-w64.org/doku.php) cross compiler tool chain. Ubuntu 16.04 Xenial is proven to work and the instructions is for such release. +* On Windows 10 (64-bit version) using [Windows Subsystem for Linux (WSL)](https://msdn.microsoft.com/commandline/wsl/about) and Mingw-w64 cross compiler tool chain. + +With Windows 10, Microsoft released a feature called WSL. It basically allows you to run a bash shell directly on Windows in an ubuntu environment. WSL can be installed with other Linux variants, but as mentioned before, the distro proven to work is Ubuntu. +Follow this [link](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide) for installing WSL first + +### Building for Windows 64-Bit +1. Get the usual dependencies: ```{r, engine='bash'} sudo apt-get install \ build-essential pkg-config libc6-dev m4 g++-multilib \ autoconf libtool ncurses-dev unzip git python \ - zlib1g-dev wget bsdmainutils automake mingw-w64 + zlib1g-dev wget bsdmainutils automake ``` -Install (Cross-Compiled, building on Windows is not supported yet): +2. Set the default ming32 gcc/g++ compiler option to posix + ```{r, engine='bash'} -# Build +sudo apt install mingw-w64 +sudo update-alternatives --config x86_64-w64-mingw32-gcc +sudo update-alternatives --config x86_64-w64-mingw32-g++ +``` + +3. Install Rust +```{r, engine='bash'} +curl https://sh.rustup.rs -sSf | sh +source ~/.cargo/env +rustup install stable-x86_64-unknown-linux-gnu +rustup install stable-x86_64-pc-windows-gnu +rustup target add x86_64-pc-windows-gnu +vi ~/.cargo/config +``` +and add: +``` +[target.x86_64-pc-windows-gnu] +linker = "/usr/bin/x86_64-w64-mingw32-gcc" +``` + +Note that in WSL, the BTCPrivate source code must be somewhere in the default mount file system. i.e /usr/src/BTCPrivate, and not on /mnt/d/. What this means is that you cannot build directly on the windows system + +4. Build for Windows + +```{r, engine='bash'} +PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var ./btcputil/build-win.sh -j$(nproc) ``` -The exe will save to `src` which you can then move to a windows machine + +5. Installation + +After building in WSL, you can make a copy of the compiled executables to a directory on your Windows file system. This is done the following way + +```{r, engine='bash'} +make install DESTDIR=/mnt/c/btcp/BTCPrivate +``` +This will install the executables to `c:\btcp\BTCPrivate ### Mac Get dependencies: From 0e8f79e8ab8e575f17b126578896da47fa4e04f2 Mon Sep 17 00:00:00 2001 From: sken Date: Thu, 15 Feb 2018 03:18:08 -0600 Subject: [PATCH 5/9] add sha256 checksum line for windows rust --- depends/packages/librustzcash.mk | 10 +++++++--- depends/packages/rust.mk | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/depends/packages/librustzcash.mk b/depends/packages/librustzcash.mk index e27adec2..e86c5505 100644 --- a/depends/packages/librustzcash.mk +++ b/depends/packages/librustzcash.mk @@ -7,13 +7,17 @@ $(package)_sha256_hash=a5760a90d4a1045c8944204f29fa2a3cf2f800afee400f88bf89bbfe2 $(package)_git_commit=91348647a86201a9482ad4ad68398152dc3d635e $(package)_dependencies=rust +# cargo build --release define $(package)_build_cmds - cargo build --release + cargo build --release --lib --target="x86_64-pc-windows-gnu" endef +# cp target/release/librustzcash.a $($(package)_staging_dir)$(host_prefix)/lib/ && \ +# + define $(package)_stage_cmds mkdir $($(package)_staging_dir)$(host_prefix)/lib/ && \ mkdir $($(package)_staging_dir)$(host_prefix)/include/ && \ - cp target/release/librustzcash.a $($(package)_staging_dir)$(host_prefix)/lib/ && \ + cp target/x86_64-pc-windows-gnu/release/rustzcash.lib $($(package)_staging_dir)$(host_prefix)/lib/librustzcash.a && \ cp include/librustzcash.h $($(package)_staging_dir)$(host_prefix)/include/ -endef +endef \ No newline at end of file diff --git a/depends/packages/rust.mk b/depends/packages/rust.mk index f61dd223..2c7a3156 100644 --- a/depends/packages/rust.mk +++ b/depends/packages/rust.mk @@ -2,7 +2,9 @@ package=rust $(package)_version=1.16.0 $(package)_download_path=https://static.rust-lang.org/dist $(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz +$(package)_file_name=rust-$($(package)_version)-x86_64-pc-windows-gnu.tar.gz $(package)_sha256_hash_linux=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd +$(package)_sha256_hash=523cd248363afdc4e2c0e1f219607897b6925294a33154d7e67224addfd15eb0 $(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz $(package)_sha256_hash_darwin=2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926 From a24aa1740884e607c55e978f9c65211f083a8e6c Mon Sep 17 00:00:00 2001 From: sken Date: Thu, 15 Feb 2018 17:26:29 -0600 Subject: [PATCH 6/9] add mingw-w64 dependency to read me --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3cb0be9f..bdb030fb 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Follow this [link](https://msdn.microsoft.com/en-us/commandline/wsl/install_guid sudo apt-get install \ build-essential pkg-config libc6-dev m4 g++-multilib \ autoconf libtool ncurses-dev unzip git python \ - zlib1g-dev wget bsdmainutils automake + zlib1g-dev wget bsdmainutils automake mingw-w64 ``` 2. Set the default ming32 gcc/g++ compiler option to posix From 3c07498cf04c37fd6a1fb2d1eae2b9f2cc9a7b1e Mon Sep 17 00:00:00 2001 From: floreslorca Date: Tue, 20 Feb 2018 22:44:39 -0600 Subject: [PATCH 7/9] fix rust make files to allow multiple builds --- README.md | 7 +++++-- depends/packages/librustzcash.mk | 15 +++++++++------ depends/packages/rust.mk | 6 +++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index bdb030fb..80fa2d2c 100644 --- a/README.md +++ b/README.md @@ -52,10 +52,13 @@ sudo apt-get install \ zlib1g-dev wget bsdmainutils automake mingw-w64 ``` -2. Set the default ming32 gcc/g++ compiler option to posix +2. Set the default ming32 gcc/g++ compiler option to posix, fix problem with packages in Xenial ```{r, engine='bash'} -sudo apt install mingw-w64 +sudo apt install software-properties-common +sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu zesty universe" +sudo apt update +sudo apt upgrade sudo update-alternatives --config x86_64-w64-mingw32-gcc sudo update-alternatives --config x86_64-w64-mingw32-g++ ``` diff --git a/depends/packages/librustzcash.mk b/depends/packages/librustzcash.mk index e86c5505..a1213bd8 100644 --- a/depends/packages/librustzcash.mk +++ b/depends/packages/librustzcash.mk @@ -6,18 +6,21 @@ $(package)_download_file=$($(package)_git_commit).tar.gz $(package)_sha256_hash=a5760a90d4a1045c8944204f29fa2a3cf2f800afee400f88bf89bbfe2cce1279 $(package)_git_commit=91348647a86201a9482ad4ad68398152dc3d635e $(package)_dependencies=rust +ifeq ($(host_os),mingw32) + rust_build=cargo build --release --lib --target="x86_64-pc-windows-gnu" + rust_target=target/x86_64-pc-windows-gnu/release/rustzcash.lib $($(package)_staging_dir)$(host_prefix)/lib/librustzcash.a +else + rust_build=cargo build --release + rust_target=target/release/librustzcash.a $($(package)_staging_dir)$(host_prefix)/lib/ +endif -# cargo build --release define $(package)_build_cmds - cargo build --release --lib --target="x86_64-pc-windows-gnu" + $(rust_build) endef -# cp target/release/librustzcash.a $($(package)_staging_dir)$(host_prefix)/lib/ && \ -# - define $(package)_stage_cmds mkdir $($(package)_staging_dir)$(host_prefix)/lib/ && \ mkdir $($(package)_staging_dir)$(host_prefix)/include/ && \ - cp target/x86_64-pc-windows-gnu/release/rustzcash.lib $($(package)_staging_dir)$(host_prefix)/lib/librustzcash.a && \ + cp $(rust_target) && \ cp include/librustzcash.h $($(package)_staging_dir)$(host_prefix)/include/ endef \ No newline at end of file diff --git a/depends/packages/rust.mk b/depends/packages/rust.mk index 2c7a3156..89b29505 100644 --- a/depends/packages/rust.mk +++ b/depends/packages/rust.mk @@ -2,12 +2,12 @@ package=rust $(package)_version=1.16.0 $(package)_download_path=https://static.rust-lang.org/dist $(package)_file_name_linux=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz -$(package)_file_name=rust-$($(package)_version)-x86_64-pc-windows-gnu.tar.gz $(package)_sha256_hash_linux=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd -$(package)_sha256_hash=523cd248363afdc4e2c0e1f219607897b6925294a33154d7e67224addfd15eb0 $(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz $(package)_sha256_hash_darwin=2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926 +$(package)_file_name_mingw32=rust-$($(package)_version)-x86_64-pc-windows-gnu.tar.gz +$(package)_sha256_hash_mingw32=523cd248363afdc4e2c0e1f219607897b6925294a33154d7e67224addfd15eb0 define $(package)_stage_cmds ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig -endef +endef \ No newline at end of file From 68af4746ce1a05de427249d3cc90300d6dfbe8a9 Mon Sep 17 00:00:00 2001 From: floreslorca Date: Wed, 21 Feb 2018 00:03:11 -0600 Subject: [PATCH 8/9] remove uneccessary steps --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 80fa2d2c..219ecffc 100644 --- a/README.md +++ b/README.md @@ -55,10 +55,6 @@ sudo apt-get install \ 2. Set the default ming32 gcc/g++ compiler option to posix, fix problem with packages in Xenial ```{r, engine='bash'} -sudo apt install software-properties-common -sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu zesty universe" -sudo apt update -sudo apt upgrade sudo update-alternatives --config x86_64-w64-mingw32-gcc sudo update-alternatives --config x86_64-w64-mingw32-g++ ``` From cffc74a8a0bbf144d5cc92c42d9015497a1f6ccb Mon Sep 17 00:00:00 2001 From: floreslorca Date: Wed, 21 Feb 2018 13:58:18 -0600 Subject: [PATCH 9/9] add notes for multiple build --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 219ecffc..35ca7126 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,10 @@ Install: ./src/btcpd ``` +### Additional notes + +If you plan to build for windows and linux at the same time, be sure to delete all the built files for whatever you build first. An easy way to do this is by taking the binaries out of the repo, delete all files except the .git folder and then do a git hard reset. + About --------------