X-Cash Core Blockchain
⚠We are switching from CryptoNight PoW consensus algorithm to our own Delegated-Proof-of-Private-Stake (DPOPS) !
👉Follow the development on the
Table of Content
Based and improved upon the renowned CryptoNote protocol, X-Cash aims at becoming the standard in digital payment and transaction settlement:
X-Cash proposes the flexibility to send a transaction privately or publicly, directly from your wallet by toggling a simple switch, without compromising your privacy.
Have a look at our
📜Hybrid Transactions' yellow paper to learn more about the technology behind it.
Delegated Proof of Private Stake (DPOPS)
To tackle scalability and future upgrades while reducing the energy comsuption of the network, we are developing a customized and unique DPOS consensus that can be implemented in any privacy coin.
Interested ? Read more about our
📜Delegated Proof-of-Private-Stake yellow paper to learn more about the technical challenge of integrating this consensus on a Monero-based privacy coin.
Delegates will be able to host sidechains on the X-Cash network, providing an easy, secured, economical and customizable blockchain solution to match your project needs.
X-Cash is an open-source project managed by the X-Cash Foundation.
We are operating under the MIT License.
We are hosting our documentation on GitBook
You can contribute directly on our
If you discover a security vulnerability, please send an e-mail to firstname.lastname@example.org.
All security vulnerabilities concerning the X-Cash blockchain will be promply addressed.
The following table summarizes the tools and libraries required to build.
A few of the libraries are also included in this repository (marked as "Vendored").
By default, the build uses the library installed on the system, and ignores the vendored sources. However, if no library is found installed on the system, then the vendored source will be built and used. The vendored sources are also used for statically-linked builds because distribution packages often include only shared library binaries (
.so) but not static library archives (
If you need to build statically linked linux binaries, please refer to Build Statically Linked Linux Binaries guide before you install any packages
|Dep||Min. version||Vendored||Debian/Ubuntu pkg||Arch pkg||Fedora||Optional||Purpose|
^ On Debian/Ubuntu,
libgtest-dev only includes sources and headers. You must
build the library binary manually. This can be done with the following command:
sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libg* /usr/lib/
Note: If you want to build with unit test (
make release) you need
libgtestto be compiled with fPIC. To do this, install libgtest using your package manager then run the following command to rebuild using fPIC:
cd /usr/src/gtest && sudo sed -i 's/CMAKE_CXX_FLAGS:STRING=/CMAKE_CXX_FLAGS:STRING=-fPIC/g' CMakeCache.txt && sudo sed -i 's/CMAKE_C_FLAGS:STRING=/CMAKE_C_FLAGS:STRING=-fPIC/g' CMakeCache.txt && sudo cmake . && sudo make && sudo mv libg* /usr/lib/
Cloning the repository
$ git clone https://github.com/X-CASH-official/xcash-core
X-CASH uses the CMake build system and a top-level makefile that invokes cmake commands as needed.
Linux and OS X
- Install the dependencies
- Change to the root of the source code directory and build:
cd X-CASH make
Optional: If your machine has several cores and enough memory, enable parallel build by running
make -j<number of threads>instead of
For this to be worthwhile, the machine should have one core and about 2GB of RAM available per thread.
cmakecan not find
zmq.hppfile on OS X, installing
zmq.hppfrom https://github.com/zeromq/cppzmq to
/usr/local/includeshould fix that error.
The resulting executables can be found in
Run X-CASH with
(optional) Build and run the test suite to verify the binaries:
core_teststest may take a few hours to complete.
- (optional) To build binaries suitable for debugging:
- (optional) To build statically-linked binaries:
Dependencies need to be built with
-fPIC. Static libraries usually aren't, so you may have to build them yourself with
Refer to their documentation for how to build them, as well as refer to the Build Statically Linked Linux Binaries guide
Build Statically Linked Linux Binaries
Note: this guide is only for Ubuntu
- Only install the following packages from the package manager if you want to build statically linked linux binaries:
sudo apt update sudo apt install -y build-essential cmake pkg-config libunbound-dev libsodium-dev libldns-dev libexpat1-dev doxygen graphviz sudo apt-get -y install libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libg* /usr/lib/
- You will also need to install these additional packages
sudo apt install -y libsystemd-dev libudev-dev libtool-bin autoconf
Create build directories for
pcsclite. The reason these are not installed in the system directory is so you can keep your systems install, and have these at the same time. You can create these folders wherever and name them whatever.
mkdir BOOST_BUILD_DIR mkdir OPENSSL_BUILD_DIR mkdir PCSC_LITE_BUILD_DIR
cd BOOST_DIRECTORY ./bootstrap.sh --prefix=BOOST_BUILD_DIR sudo ./b2 cxxflags=-fPIC cflags=-fPIC -a install -j `nproc`
cd OPENSSL_DIRECTORY ./config -fPIC --prefix=OPENSSL_BUILD_DIR --openssldir=OPENSSL_BUILD_DIR make depend make -j `nproc` sudo make install
cd PCSC-LITE_DIRECTORY ./configure CPPFLAGS=-DPIC CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=-fPIC --enable-static --prefix=PCSC_LITE_BUILD_DIR make -j `nproc` sudo make install
cd LIBZMQ_DIRECTORY /autogen.sh ./configure CPPFLAGS=-DPIC CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=-fPIC make -j `nproc` sudo make install sudo ldconfig cd /usr/local/include/ wget -q https://raw.githubusercontent.com/zeromq/cppzmq/master/zmq.hpp
- Now you can build the binaries statically using the following commands
cd X-CASH rm -r build mkdir -p build/release cd build/release cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D BUILD_TESTS=ON -D BOOST_ROOT=BOOST_BUILD_DIR -D OPENSSL_ROOT_DIR=OPENSSL_BUILD_DIR -D USE_READLINE=OFF -D CMAKE_BUILD_TYPE=release ../.. cd ../../ make -IBOOST_BUILD_DIR/include -IOPENSSL_BUILD_DIR/include -IPCSC_LITE_BUILD_DIR/include LDFLAGS="-LBOOST_BUILD_DIR/lib -LOPENSSL_BUILD_DIR/lib -LPCSC_LITE_BUILD_DIR/lib" -j `nproc`
Binaries are built on Windows using the MinGW toolchain within MSYS2 environment. The MSYS2 environment emulates a POSIX system. The toolchain runs within the environment and cross-compiles binaries that can run outside of the environment as a regular Windows application.
Preparing the build environment
Download and install the MSYS2 installer, either the 64-bit or the 32-bit package, depending on your system.
Open the MSYS shell via the
Update packages using pacman:
Exit the MSYS shell using Alt+F4
Edit the properties for the
MSYS2 Shellshortcut changing "
msys2_shell.bat" to "
msys2_shell.cmd -mingw64" for 64-bit builds or "
msys2_shell.cmd -mingw32" for 32-bit builds
Restart MSYS shell via modified shortcut and update packages again using pacman:
- Install dependencies:
- Build for 64-bit Windows:
pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium
- Build for 32-bit Windows:
pacman -S mingw-w64-i686-toolchain make mingw-w64-i686-cmake mingw-w64-i686-boost mingw-w64-i686-openssl mingw-w64-i686-zeromq mingw-w64-i686-libsodium
- Open the MingW shell via
MinGW-w64-Win64 Shellshortcut on 64-bit Windows or
MinGW-w64-Win64 Shellshortcut on 32-bit Windows.
Note: If you are running 64-bit Windows, you will have both 64-bit and 32-bit MinGW shells.
- For 64-bit system, run:
- For 32-bit system, run:
- The resulting executables can be found in
Building portable binaries
By default, in either dynamically or statically linked builds, binaries target the specific host processor on which the build happens and are not portable to other processors.
# Build binaries on Linux on x86_64 portable across POSIX systems on x86_64 processors make release-static-linux-x86_64 # Builds binaries on Linux on x86_64 or i686 portable across POSIX systems on i686 processors make release-static-linux-i686 # Builds binaries on Linux portable across POSIX systems on armv8 processors make release-static-linux-armv8 # Builds binaries on Linux portable across POSIX systems on armv7 processors make release-static-linux-armv7 # Builds binaries on Linux portable across POSIX systems on armv6 processors make release-static-linux-armv6 # Builds binaries on 64-bit Windows portable across 64-bit Windows systems make release-static-win64 # Builds binaries on 64-bit or 32-bit Windows portable across 32-bit Windows systems make release-static-win32
The build places the binary in
bin/ sub-directory within the build directory
cmake was invoked (repository root by default). To run in
To list all available options, run:
Options can be
specified either on the command line or in a configuration file passed by the
--config-file argument. To specify an option in the configuration file, add
a line with the syntax
argumentname is the name
of the argument without the leading dashes, for example
To run in background:
./bin/xcashd --log-file xcashd.log --detach
To run as a
systemd service, copy
/etc/. The example
service assumes that the user
and its home is the data directory specified in the example
If you're on Mac, you may need to add the
--max-concurrency 1option to
xcash-wallet-cli, and possibly
xcashd, if you get crashes refreshing.
🔗 MAIN LINKS
- X-Network: x-network.io
- X-Cash: x-network.io/xcash
- Block explorer: explorer.x-cash.org
- Medium: medium.com/x-cash
- Help Center: Help Portal
- Mining: /xcash/mining/