All Projects → HarryR → Ethsnarks Miximus

HarryR / Ethsnarks Miximus

Licence: gpl-3.0
Example project for EthSnarks - Miximus coin mixer

Projects that are alternatives of or similar to Ethsnarks Miximus

Awesome Privacy On Blockchains
A curated list of privacy on blockchains resources
Stars: ✭ 86 (+48.28%)
Mutual labels:  ethereum, cryptocurrency, privacy, anonymity
Bbt Multiminer
Start different miners from the same script. Easy and simple to get started with mining. Originally by Bits Be Trippin'
Stars: ✭ 33 (-43.1%)
Mutual labels:  ethereum, cryptocurrency
Whoami
Whoami is a Linux privacy tool developed to keep you anonymous at the highest level.
Stars: ✭ 858 (+1379.31%)
Mutual labels:  privacy, anonymity
Identity Wallet
Code for the SelfKey Identity Wallet
Stars: ✭ 36 (-37.93%)
Mutual labels:  ethereum, cryptocurrency
Etgate
Ethereum-Tendermint token sending gateway
Stars: ✭ 23 (-60.34%)
Mutual labels:  ethereum, cryptocurrency
Aeternity
æternity: solving scalability problems by making sense of state-channels
Stars: ✭ 923 (+1491.38%)
Mutual labels:  ethereum, cryptocurrency
Cryptolights
Live visualisation of blockchain transactions for popular cryptocurrencies
Stars: ✭ 54 (-6.9%)
Mutual labels:  ethereum, cryptocurrency
Wallet Core
Cross-platform, cross-blockchain wallet library.
Stars: ✭ 657 (+1032.76%)
Mutual labels:  ethereum, cryptocurrency
Cryptex
Gemini, GDAX, Bitfinex, Poloniex, Binance, Kraken, Cryptopia, Koinex, BitGrail and CoinMarketCap cryptocurrency exchange API clients in Swift / iOS SDK. Check prices and account balances using Sample iOS app.
Stars: ✭ 51 (-12.07%)
Mutual labels:  ethereum, cryptocurrency
Qtum
Qtum Core Wallet
Stars: ✭ 1,080 (+1762.07%)
Mutual labels:  ethereum, cryptocurrency
Blockchainage
「区块链技术指北」相关资料。
Stars: ✭ 51 (-12.07%)
Mutual labels:  ethereum, cryptocurrency
Uniswap V2 Core
🎛 Core smart contracts of Uniswap V2
Stars: ✭ 889 (+1432.76%)
Mutual labels:  ethereum, cryptocurrency
Blockchain Reading List
Blockchain Manchester Meetups, Talks and Reading List
Stars: ✭ 17 (-70.69%)
Mutual labels:  ethereum, cryptocurrency
Finch
An Open Source Cryptocurrency Payment Processor.
Stars: ✭ 27 (-53.45%)
Mutual labels:  ethereum, cryptocurrency
Cryptocurrency Arbitrage
A cryptocurrency arbitrage opportunity calculator. Over 800 currencies and 50 markets.
Stars: ✭ 836 (+1341.38%)
Mutual labels:  ethereum, cryptocurrency
Shapeshift
ShapeShift API for Go Language - convert cryptocurrencies with ease using ShapeShift and golang
Stars: ✭ 35 (-39.66%)
Mutual labels:  ethereum, cryptocurrency
Openapi
DragonEx OpenAPI
Stars: ✭ 54 (-6.9%)
Mutual labels:  ethereum, cryptocurrency
Kelp
Kelp is a free and open-source trading bot for the Stellar DEX and 100+ centralized exchanges
Stars: ✭ 580 (+900%)
Mutual labels:  ethereum, cryptocurrency
Monero
Monero: the secure, private, untraceable cryptocurrency
Stars: ✭ 6,503 (+11112.07%)
Mutual labels:  cryptocurrency, privacy
Nipe
An engine to make Tor network your default gateway
Stars: ✭ 1,032 (+1679.31%)
Mutual labels:  privacy, anonymity

Miximus

Build Status

Miximus is a self-service coin mixer and anonymous transfer method for Ethereum, it accepts deposits of 1 ETH, then allows you to withdraw coins by providing a zkSNARK proof that proves you know the spend key for one unspent coin without revealing which one it is.

For more information, see:

The zkSNARK prover is built as a native library which can plug-in to your application, when provided with the correct arguments it returns the zkSNARK proof as JSON. While you may think of zkSNARKs as being slow - the algorithms chosen for Miximus mean proofs can be made in 5 seconds, however we're still studying their security properties.

Building

The following dependencies (for Linux) are needed:

  • cmake 3
  • g++ or clang++
  • gmp
  • libcrypto
  • boost
  • npm / nvm

For OSX

Requires Brew and nvm.

make git-submodules # Pull sub-repositories
make -C ethsnarks mac-dependencies
make -C ethsnarks python-dependencies
nvm install --lts
make

For Ubuntu:

make git-submodules # Pull sub-repositories
sudo make -C ethsnarks ubuntu-dependencies
make -C ethsnarks python-dependencies
nvm install --lts
make

For CentOS / Amazon:

yum install cmake3 boost-devel gmp-devel
nvm install --lts
make git-submodules # Pull sub-repositories
make -C ethsnarks python-dependencies
make CMAKE=cmake3

How It Works

Miximus Diagram

Alice wants to transmit 1 coin to Bob

  1. Bob gives Alice the hash of a secret that only he knows
  2. Alice sends 1 ETH to the 'Deposit()' method of the Miximus smart contract, with that hash
  3. The 'Coin' gets inserted into a merkle tree of coins, all coins are 1 ETH
  4. Bob makes a zkSNARK proof, using the secret, that proves he owns that coin The proof includes an unlinkable 'spent tag', which prevents the same coin being spent twice
  5. Bob sends the Proof and the 'spent tag' to the Withdraw() method of the Miximus smart contract
  6. If the coin hasn't been spent, the contract deposits 1 ETH to Bob

Technical Details

For Alice to send a coin to Bob she needs the hashed secret from Bob. Bob makes the random secret (a random field element, modulo the zkSNARK prime being used):

coin_secret = FQ.random()

Bob passes the hash of that secret to Alice:

bobs_leaf = H(coin_secret)  # Generated using `MakeLeafHash()` method of the smart-contract

Alice sends bobs_leaf with the Deposit, this is the leaf of the Merkle tree of coins. Bob can see when Alice has made his deposit by monitoring the OnDeposit event of the smart contract. Only Bob knows the secret, so only Bob can make a successful zkSNARK proof.

Bob fetches the Merkle tree path from the smart contract (without doing an on-chain transaction, as that would reveal his coin) using the leaf_index parameter in the OnDeposit event and the GetPath() method of the smart-contract, along with the current merkle root from the GetRoot() method.

Bob fetches his external_hash from the smart contract using GetExtHash(), this is a hash of the contract address and his Ethereum address. It means that only his account can submit the proof he generates to that specific smart contract, preventing re-plays and other malicious activity.

Circuit Pseudo-code

Only the external_hash, nullifier and merkle_root parameters are public and observable on-chain, the rest are secret inputs for the zkSNARK proof.

def circuit(secret, path_var, address_bits, nullifier, root, external_hash, pub_hash):
   assert H(root, nullifier, external_hash) == pub_hash
   leaf_hash = H(secret) # Prove we know the secret for the leaf
   assert root == merkle_authenticate(path_var, address_bits, leaf_hash) # Prove that leaf exists within the tree
   assert H(address_bits, secret) == nullifier

The circuit verifies:

  • that the leaf exists within the merkle tree
  • that prover knows the secret for that leaf
  • that the nullifier (spent tag) is derived from the leaf and the

And because this is a zkSNARK proof, all of this is done without revealing to anybody else which exact leaf it is within the tree, but if Bob tries to make two proofs for the same leaf (even using different Merkle roots) the nullifier will be the same - preventing him from double-spending.

Miximus doesn't use keys (or secp256k1), it just uses secrets and hashing. The zkSNARK proof allows you to prove you know what the secret is, without revealing it to anybody. The hash function used is MiMC, it operates over a prime field rather than on bytes and bits.

Maintainers

@HarryR

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].