By: Regina Wong, O(1) Labs Developer Relations Engineer, Mina Protocol Contributor
On Crypto Twitter, investors frequently post screenshots to boast about their trading performance. However, with Photoshop and other editing platforms, it’s easier than ever to falsify trades. With the power of zero-knowledge proofs, a trader can prove their trade performance (as % profit) to others without disclosing their private information, such as the amount of funds traded.
Recognizing the power of proving and verifying one’s trading track record, our team decided to build a zkApp for it.
What are zkApps?
zkApps (“SNARK apps”) are Mina’s zero-knowledge-powered smart contracts.
They are a type of decentralized application (dapp) that uses cryptography to prove knowledge without revealing all pieces of information. More specifically, zkApps use the power of zk-SNARKs, or zero-knowledge Succinct Non-interactive Arguments of Knowledge, to let users control data on their own terms. You can find more details about the scalability and privacy features of zkApps in the official docs, video, and blog post.
There are many use cases for zkApps. You can verify your credit score without revealing your social security number or prove your ownership of a property without sharing your identity. The list goes on and can be applied to DeFi, NFTs, etc. For now, we will start with Proof of Alpha where you can prove your trading profit % without sharing the amount of funds traded.
What is Proof of Alpha?
Proof of Alpha is how we refer to our zkApp that verifies profit percentage on cryptocurrency or stock trades. In our particular application, we will be focusing on cryptocurrency.
In the finance industry, wealth advisors and investors commonly share information about the performance of their investments or the profitability of their trades to prove credibility or share accomplishments. With the influx of investing influencers on social media, it’s now especially common for individuals to share screenshots of their trading brokerage accounts, such as in the examples below:
However, sharing trading history online comes with risks. An investor who shares a trade publicly may reveal the amount of assets they own as well as where their assets are stored. This can make the owner of this trade a target for malicious attacks.
Sharing trading history also puts the general public at risk. Since digital images are forgeable and difficult to verify, it’s easy to share false information about past trades. This can mislead people and put them at risk to make poor financial decisions.
Why We Are Building This
There are many ideas for zkApps that will benefit greatly from Mina’s scalability and privacy. In this case, our Proof of Alpha zkApp provides a new way for the cryptocurrency community to share historical financial returns without revealing the exact amount involved. It provides privacy as well as legitimacy for users on social media.
While the target users for this zkApp will mainly be cryptocurrency investors for entertainment or content purposes, this zkApp shows the power of being able to prove something without revealing related sensitive information, such as the amount of funds one owns.
How It Works
The Proof of Alpha zkApp lets anyone prove and verify trade profit % made on an exchange. For this initial version, our zkApp will be proving trading profit % for trades made on Binance.
Here’s how the zkApp works:
Step 1 — Enter your API key, found in your account profile on Binance, to pull your trade history from the exchange. This zkApp uses a read-only function with the minimal permission required to pull trade history. In other words, Binance will only share trading data with the zkApp. The zkApp cannot access your personal information, make trades, or take any other actions on your account.
Step 2 — Select your trade’s token pair (e.g. BTC-USDT) and date range. Using the API key, the zkApp will pull your trading history and generate a proof for your cumulative profit %. Next, it will send a zkApp transaction containing the proof to the Mina blockchain.
Step 3 — After sending the zkApp transaction, containing the proof, to the Mina network, the Mina network will verify the proof. If the proof is valid, the transaction will be accepted by the Mina network.
While this is happening, the zkApp generates a tweet that you can share on social media. The tweet contains an image that shows your proven trade profit % without revealing any sensitive information, such as the amount traded.
Step 4 — Any follower can verify your claim by clicking the link in your tweet. The link goes to a page on the zkApp that can provide more details about your trade as well as a link to see the zkApp transaction on Mina Explorer. Followers can see whether the transaction was accepted or rejected. If the transaction is accepted, it means your trade profit % claim is true.
The initial goal behind building this zkApp is to build something everyone can use to experience the power of zero-knowledge proofs.
Having a zkApp that verifies trading profit % can help influencers gain respected credit. Eventually, we hope Mina can empower anyone to verify and prove something without revealing related sensitive information such as health records, personal identification records, voting records, and more.
We have an internal version of the Proof of Alpha application and are now working to release it to the developer community as a reference zkApp. Alongside this particular zkApp, we are working hard to implement learnings from the recent zkApps Bootcamp to improve the overall developer experience with better documentation and to optimize SnarkyJS, the TypeScript library for writing zkApps.
Interested dapp developers can start learning how to build, write, and deploy zkApps like this Proof of Alpha zkApp in this workshop recording. You can also learn more about zkApps and follow the developer documentation here.
Keep up to date on all zkApps news by subscribing to the Mina Protocol newsletter.