Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.
/ zDai-mixer Public archive

zDai.io - confidential Dai transactions on Burner wallet

License

Notifications You must be signed in to change notification settings

zdai-io/zDai-mixer

Repository files navigation

zDai.io - private Dai transactions on Burner wallet

Logo

Idea

What problem do you solve?

We add a privacy layer to the burner wallet running on the xDai sidechain.

Why is it important?

As (hopefully) everyone noticed, we are using here web wallets with buffiDai, which is pegged to Dai and deployed on the xDai sidechain from POA to buy food, merch, drinks, art, some unusual things(ask me about it after the presentations – I will be happy to share my dealer network)

Our team loves Burner's usability and xDai's fast transaction times, but there is one problem we are bothered with: each vendor whom I pay can see the history of my transactions and as you already understand our buying patterns cry for a privacy layer to be added.

Luckily we can solve this issue.

Why did we choose to work on the xDAI chain?

On a serious note, buffiDai wasn’t our primary motivation to build on top of the xDAI chain. There are several reasons why it is an ideal marriage between SNARKs and everyday use cases:

• In xDAI, block times take 5 seconds. Transaction fees (gas costs) paid in DAI (=USD) are minimal, so it is cost-savvy and excellent for running our SNARKS verification (as opposed to doing it on Ethereum mainnet) • xDai chain takes the full functionality of Ethereum-based blockchains and can leverage all our open-source tools so that we could add our plasma to the existing POA Network’s tools and infrastructure.

What will happen to the project after hackathon?

We see poor usability as the main roadblock for cryptocurrency adoption, especially in not so techy developing countries where it is most needed. So we hope our solution will make micropayments private and safe. We are looking forward to further collaborate on it with MakerDAO and POA community.

Zero Knowledge Challenges accepted 😎

User-flow

We are bringing privacy to Burner wallet (all functionality is impemented directly in Burner wallet fork) and DAI infrastructure with confidential micropayments. 😎

Steps:

  • Open Burner wallet fork by link: zdai.io 📱
  • Exchange xDAI to zDAI 💱
  • Send confidential private transaction ⤴️
  • ... Take a cup of ☕️, while zkSNARK proof is calculating (approx 1 minute)
  • Profit!!! 🎉

What we'he has done:

  • Smart contract (link)

    • utxo based model
    • proover for snarks
  • integration tests (Snarks + smart contracts) (link)

  • trusted setup for 3 snarks (link)

    • deposit
    • Transfer
    • Exit
  • Backend with snarks prover

  • deploy script for the smart contract (R)

  • Fork burner

  • extra tool

DEMO:

Worked public version of Wallet: zDai.io

Contract Deploy:

Contract_Deploy

Sokol testnet transaction

Sokol testnet transaction

Burner fork with zDAI

Burner fork with zDAI

TBD & Future steps:

  • Do Trusted setup (Sonic/zCash)
  • Server side - is just a temporary thing, if we build snarks on Belman - we can put in in the mobile device directly! It takes around 2-3 MB

Tech Scpec

Tests:

node cicruit/Transation_test.js

Tech spec:

Output:

  • hash: balance + salt + owner = pederson hash

Example:

{ balance: 498617225799240496206585797313701272018n,
      salt: 940710224613798208468773453036456n,
      owner: 835765502661709741278231205743827595544796746504n }

input:

  • in_salt - Double spend proof: slat is a random data generated with tx, to check unspent utxo further (spending utxo salt going to blacklist)
  • all_in_hashes - 10 inputs to hide real input. (if you do more entropy - you can send tx to yourself), or we can put more in the snark.
  • our_hash: 2 outputs - classic utxo outputs

in_selcetor: pick correct input and output.

Out balance example:

[ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ],
  [ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 ] ],

Our contract in POA Network Sokol.

https://blockscout.com/poa/sokol/address/0x97c931f57e2b1582d629fb52e0aaa82b7a19c9f0/transactions

Here are just 3 transactions now: deposit, transfer and withdrawal.

Links:

About

zDai.io - confidential Dai transactions on Burner wallet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published