Skip to content

HeisenbergLin22/faceless_delivery_May

Repository files navigation

Faceless

This repository contains code and resources for the Faceless project implemented on the Dfinity platform.

If you want to start working on the project right away, you might want to try the following commands:

cd faceless_dfinity/
dfx help
dfx canister --help

Crypto Implementation

Anonymous Identity-Based Encryption

An implementation of a variant of the following scheme:

  • Dan Boneh and Matthew K. Franklin. Identity-based encryption from the weil

pairing. SIAM J. Comput., 32(3):586–615, 2003.

Implemented here.

BN254 Curve (alt_bn128)

An implementation of the alt_bn128 curve that is almost the same as the zeropool-bn repository, but with some fixes to be applicable in our faceless protocol.

BulletProof

An implementation of the BulletProof zero-knowledge protocol based on BN254 curve.

Environment setup

# Install Rust
curl --tlsv1.2 https://sh.rustup.rs -sSf | sh
# Install dfx SDK
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"

Unit tests

cd aibe

# Test the anonymous identity-based encryption
cargo test test_bf_ibe -- --show-output

# Test the withdrawal proof generation and verification
cargo test test_zk_withdraw -- --show-output

# Test the transfer proof generation and verification
cargo test test_zk_transfer -- --show-output

Code of the above three unit tests are located in:

Faceless Backend Canister

The Faceless backend canister is located here.

Please use the test_scripts, where you can also see the backend canister logics.

# Depoly the canisters
./test_scripts/depoly.sh

# Run the encrypted anonymous transfer procedure
./test_scripts/encrypted_transfer.sh

Using the Faceless Frontend

# If you don't have Node.JS, you have to install it, like:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
nvm install node

# At this Faceless project root
# Install latest yarn
npm i -g yarn@latest
yarn set version stable

# build the faceless wasm wrapper
cd src/faceless_frontend
cargo install --force --version 0.10.3 wasm-pack
wasm-pack build faceless-wasm-wrapper --target web
cd ../../

yarn
yarn build

# Deploy the canisters
./test_scripts/deploy.sh

# View the website
yarn dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published