How Zerocoin Works in 5 Minutes

turtle flax
5 min readJun 8, 2018

--

Zerocoin works a bit differently than other cryptocurrency privacy protocols, so let’s break it down. First, the two types of tokens:

PIV— The normal PIVX token
zPIV — The private PIVX token

Are PIV and zPIV different?
Yes and no. You can think of zPIV like the private version of a PIV. 1 zPIV will always equal 1 PIV in value. There is no second blockchain or anything like that.

Mint — To convert PIV to zPIV
Spend —To convert zPIV to piv

Denominations — The different sizes of zPIV. Think of this like your paper money which comes in 1s, 5s, 10s, 50s, 100s, etc.

Let’s use Zerocoin

Step 1 — The Mint
So you want to mint a portion of your PIV to zPIV, our private token. This is done before you want to spend it privately, as will be explained in step 2. When you mint your coins, you are sending them to an “accumulator” where nobody will ever be able to spend them. In blockchain terms, this is called “burning” coins, but why would you want to burn your coins?

You complete this burn in exchange for an IOU from the network, which is called zPIV. If you burned 10piv, you get 10 zPIV. The IOU means the network allows you to redeem your 10 zPIV later in step 3 for 10 fresh PIV. This is what a mint looks like on the block explorer.

Step 2 — Time Passes
In the Zerocoin protocol there is an enforced gap in time between the mint and the spend. If the mint and spend happened at the same time, you would only be mixing your coins with anyone else currently mixing (perhaps nobody). The gap in minting and spending means your coins are mixed with all other coins that have ever been minted to that denomination.

Step 3 — The Spend
At some point in the future, you probably want to spend your private coins. You can now spend some of your zPIV to any address just like you would spend normal PIV, and they will appear in the destination address as newly generated PIV with no history or connection to you. This is what it looks like on the block explorer.

You may have heard of Zero Knowledge Proofs (ZKP) and this is where that comes in. ZKP basically means demonstrating you know something without revealing what it is. In this case, you are demonstrating that you minted the coins you’re spending without revealing which coins they trace back to.

Graphic by ElysiumCoreX

To use The Prestige as an analogy:
Act 1- The PIV
Act 2- The mint (the coins disappear from the blockchain)
Act 3- The spend (brand new coins appear in the address where you spend them)

Exclusive PIVX Zerocoin Features

PIVX has pioneered several enhancements to Zerocoin to create the most advanced implementation on the market. The following features were created by PIVX and are only available with PIVX or recent forks of PIVX code.

zPoS
In May 2018, PIVX released zPoS (Zerocoin Proof of Stake) which is the only private staking system in crypto. It incentivizes the use of privacy and helped PIVX attain the highest percentage of private supply of any ZK privacy-based coin. This is what a zPoS reward looks like on the block explorer

dzPIV
Those zPIV you got in Step 1 are saved in your local wallet.dat, completely off the blockchain, how’s that for privacy? In most Zerocoin systems, this means you need to make new backups of your wallet.dat after every mint, which is a huge hassle and easy to screw up. PIVX is not most Zerocoin implementations. PIVX is the only coin to offer one-time seed backups with a feature called dzPIV (deterministic zPIV).

ezPIV
You encrypted your wallet.dat file like you were supposed to right? You might be surprised to learn most Zerocoin coins do not protect your zPIV with this encryption, so anyone who can get a hold of your wallet.dat file can get your zerocoins even if the wallet.dat is encrypted. PIVX is the only coin to encrypt your zPIV and protect them with it’s ezPIV feature (encrypted zPIV).

Automint
There’s only 3 steps in the process, but PIVX takes care of the first of the first 2 automatically for you. The PIVX automint will automatically mint 10% of your piv to zPIV. This percentage is configurable from 0 to 100, but it’s a nice way to make sure you’ve always got private coins ready to spend.

The Smallest Spend Sizes
A drawback to many privacy mechanisms is large transaction sizes, with Zerocoin being the largest at 25kb. Compared to Bitcoin’s ~266 bytes per transactions this is quite large. PIVX launched their Zerocoin protocol with 20% smaller spend sizes, which means less blockchain bloat, lower fees, and shorter sync time. Author of Bulletproof technology Jonathan Bootle has joined the PIVX team and expects to be able to reduce this another 90% to about 1kb.

The First to Allow Fractional Spends
It was not previously possible to spend part of a zerocoin, but PIVX allows you to spend zPIV and get your change back.

The First to Spend to 3rd Parties
The original Zerocoin protocol had you spend your zerocoins back to your own wallet before sending them to the destination. When PIVX launched Zerocoin in August, 2017, it allowed spends directly to any destination address for the first time. ZCoin also has this capability as of June 3rd, 2018.

--

--