Namada tech ELI5: MASP and Convert Circuit mechanics
Quote1,105 words
Technical explainer of Namada's Multi Asset Shielded Pool, derived from Zcash Sapling, covering shielding, shielded transfers and unshielding, and the Convert Circuit, which pays a shielded-set subsidy through epoch-based conversions.
Key claims
Convert Circuit pays a pre-programmed subsidy via conversions across epochs, e.g. 1 NAM per 100 NAM held per epoch in the example
Observers cannot link nullifiers to notes or see sender, recipient, asset or amount
ELI5 on Namada’s Asset-Agnostic Privacy Solution
The promise of decentralization, fairness and transparency of public blockchains is great.
However, with transparency comes a lack of privacy.
That's a problem.
The next generation of users will not ask for privacy.
They will expect it.
Only few people want their private details broadcast in a public way, whether it is their financial transactions or health records and for many use cases privacy will be essential!
So let me introduce you to @namada, the next-gen asset-agnostic ZK privacy solution that makes privacy a public good within the multi-chain future! 🟡 🥷
⚠️ Pay attention, they are here to protect your ass too!
I have already published a high level introduction to Namada. So to familiarize yourself with their vision, mission and the high-level plan to execute on that, read up here! 👇
🔗 twitter.com/zerokn0wledge_/status/1719999499970724290
Today, the focus lies on explaining the technological foundation on top of which they are building their revolutionary asset-agnostic privacy solution:
A multi-asset shielded pool derived from ZCash’s Sapling circuit! 🥷
The Multi Asset Shielded Pool (MASP) Circuit stands at the core of the Namada network. As mentioned above, it is an extension of Sapling, a Zero Knowledge circuit (basically a way to prove a certain type of computation) created by the Electric Coin Company for Zcash. Namada’s extension includes added support for arbitrary assets.
So what does the MASP do? 🤔
It handles the minting and burning of shielded assets, known as notes, as they move between shielded and transparent Namada accounts.
But let’s dive in a bit deeper.
There exists two separate sets of assets:
🪙 The transparent set
🛡 The shielded set
Transparent Set 🪙
From a user's perspective, holding tokens in the transparent set is the same as holding tokens in any other transparent ecosystem. Users can transfer assets from one address to another, and bridge assets using the bridges deployed on Namada.
Shielded Set 🛡
From a user's perspective, all transactions within the shielded set appear the same. Specifically, a user can see the creation of notes and the revelation of nullifiers (objects that render notes unspendable), but cannot make any connections between nullifiers and notes, or between addresses and notes.
Additionally, all notes are indistinguishable in that observers of a transaction cannot discern who sent it, who received it, which asset was used in the transaction, or the amount that was sent.
Shielding Assets (🪙 ➡️ 🛡)
Assets are minted into the shielded set through a valid zero-knowledge proof that generates a "note". The zero-knowledge proof is designed to verify several things:
🟡 The asset type that will denote the note
🟡 The quantity of the asset
🟡 The address that owns the note
The underlying asset is then sent to escrow.
Transferring Assets 💸
Shielded-to-shielded transfers are facilitated by Zero Knowledge Proofs. These proofs verify the following:
🟡 The notes being utilized have not been spent before. 🟡 The notes being used were previously generated.
🟡 The user initiating the transaction has control over these notes.
🟡 The transaction maintains balance, meaning no assets are created or destroyed.
Moreover, due to their inherent Zero Knowledge property, these proofs do not disclose any additional information about the claims they aim to validate.
Unshielding Assets (🛡 ➡️ 🪙)
When a user unshields assets, they publicly reveal the information used in the minting process, along with its nullifier. After this information is verified, the user can claim ownership of the equivalent asset.
This asset is then released from escrow by a native Validity Predicate. The native VP checks that the proof is valid and that the asset has been updated to its latest epoch.
Convert Circuit (CC) 🔄
Namada includes two circuits:
🟡 Multi Asset Shielded Pool (MASP) Circuit
🟡 Convert Circuit (CC)
As explained above, the MASP circuit manages minting and burning of shielded assets, also known as notes.
In tandem with the MASP, the CC enables the conversion of assets in the shielded pool according to a public conversion table.
Fundamentally, the CC allows for asset conversion without compromising privacy by unshielding or disclosing metadata. These conversions, executed through a mint-and-burn mechanism, do not necessitate a liquidity pool or counterparty, resulting in actual conversions rather than swaps.
This feature is vital for any unified shielded pool. While the MASP does offer the advantage of a unified shielded set, which is particularly beneficial for low-volume trading assets, the CC expands privacy to a wider array of functions, as outlined in the applications section.
In Namada, the CC is structured to reward shielded assets stored in the shielded pool, acting as a subsidy to correct positive externalities.
The shielded set receives a subsidy to ensure that initial users are not dependent on a sufficiently large shielded set. Instead, a pre-programmed subsidy ensures that, regardless of the size of the shielded set, there is a significant incentive for assets to join the shielded set (will be explained another day).
On a high-level this is achieved through the following concept:
🟡 Each asset is linked to an epoch
🟡 Assets can be converted across epochs
🟡 The conversion factor is 1-to-(1 + additional subsidy in NAM tokens)
💡 Let’s have a look at a simplified example:
1⃣ Alice shields 100 NAM(epoch1) tokens in epoch 1.
▶️ Alice refers to the publicly available CC conversion table to calculate the relevant NAM tokens distributed as part of Namada's subsidy for holding assets in the privacy set. This table shows that she gets 1 NAM for every 100 NAM she holds in the shielded set per epoch.
2⃣ In epoch 2, Alice makes a shielded transfer through the convert circuit. This gives her 100 NAM(epoch2) plus an additional 1 NAM(epoch2), for a total of 101 NAM(epoch2).
There are many different applications for this type of technology outside of the realm of providing inflationary subsidies. Below, I list some thoughts about potential ideas:
🟡 Shielded taxation
🟡 Crowdfunding and voting
🟡 Shielded prediction markets
🟡 Shielded borrowing/lending protocol
🟡 More!
🚧 Last but not least: As a member of the Namada Community Builder program, I am currently covering Namada in an extensive post series. Last week I covered:
🟡 Namada’s Unified Privacy Set: twitter.com/zerokn0wledge_/status/1721940962027389429
🟡 Seeding Privacy using Namada: twitter.com/zerokn0wledge_/status/1722297902427766877
🟡 Shielded Actions with Namada: twitter.com/zerokn0wledge_/status/1722684428781339026
That’s a wrap for today! 🥷
I hope you found this walkthrough helpful! 🫡
I will cover some of these use cases in more depth over the next few days & weeks! 👀
Make sure to follow me @zerokn0wledge_ and @namada to learn more on this amazing technology! ✨
Any support in the form of RT/Comment also highly appreciated! 🙏
QUOTING @zerokn0wledge_
Shielded Actions with Namada What if there was a way to interact with all your favourite dApps entirely privately? 🥷 Well, with @namada there soon will be! 🚧 Let me introduce you to shielded actions on Namada and how you can use them to preserve your financial privacy when eng
Shielded Actions with Namada What if there was a way to interact with all your favourite dApps entirely privately? 🥷 Well, with @namada there soon will be! 🚧 Let me introduce you to shielded actions on Namada and how you can use them to preserve your financial privacy when eng
3 images on X
What came next · since 13 Nov 2023
Since then
Zero has written 6 more pieces on $NAM since this one.
- Namada's free market launch: why a fully liquid day-one token was deliberateBullish call on $NAM
- Namada: the multi-asset shielded pool and its valuation gap to ZEC and XMRBullish call on $NAM
- NAM listing: Namada as Zcash on steroids at a fraction of ZEC valuationBullish call on $NAM
- Namada mainnet phase 5: shielded pool, MASP and selective disclosureCovers $NAM