I'm learning ZK by playing with @MinaProtocol, the 22kb ZK blockchain.
Getting started was easy, and the experience is polished--but during this process, they upgraded the testnet with breaking changes.
Keep reading for some highlights ๐๐งต
At the end of this, you'll be able to:
1๏ธโฃ Set up the needed tools
2๏ธโฃ Generate a local development environment
3๏ธโฃ Use a testnet faucet
4๏ธโฃ Develop and deploy a zk smart contract
5๏ธโฃ Interact with a zk smart contract
Because most people reading this are strongly related to Ethereum, I think it makes sense to make a parallel between Ethereum and Mina.
๐๐ฝ๐ฑ๐ฎ๐ป๐ฎ๐พ๐ถ
- code in Solidity
- code executes on nodes
- tx cost is variable
- stores data
- chain size increases
๐๐ฆ๐ซ๐
- code in TypeScript
- code executes locally, nodes verify a proof
- tx cost is constant
- computation and state are decoupled
- chain size is 22kb
A few notable points along the way.
๐ค The team was responsive and provided excellent support.
I enjoy learning about zero-knowledge proofs and how they can be used to build privacy-preserving applications.
Anyone can follow along by reading the GitHub repo. Everything is in there, thoughts, ideas, frustrations and full code ready to run.
๐ฆธ๐ผโโ๏ธ You can clone the repo and deploy the code on a local Mina network or the testnet.
github.com/EdenBlockVC/mina-research
๐๏ธ I started by installing the `zk` CLI app.
You can do that by running:
`npm i -g zkapp-cli`
Or you can do it the hacker way by cloning github.com/o1-labs/zkapp-cli and linking the package:
`npm i -g .`
I prefer the latter because I can edit the code if I need to.
Here's the `zk` help
๐ฐ They provide a faucet that is easy to use. When you first configure your project, `zk` generates a link with your public address prefilled.
faucet.minaprotocol.com/?address={youraddress}
A blockchain explorer exists, like Etherscan, but because of the zero-knowledge nature of the chain, it has very different information.
Here's the tx that funded my test account when it was in "pending mode".
berkeley.minaexplorer.com/
Deploying a contact is as easy as
Interacting with a zk smart contract is done by creating a script and running it locally.
While doing all this, the development team did a network upgrade, which brought some breaking changes.
The upgrade threw a wrench in my development cycle, but finally, I could push forward with the team's help.
I am still working through the documentation they shared. Thus, you should star the repo and follow my ongoing journey.
github.com/EdenBlockVC/mina-research