There seems to be a lot of misconceptions about so-called "turnstile protection" in Zcash & Ycash. Given this week's disclosure of an inflation bug in Zcash's Orchard pool (Ycash never adopted Orchard), these misconceptions merit further discussion.
The pool turnstile enforces the rule that the number of coins that leave the shielded pool cannot be greater than the number of coins that entered the shielded pool.
However, the pool turnstile does NOTHING to protect against inflation bug exploits where the ill-gotten artificial coins remain strictly contained WITHIN a given shielded pool. That is, if an attacker exploits an inflation bug to artificially mint a million coins, there's no way to detect that via the turnstile UNTIL the collective withdrawals of the attacker and innocent pool users violate the turnstile.
Thus,
@zodl_co and
@peacemongerZ's assertion that the turnstile "protects the integrity of the 21M supply cap" is only true in the event of a mass exodus of coins from the shielded pool at issue. In that event, the turnstile will block any transfer that violates the above-mentioned rule, and the amount of artificially-minted coins will be stuck in the pool forever.
(Note that it's not guaranteed that the attacker's artificially-minted coins will be the coins that end up getting stuck in the pool. Rather, those that are the last to leave will be the ones who end up with stuck coins. If the attacker exits first, innocent holders will lose their coins by virtue of their coins being stuck.)
So short of a mass exodus from the Zcash Orchard pool, the turnstile does NOT "protect the integrity of the 21M supply cap" and there is no way to rule out a violation of the 21M coin cap via an exploit of the disclosed Zcash Orchard pool vulnerability.
Be wary of anyone that labels this post as Zcash FUD. There's little incentive for Ycash supporters to promote Zcash FUD because Zcash going to $10K would be good for Ycash. (Just look at how the rise in the price of Zcash over the last 8 months has likely contributed to the rise in the price of Ycash.)
This post is the TRUTH, no matter how inconvenient. Privacy via shielding is fantastic, but the price you pay is a lack of complete observability with respect to the integrity of the supply cap. You have to trust the zero knowledge infrastructure, and in the case of the Zcash Orchard pool there was a vulnerability in that infrastructure.
Ultimately, sober assessments of the tradeoff between privacy & observability will empower individuals to make their own informed decisions about how to allocate their assets across Bitcoin, Zcash, Ycash, and other digital assets. Godspeed. 🙏