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).
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.
Create a transaction to convert a specified amount of the user's ERC20 tokens to an equivalent amount of encrypted Suterusu ERC20 tokens.
- Add the specified amount to the account's encrypted balance.
- Transfer the specified amount of ERC20 tokens from the message sender to the contract.
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.
- 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.
- Transfer a specified encrypted amount of balance from a sender to a receiver
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.
- Verify that this operation is valid: the account has sufficient balance.
- Deduct the specified amount of tokens from the account's encrypted balance;
- Transfer the specified amount of ERC20 tokens from the contract to the message sender.
- Install node.js and npm (on MacOS)
brew install node
- Install Truffle
npm install -g truffle
truffle version
- Install OpenZeppelin contracts. At the root of this project,
npm install openzeppelin-solidity
- Install
web3
,bn.js
,elliptic
. At the root of this project,
npm install web3
npm install bn.js
npm install elliptic
- Install Ganache for launching a test blockchain.
- Compile the contract
truffle compile
- Deploy the contract to the test blockchain of Ganache
truffle migrate --reset
- Run the test (located at
./test/suter_eth.js
)
truffle test
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