ZEC10 #02 🛡️ How does a shielded ZEC transaction actually work?
I've been digging deeper into Zcash, and one question kept coming to mind:
How can a blockchain verify a payment without exposing who sent it, who received it, or how much was sent?
Let's break it down. 🧵👇
1/ It starts with a note.
In Zcash, shielded funds are represented by something called a note.
Think of it as a private record of value that your wallet can receive and spend.
The important part? The blockchain doesn't simply publish the note's private details for everyone to see.
2/ The blockchain records a commitment.
When a shielded note is created, Zcash publishes a note commitment.
Think of it as a cryptographic fingerprint of that note.
The network can record its existence without openly revealing the amount or recipient.
These commitments are organised into a Merkle tree, helping the system verify that a note belongs to the recognised set.
3/ Now comes the interesting part: zk-SNARKs.
The network still needs to verify that you can spend your funds and that your transaction follows the rules.
Zcash uses zero-knowledge proofs to help prove that the transaction is valid without publicly revealing the protected payment details.
In simple terms, the network can verify the payment without needing to expose the private information behind it.
4/ But how does Zcash prevent double-spending?
Meet the nullifier.
When a shielded note is spent, a corresponding nullifier is revealed.
The network checks whether it has already been used. If someone tries to spend the same note twice, the second attempt gets rejected.
This helps prevent double-spending without publicly identifying the original note.
5/ What happens to the recipient's funds?
The transaction contains encrypted output information.
The recipient's wallet uses the appropriate keys to identify and decrypt the payment meant for them.
So the recipient can access their funds, while an ordinary blockchain observer can't simply read the same private payment details.
Even shielded memos can carry encrypted information.
6/ The transaction still goes on-chain.
This is where people sometimes get it wrong.
A shielded transaction doesn't disappear from the blockchain.
The network records it and verifies that it follows the rules.
Observers can still see public data, including note commitments and nullifiers. But in a fully shielded transaction, the sender, recipient and amount aren't directly revealed in the usual readable way.
7/ Does that mean complete anonymity? Not exactly.
Transparent inputs or outputs can reveal information, and activity outside the blockchain can still give observers clues.
Zcash provides tools for on-chain financial privacy, but how you use them matters.
Understanding what stays private and what doesn't is a big part of understanding Zcash.
8/ Here's what fascinates me about all this.
Zcash isn't simply trying to hide transactions.
It's tackling a bigger question:
How do you keep a financial system verifiable without making everyone's financial activity an open book?
Notes, commitments, nullifiers, encryption and zero-knowledge proofs all work together to make that possible.
I'm still learning, and that's exactly why I started this journey.