Skip to content

clevelandmarcus/suterusu-protocol-public

 
 

Repository files navigation

Suterusu Protocol

Suterusu Protocol is a protocol that allows users to protect payment anonymity and confidentiality on the Ethereum network. It includes a set of backend contracts that maintain funds and actions on funds in encrypted forms, and a series of correspoding frontend user algorithms to interact with the contracts. Suterusu supports both ETH and any ERC20 token. On the high level, Suterusu can be viewed as an agency that workds on encrypted ETH and ERC20 tokens, and whose confidentiality and anonymity are guaranteed by well-established cryptographic techniques.

Suterusu currently supports deployment on three environments: Ethereum mainnet, Huobi ECO Chain (HECO), Binance Smart Chain (BSC).

We briefly introduce the main functionalities below (using ERC20 as an example).

Register

User inputs his or her private secret and the algorithm will generate a Suterusu public/private key pair. The Suterusu public key will be sent in a transaction to register an account in the contract.

Register the Suterusu public key, and initialize the corresponding account status.

Fund

Create a transaction to convert a specified amount of the user's ERC20 tokens to an equivalent amount of encrypted Suterusu ERC20 tokens.

  1. Add the specified amount to the account's encrypted balance.
  2. Transfer the specified amount of ERC20 tokens from the message sender to the contract.

Transfer

Create a transaction to transfer a specified amount of the user's ERC20 tokens from the current user to a receiver. Note that the transaction will include necessary cryptographic zero-knowledge proof to guarantee that this is a valid transfer operation.

  1. Verify that this operation is valid: the sender has sufficient balance, and the same amount is deducted from the sender's account and added to the receiver's account.
  2. Transfer a specified encrypted amount of balance from a sender to a receiver

Burn

Create a transaction to convert a specified amount of the user's encrypted Suterusu ERC20 tokens back to an equivalent amount of plain ERC20 tokens. Note that the transaction will include necessary cryptographic zero-knowledge proof to guarantee that this is a valid burn operation.

  1. Verify that this operation is valid: the account has sufficient balance.
  2. Deduct the specified amount of tokens from the account's encrypted balance;
  3. Transfer the specified amount of ERC20 tokens from the contract to the message sender.

Environment Setup

  1. Install node.js and npm (on MacOS)
brew install node 
  1. Install Truffle
npm install -g truffle
truffle version
  1. Install OpenZeppelin contracts. At the root of this project,
npm install openzeppelin-solidity
  1. Install web3, bn.js, elliptic. At the root of this project,
npm install web3
npm install bn.js
npm install elliptic
  1. Install Ganache for launching a test blockchain.

Compile and Test

  1. Compile the contract
truffle compile
  1. Deploy the contract to the test blockchain of Ganache
truffle migrate --reset
  1. Run the test (located at ./test/suter_eth.js)
truffle test

Local Installation of Suterusu Client

Git clone the repository:

git clone https://github.com/zjk89757-suter/Suterusu-Protocol.git

Link the Sutersusu module to the global node_modules directory:

cd Suterusu-Protocol
npm link

In any project where you want to use Suterusu, link the globally installed Suterusu to the local node_modules directory:

## Run this command in your other project root
npm link suterusu 

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.5%
  • Solidity 6.2%
  • HTML 0.3%