Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tangle-network/anon
A mixer for Substrate using multiple zero-knowledge backends.
https://github.com/tangle-network/anon
blockchain cryptography ring-signatures ristretto substrate zero-knowledge
Last synced: about 2 months ago
JSON representation
A mixer for Substrate using multiple zero-knowledge backends.
- Host: GitHub
- URL: https://github.com/tangle-network/anon
- Owner: tangle-network
- License: apache-2.0
- Created: 2019-08-29T16:55:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-20T23:13:45.000Z (about 2 years ago)
- Last Synced: 2024-11-11T00:18:13.888Z (3 months ago)
- Topics: blockchain, cryptography, ring-signatures, ristretto, substrate, zero-knowledge
- Language: Rust
- Homepage:
- Size: 348 MB
- Stars: 35
- Watchers: 6
- Forks: 9
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Webb Anon
πΈοΈ The Webb Anon Node π΅οΈββοΈ
β οΈ Under Heavy Development β οΈ
β¨ Substrate based Mixer w/ Relayable transactions using bulletproofs & arkworks compatible zk-(S)NARKs β¨.
**For an updated architecture of this project, check out [darkwebb-substrate](https://github.com/webb-tools/darkwebb-substrate)**.
## Overview π
At the highest-level, this is a cryptocurrency mixing pallet that uses both trusted and non-trusted π€ setup [zero-knowledge proofs](https://en.wikipedia.org/wiki/Zero-knowledge_proof) to facilitate mixing operations. It uses the bulletproofs library built from [dalek-cryptography](https://github.com/dalek-cryptography) to handle non-trusted zkNARKs and [arkworks](https://arkworks.rs) libraries to handle trusted-setup Groth16 proofs. The repo contains pallets that allow for creation of merkle trees with elements in Curve25519, Bn254, and BLS381's scalar field and a mixer that utilises these merkle trees to build an on-chain application or protocol.
### Pallet documentation π
To generate the docs for the entire repo, run:
```
cargo doc --open
```
To generate the docs for individual pallets and present it, run:
```
cd pallets/pallet-
cargo doc --open
```
These commands will both generate the rustdocs site and open it in your default browser. The compiled docs will be located at `/target/doc/`### Dependencies π§±
The library utilises a variety of zero-knowledge primitives, gadgets, circuits, etc. that are all implemented using bulletproofs R1CS api with Curve25519. You can find more about the components below and descriptions following thereafter:
- π [Bulletproof zero-knowledge gadgets](https://github.com/webb-tools/bulletproof-gadgets)
- π [Arkworks zero-knowledge gadgets](https://github.com/webb-tools/arkworks-gadgets)
- π§ββοΈ [Transaction Relayer](https://github.com/webb-tools/relayer)
- π§° [Mixer CLI](https://github.com/webb-tools/cli)
- π₯οΈ [Mixer dApp](https://github.com/webb-tools/webb-dapp)
- π [Webb.js SDK](https://github.com/webb-tools/webb.js)### Architecture ποΈ
The architecture for the project is as follows:
We have pallets in this repo and a Substrate chain for running this runtime logic. We developed zero-knowledge gadgets that expose a prover and a verifier for interacting with this runtime. Specifically, we embed the gadget's verifiers on-chain so that proofs can be verified on-chain to eliminate any trust involved in mixing currencies. Users are responsible with generating proofs, using the tools in the gadget repo, off-chain and broadcasting these proofs to the network using a signed extrinsic or a live relayer.
Relayers are used to relay transactions on behalf of users. This is necessary because extrinsics normally charge a fee for submission and so we enable a "fee-less" experience by allowing users to offload extrinsic submission to a third-party relayer who can submit transactions on behalf of users who wish to remain more anonymous. Note that there should still be more work put into the fee-mechanism to ensure that relayers are incentivised to run such a service in production.
### Tools π οΈ
The flow for integrating these tools into your Substrate project are fairly straightforward. You will add the pallets of interest to your Substrate project and follow the runtime implementations necessary to get your node to compile. From there, you will have integrated a mixer to your Substrate project.
It is possible by extending your dApp with our types in our Typescript API to have this functionality in a front-end application for users to interact with. It is also possible to run a transaction relayer to submit withdrawal transactions from the mixers on behalf of users. Please refer to the documentation in these respective projects when facing issues and asking questions.
## Build π·
Install Rust π¦:
```bash
curl https://sh.rustup.rs -sSf | sh
```Initialize your Wasm Build environment:
```bash
./scripts/init.sh
```Build Wasm and native code:
```bash
./scripts/build.sh
```## Test π¦
Testing zero-knowledge functionality should all be handled in `--release` mode. This is due to optimisations on cryptographic operations that ensure your tests complete in a timely manner.```bash
./scripts/test.sh
```## Run π
### Single node development chain
Simply Run:
```bash
./scripts/start.sh
```Or, you could, first by purge any existing developer chain state:
```bash
./target/release/webb-node purge-chain --dev
```and then, start a development chain with:
```bash
./target/release/webb-node --dev
```## Using Docker π³
We have a 3 pipelines right now, one for the main/master branch and this should be the stable release, and one is `edge` from the `develop` branch:
1. Pull the Docker Image
```bash
$ docker pull ghcr.io/webb-tools/anon:edge # change edge to latest for the master branch
```2. Run the node using docker
```bash
$ docker run --rm -it --network host ghcr.io/webb-tools/anon:edge webb-node --dev
```
This will run the node in dev mode, **without** saving any state, that is easy for testing and development.## Safety β‘
This crate uses `#![deny(unsafe_code)]` to ensure everything implemented in
100% Safe Rust.## Contributing π§βπ€βπ§
Want to join us? take a look at some of these issues:
- [Issues labeled "good first issue"][good-first-issue]
- [Issues labeled "help wanted"][help-wanted][good-first-issue]: https://github.com/webb-tools/anon/labels/good%20first%20issue
[help-wanted]: https://github.com/webb-tools/anon/labels/help%20wanted## License
Licensed under Apache 2.0.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this crate by you, as defined in the `Apache 2.0` license, shall
be licensed as above, without any additional terms or conditions.