Skip to content

carmarsha/zen

 
 

Repository files navigation

Zend

What is Horizen?

Horizen is an inclusive and scalable platform where everyone is empowered and rewarded for their contributions. Horizen's sidechain platform enables real-world applications mapped onto a public blockchain architecture with the largest node network in the industry. Horizen's Sidechain-SDK provides developers with all the necessary components to deploy their own fully customizable blockchains on Horizen's open sidechain protocol, Zendoo.

zend - the Zendoo-powered node implementation for Horizen ($ZEN).

zend is the official Horizen mainchain client, fully supporting Horizen's sidechains system. It implements the Zendoo verifiable Cross-Chain Transfer Protocol (CCTP) that allows the creation of ad-hoc sidechains with independent and customizable business logic.

Horizen Sidechains are fully scalable, secure, and decentralized:

  • The Cross-Chain Transfer Protocol (CCTP) enables coin transfers between the sidechains and the mainchain without knowing their internal structure and without additional software to track them. Those transfers are performed using cryptographically authenticated certificates received from the sidechains.
  • Certificate authentication and validation are achieved through the innovative use of zk-SNARKs. Thanks to this technology, the resulting zero-knowledge proofs have a constant and succinct size. Horizen can verify proofs of arbitrary computations and can remain agnostic of the sidechains' use-cases and rules.
  • This technology makes Horizen's sidechain system trustless.

You can read more about the Zendoo protocol in our whitepaper, and explore a reference sidechain implementation in our Sidechains-SDK.

Top features

INTERACTION

  • RPC interface for general access to data and all available functions

SECURITY

  • Proof-of-Work, the most secure consensus, ensured by one of the largest node networks in the industry
  • Base58 address check, protecting from money getting lost in case of typos
  • 51% attack protection
  • Replay attack protection
  • Sidechains state provability, powered by zk-SNARKs
  • TLS end-to-end encryption - Available for Secure and Super nodes

PRIVACY

  • Shielded transactions, powered by zk-SNARKs
  • Privacy-preserving sidechains supported out-of-the-box, powered by zk-SNARKs

SCALABILITY

  • Extended RPC interface to create and dispatch sidechain declaration, forward transfers, mainchain backward transfer requests, ceased sidechain withdrawals, and certificates.
  • Sidechain declaration with customizable zk-SNARK verification key
  • Sidechain epoch management with liveness monitoring and ceasing procedure
  • Mainchain backward transfer request support for sidechains, to collect Zen back on a mainchain address
  • Agnostic certificate validation via custom zk-SNARK proof verification (powered by ginger-lib)
  • Secure sidechain validator's key rotation support via custom zk-SNARK proof verification
  • Support for variable epoch lengths (enabling non-ceasable sidechains)

Compatibility

zend only supports 64-bit little-endian systems, it cannot be compiled on different architectures.

Building from source

  1. Get dependencies:

    1. Ubuntu
    sudo apt-get install \
    build-essential pkg-config libc6-dev m4 g++-multilib \
    autoconf libtool ncurses-dev unzip git python \
    zlib1g-dev bsdmainutils automake curl cmake
    

    For a detailed list of dependencies, please refer to the dependencies section.

    1. Mac OS
    xcode-select --install
    brew install \
    autoconf coreutils automake libtool pkg-config cmake
    
    1. Cross compilation for Windows target
    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 cmake
    
  • Install for Linux
git clone https://github.com/HorizenOfficial/zen.git
cd zen
# Build
./zcutil/build.sh -j$(nproc)
# Build for platforms without adx, bmi2 CPU flags
./zcutil/build.sh --legacy-cpu -j$(nproc)
# Fetch key
./zcutil/fetch-params.sh
# Run
./src/zend
  • Install for Mac OS (using clang)
# Build. Add -jN parameter (where N is the number of cpu cores) to speed up compilation.
./zcutil/build-mac-clang.sh
  • Install for Windows (Cross-Compiled, building on Windows is not supported yet)
sudo update-alternatives --config x86_64-w64-mingw32-g++
(chose: /usr/bin/x86_64-w64-mingw32-g++-posix)

export HOST=x86_64-w64-mingw32
./zcutil/build.sh -j$(nproc)

Running Regression Tests

  1. Get dependencies:

    1. Ubuntu
    sudo apt-get install \
    python python-dev python-pip python-setuptools \
    python-wheel python-wheel-common python-zmq
    pip install --upgrade websocket-client requests
    
    1. MacOS
    brew install python
    pip install --upgrade pyzmq websocket-client requests
    
  2. Start test suite

    if [[ "$OSTYPE" == "darwin"* ]]; then
      TEST_ARGS="btest gtest sec-hard no-dot-so util-test secp256k1 libsnark univalue rpc --rpc-extended --rpc-exclude=rpcbind_test.py"
    else
      TEST_ARGS="--rpc-extended"
    fi
    export HOST=$(gcc -dumpmachine)
    ./zcutil/fetch-params.sh
    ./qa/zcash/full_test_suite.py ${TEST_ARGS}
    

Security Warnings

See important security warnings in doc/security-warnings.md.

zend is experimental and a work in progress. Use at your own risk.

Need Help?

Help is available at Horizen's Discord #open-a-ticket channel.

Want to Participate in Development?

  • Code review is welcomed!
  • Please submit any identified issues here
  • Enroll in the Horizen Early Adopter Program HEAP to take part in new product and feature testing

Participation in the Horizen project is subject to a Code of Conduct.

License

For license information see the file COPYING.

Releases

No releases published

Packages

No packages published

Languages

  • C++ 67.7%
  • Python 20.2%
  • C 6.5%
  • M4 1.5%
  • Shell 1.4%
  • Makefile 1.2%
  • Other 1.5%