We have been strongly inspired by off-chain scaling solutions like state channels, plasma and we decided to try to dip our toes in a more complex scaling approach using zk-SNARKS. This idea came after attending the zksummit02 in Berlin and seing related work of others, like BarryWhiteHat's roll_up library.

What it does

zknifty is an experiment in using an implementation of zero-knowledge merkle tree proofs to facilitate bulk transactions of non-fungible tokens on Ethereum. The bulk-transfer has a fix on-chain cost for arbitrary number of tokens in exchange of heavy off-chain computation. This is an interesting scaling approach that could significantly increase the number of transaction possible on blockchain platforms like Ethereum.

How we built it

We used libsnark library and forked the roll_up library by @BarryWhiteHat. Using these tools, we build the backend that generates the zk-snark proof, build the merkle tree, deploy the smart contract and we also build a simple UI to display the functionality of token transfer using this scheme.

Challenges we ran into

Advance cryptography is hard! Especially with the limitation of Ethereum and blockchain technologies in general. The lack of tools, documentation and tutorials was impressive, but this forced us dig deep into the technology.

Accomplishments that we're proud of

It works! We can transfer many tokens for a fix gas price and as a side effect we have a partially privacy preserving non-fungible token contract. There is still a lot to do, but we learned a lot during the process.

What we learned

Learned a lot about zk-snarks, elliptic curve cryptography, circuit design, parallel computing and much more.

What's next for zknifty

Make it easy to deploy for anyone that wants to try out its potential and add documentation so it can serve as educational content. Create standard tools so that other projects can start integrating such functionality for their smart contracts.

Built With

Share this project: