Inspiration

PoolTogether is a crypto-powered savings protocol based on Premium Bonds. Save money and have a chance to win every week. In PoolTogether, the user deposits funds in the pool and has a chance to win a prize awarded every day. If the user doesn't win, he can withdraw the deposited money.

Prize draws at PoolTogether are transparent: anyone can easily find who won the draw and how much x person has won. As depositing and withdrawing user address is identical. Hence ZkPoolTogether

ZkPoolTogether is the ZKP version of PoolTogether; using zero-knowledge proof systems will protect users' identity and the amount users are depositing.

What it does

ZKPT protects users' identities. Users can easily deposit funds in the ZKPoolTogther, and while remaining in the pool, the user will earn extra incentives for the lottery.

Suppose you want to use a mixer and earn a lottery without revealing your identity. Then, ZKPoolTogther can also be considered a mixture of Tornado Cash and PoolTogether.

How we built it

  • Circuits: Circom, Groth16, Snarkjs, Circom Tester

  • Contracts: Solidity, Hardhat, Ethers, Typechain

  • Server: Defender Oppenzeppline

  • Client: NextJs, ChakraUI, Emotion, Ethers, SWR

Challenges we ran into

There are multiple challenges I ran into during the ZkPoolTogether.

  • Lack of circom development tool and resources
  • Designing circom circuits
  • During development, I face the issue of how we know a person X has bought a ticket of the X draw, and we cannot map anything in the smart contract as it leaks the user's knowledge. So I came up with the solution of adding to add the guess a number which resulted in a draw winning

Accomplishments that we're proud of

The accomplishment I'm proud of is the first time I have developed the whole application and architecture, from zero-knowledge circuits to smart contracts and the frontend application. It was fun and also challenging development the entire application from scratch.

What we learned

During the development of the ZKPoolTogether, I learned a lot about the ZKP development and the circom, especially how to design an architecture of the zero-knowledge DApp and think while writing circom circuits like what to make private and what we can make public. Integrating the snarkJs wasm file with the frontend was also challenging.

What's next for ZK-POOLTOGETHER

In the future, ZKPT will bring multiple features and enhancements into the development.

  • More strategy pools
  • chainlink vrf
  • time ticker on draw page
  • Ui enhancement

Built With

  • chakra-ui
  • circom
  • ethers
  • hardhat
  • next
  • openzeppelin
  • react
  • snarks
  • solidity
  • vercel
  • web3
Share this project:

Updates