How Can #Soulbound Tokens AND #ZeroKnowledge Tech Be Integrated?
In the final instalment of this 3-part series, we present our implementation of private Soul Bound Tokens (SBT) using #zkSNARK tech👇
For the devs, the #Solidity code included below!
1/ Check out the full article below:
medium.com/@spartanlabs/t…
2/ In part 1 of the series, we went through the WHAT and WHY of SBTs and the design guidelines around them 👇
3/ In part 2 of the series, we went through the different implementations of Soul Bound Tokens to ensure that data stored within them would remain private, following design principles 🔓
4/ To ensure that users are not doxxed, privacy is a cornerstone of SBT implementation.
Storing sensitive data off-chain would keep data hidden. However, this would also expose the data to a new set of vulnerabilities and attack vectors!
Enter #Zero-Knowledge Technology.
5/ The use of Zero-Knowledge (ZK) technology is key in reducing the sharing of secrets to keep users' SBT data truly private.
ZK tech has been commonly used in L2 Rollups like @0xPolygonHermez, @Scroll_ZKP, @StarkWareLtd and @zksync @zksync which are key players in this space.
6/ What ZK tech does is that it allows one party to prove to another that a statement is true, without revealing any information beyond the validity of the statement itself.
Basically, prove that you know what the information is, without revealing the information itself.
7/ This might sound a little confusing, but let us demonstrate with the familiar puzzle game of Where's Waldo!
Suppose you are tasked to prove that you knew where Waldo was in an image, but without revealing where Waldo actually was.
How can you achieve that?
8/ A simple way would be to cut out Waldo from the scene but only show the verifier the cut-out Waldo snippet.
To ensure that this is the right Waldo, the verifier can watermark the back of Waldo’s page before the proof.
9/ Using this method, Waldo's coordinates relative to the rest of the scene is still unknown, and you have successfully proven you know where's Waldo without revealing where and how you found Waldo.
10/ So you might be thinking now, how can we use the concept of #ZK proofs with SBT?
In this context, the proof would show if a user's SBT data satisfies certain criteria instead of proving knowledge of Waldo's location.
And the secret lies within the SBT data itself.
11/ In order words, projects can validate the attributes of a Soul by using ZK proofs (e.g., that it has certain memberships).
They can also do so by allowing users to verify arbitrary assertions without giving any further information other than the statement itself.
12/ For example, #zkSNARK could allow someone to enter the club by proving that they are older than 18 years old without revealing their actual age!
In simple terms, this means that with ZK tech, any project can verify the attributes of a user without knowing the actual data.
13/ Why is this important?
For greater Web3 adoption in various use cases, storing of users’ KYC data on-chain is critical.
However, this has been challenging as on-chain data exposes users to doxxing and potential malicious attacks.
14/ How does #ZK tech solve this?
By masking the data whilst still making data publicly verifiable, ZK tech is able to prevent attacks and allow for interactions to be made on-chain securely.
15/ ZK tech will allow for a #Web3 future where we reap the benefits of traditional interdependent economic relations while maintaining anonymity.
We can encode social relationships in Web3 as in Web2, while maintaining privacy and reducing dependency on Web2 infrastructure.
16/ Using credit scores as an example, the Credit Bureau currently just reveals the exact credit score when it is requested.
With zkSBT, we are able to encode credit checking mechanisms on-chain but with better privacy.
17/ In this case, the specific credit score is concealed but any protocol will still be able to verify if users have a credit score which is above a particular threshold.
18/ How can we actually implement zkSBT?
We chose to use #zkSNARK as our ZK mechanism. This stands for Zero-Knowledge, Succinct, Non-interactive Argument of Knowledge.
In simple terms, this means that the proof can be independently verified without the prover's involvement.
19/ Using the user’s sensitive data, we can generate a proof that hides the user’s data but allows anyone to verify attributes of the data.
You can find more information in the tweet thread below 👀
20/ The full code for zkSBT is linked below 👇
The code shows how we can mask sensitive credit scores on-chain, but still allow other protocols to interact with the masked credit score to see if it meets a certain threshold.
github.com/SpartanLabsXyz…
21/ Huge thanks to @identhree for their SDK and @0xPARC for the starting template. Without these tools, creating #zkSNARK tools would take a lot more time.
22/ I know we said 3-part series…
But!
Next week, we are realising @vitalikbutherin's vision with our demo showcasing how we can easily create and implement zkSBTs to unlock the potential of a #decentralised society.
Stay tuned, I wouldn't miss this if I were you!
23/ Have a radical idea for a SoulBound Token use case? Feel free to share below!
Or if you are interested in integrating SBT into your project, we’d also love to hear from you!
24/ Interested to hear from you guys about your thoughts on our implementation of zkSBT!
@DefiIgnas
@vitalikbutherin
@iamjasonlevin
@glenweyl
@proofofhumanity
@getmasafi
@goldfinch_fi
@binance
@eddylazzarin
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.
