akinama3 / zero-chain

A privacy-protecting blockchain on Substrate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Zerochain

Build Status Gitter

Zerochain is a privacy-preserving blockchain on substrate. It is designed to get efficient zero-knowledge proving, reduce the on-chain storage cost and bring the flexibility for developing applications.

Status

WARNING: Zerochain is alpha quality software, improvements and fixes are made frequently, and documentation for technical details doesn't yet exist.

For now, only supported for the "confidential payment PoC".

  • Balance for each account is encrypted
  • Transfer amount is encrypted

More features will be added... 💪💪

Usage

Initial Setup

curl https://sh.rustup.rs -sSf | sh

rustup update stable
rustup update nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
cargo +nightly install --git https://github.com/alexcrichton/wasm-gc

You will also need to install the following packages:

  • Mac:
brew install cmake pkg-config openssl git llvm
  • Linux:
sudo apt install cmake pkg-config libssl-dev git clang libclang-dev

Building

git clone git@github.com:LayerXcom/zero-chain.git
cd zero-chain
./build.sh
cargo build --release

A brief tutorial for Sending transactions

This tutorial will explain the basic confidential transfer on Zerochain. Alice has the encrypted balance of 100 coins and sends encrypted 10 coins to Bob. So, Alice's balance will be 90 coins and Bob will get the 10 coins. All operations are done encrypted by ElGamal encryption and zk-SNARKs.

  1. Setup for zkSNARKs from CLI
  • Get the proving key and the veifying key for zk-SNARKs
./target/release/zero-chain-cli setup
  1. Run the nodes
./target/release/zero-chain --dev
  • If you want to clear your old chain's history:
./target/release/zero-chain purge-chain --dev
  1. Run the UI apps

The UI repository is here: https://github.com/LayerXcom/zero-chain-ui

  1. Generate the transaction from CLI
  • Generate the transaction components (Computing a zero-knowledge proofs and an encryption)
./target/release/zero-chain-cli generate-tx
  • For more information (if you want to set the customized amount and address)
./target/release/zero-chain-cli generate-tx --help
  1. Fill out the form:

You can send the transaction from firefox browser.

Documentations

Contributing

  • Feel free to submit your own issues and PRs
  • For further discussions and questions talk to us on Gitter

Maintainers

About

A privacy-protecting blockchain on Substrate

License:GNU General Public License v3.0


Languages

Language:Rust 99.7%Language:Shell 0.3%