# What is Zcash? All You Need to Know.

Zcash is a decentralized peer-to-peer cryptocurrency. It was made as a split of Bitcoin and very like bitcoin it likewise has a hard breaking point of 21 million coins. In any case, that is the place the examination closes. Not at all like bitcoin, Zcash offers finish and aggregate security for their clients using some improved cryptography.

In this way, how about we investigate the hood and see what goes ahead in the background.

# The Origins of ZCash

As we have said previously. Zcash began as a split of the bitcoin on October 28, 2016. previously it was known as the Zerocoin protocol before it was changed into the Zerocash system and eventually, Zcash.

- As the Zcash Wikipedia page states: “
**Development of protocol improvements and the reference implementation is led by the Zerocoin Electric Coin Company, colloquially referred to as Zcash Company.**“

The Founder, CEO, and the main impetus behind Zcash is Zooko Wilcox.

Picture Credit: Z.Cash

# How Does Zcash Work?

**“Zcash is another blockchain and cryptographic money which permits private exchanges (and by and large private information) in an open blockchain. This permits organizations, buyers, and new applications to control who gets the chance to see the points of interest of their exchanges, even while utilizing a worldwide, authorization less blockchain.” – Zooko Wilcox**

How does a typical bitcoin exchange happen?

Assume, Alice needs to send Bob 1 BTC, what will she do?

She will send 1 BTC to Bob’s open address. The miners at that point put the exchange specifics inside their blocks and the exchange is considered finished.

The question then, what is the difference between the transaction in Zcash and the transaction in bitcoin?

In the first place, how about we take a gander at a graphic representation of a Zcash exchange:

Picture Credit: Fossbytes

What do we get from that image?

In Zcash, you have a decision to pick between two sorts of exchanges.

You can either do the typical straightforward exchange OR you can do the protected private exchange.

Assume Alice needs to send 1 Zec to Bob. (Zec = Zcash).

If Bob approves of keeping the exchange straightforward and open for the world to see, at that point she can send him the Zec to his straightforward address or t-addr.

But, on the off chance that he needs some security and does not need the exchange information to be available to open, he can just have the cash sent to his protected address as well called “z-addr”.

On the off chance that both Alice and Bob use their protected addresses to deal with each other, at that point every single information about the exchange will be private. This involves Alice’s ID, Bob’s ID and the details of the exchange itself.

Picture Credit: Z.Cash

The cause behind why Z-Cash achieves such a rising state of protection is that of the usage of zk-SNARKS or Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge.

Before we continue, it is important that we know what Zero-knowledge proofs and zk-Snarks are.

# What are Zero-Knowledge Proofs?

Zero-Knowledge proofs came to fruition in 1980’s because of the work done by MIT scientists Shafi Goldwasser, Silvio Micali and Charles Rackoff. They were taking a shot at issues specified with interactive proof systems, where a Prover trades messages with a Verifier (more on provers and verifiers later) to persuade them that they have information about a specific proof without announcing what that information is.

Before they made their remarkable detection, most proof systems depended on the “soundness” properties of the proof system. It was constantly expected that the “prover” could be the vicious one in any situation wherein they will attempt to trick the verifier. These 3 scientists flipped the thought on its head by examining the moral quality of the verifier rather than the prover. The inquiry they asked was, how might anybody know without any doubt that the verifier won’t release the information and there were likewise concerns raised with regards to the amount of the information about the prover that the verifier will become informed about during the of verification process.

There are different real-world results of this problem and one among the most well known ones need to do with password security. Assume you need to login to a site with a password. The standard code is that the client (you) will write in their password and send it to the server, the server will then mix the password and compare it to the mix that they have put in their system. if both of the passwords match, then now you can enter the system.

You can see the enormous defect in this system, right? The server has the plaintext form of your password, and your protection is helpless before the server (the verifier in this case). On the off chance that the server gets traded off or assaulted, at that point your password will be with the attacker party and the results could be desperate. With a specific end goal to counter these situations, zero-knowledge proofs are significant and way breaking in each sense.

There are two groups with regards to a zero-knowledge proof (as explained over), the prover and the verifier. Zero knowledge states that a prover can demonstrate to the verifier that they have a specific information without revealing to them what that information really is.

## Properties Of A Zero Knowledge Proof

For ZKP to run some parameters must be fulfilled:

**Perfection:**If the statement is true then an honest verifier can be convinced of it by an honest prover.**Soundness:**If the prover is dishonest, they can’t convince the verifier of the soundness of the statement by lying.**Zero-Knowledge:**If the statement is true, the verifier will have no idea what the statement really is.

So now that we basically know what a zero-knowledge proof is, Let’s checkout a few cases of it before we go deeper into zk-snarks and its usage in the blockchain.

### Case #1 Alibaba’s Cave

In this model, the prover (P) is stating to the verifier (V) that they know the password of the secret gate at the back of the cave and they need to demonstrate it to the verifier without really revealing to them the password. So this is how it would seem:

Picture Credit: Scott Twombly (YouTube channel)

The Prover goes down any of the ways A and B, assume they at first choose to experience way A and achieve the secret gate at the back. When they do as such, the verifier V comes in at the passage, with no clue of which way the prover really took and proclaims that they need to see the prover show up from way B.

In the graph, as should be obvious, the prover does for sure show up in way B. In any case, consider the possibility that this was blind luckiness. Consider the possibility that the prover didn’t know the password, and took the way B, was stuck at the entryway and by sheer fortune, the verifier instructed him to show up from way B, the one they were initially on at any rate.

In this way, to test the accuracy, the test is done many times . and if the prover can show up at the right way each and every time, it demonstrates to the verifier that the prover surely knows the password despite the fact that the verifier doesn’t even know what the password really is.

How about we perceive how the three properties of zero-knowledge are fulfilled in this illustration:

- Completeness: Since the announcement was valid, the honest prover persuaded the honest verifier.
- Soundness: If the prover was dishonest, they couldn’t have tricked the verifier because of the fact that the test was done numerous occasions. After all, the prover’s luck needed to run out.
- Zero-Knowledge: The verifier never recognized what the secret word was, yet was persuaded that the prover had ownership of it.

### Case #2 Finding Waldo

Remember finding Waldo? well, of course, you’ve seen it somewhere either, in your daily life, or on the web. For the individuals who don’t know it, Finding Waldo is where you need to find “Waldo” among a lot of people. It is a basic “spot the guy” game. simply, here is how it looks:

Picture Credit: Youtube (IntoConnection)

Furthermore, the thought is to discover Waldo who look like this:

Picture Credit: Pinterest

Appears to be simple right? Discover this person among the ocean of other individuals that you find in the diversion. Alright, so where does the idea of Zero Knowledge come in here? imagine there are two persons Anna and Carl. Anna tells Carl that she knows where Wally is nevertheless she wouldn’t like him to know where precisely he is. All in all, how might she make it clear to him that she has discovered Wally without revealing his very position?

There was an interesting paper by Naor, Naor and Reingold which demonstrates two Zero Knowledge answers for this issue. There is a “Mid-Tech Solution” and a “Low-Tech Solution”. We should talk about them two.

**Mid-Tech Solution**

The cause behind why this arrangement is “mid-tech” is that our prover and verifier require access to a photocopy machine to make this work. So this is how it is. In the first place, Anna and Carl would make a photocopy of the first game. At that point Anna, while ensuring that Carl isn’t looking, will remove Waldo from the photocopy and after that destroy the scraps. From that point forward, she can show the Waldo pattern to Carl and prove that she knew where Waldo was after all without pinpointing his correct place to Carl.

There are issues with this process . While it fulfills the “Zero Knowledge” criteria, it doesn’t satisfy the “Soundness” criteria. There are numerous ways that Anna could have bamboozled here. She could have had an irregular Waldo pattern with her from the very beginning point and could have recently shown it to Carl without really knowing where Waldo was. So what is the answer for this?

The answer for this is touchy and cautious testing. Before any thing , Anna and Carl will take a photocopy of the game. At that point Carl will draw a particular example at the back of the photocopy. From that point forward, Carl will escort Anna to a room where she will be separated and have no possibility of deceiving at all. In the event that Anna turns out with a pattern of Waldo, at that point Carl can be persuaded that she really knew where Waldo was without uncovering the solution. They can rehash this analysis numerous times and Carl can match the distinctive patterns of Waldo not to keep any doubt about the legitimacy of Anna’s claim.

**Low-Tech Solution**

This Solution required quite simple tools. The thought is basic. Get an very big cardboard, one that is double the measure of the game and cut out a little square shape on it. Presently, when Carl isn’t looking, Anna can move the cardboard on the amusement such that the square shape is specifically over Waldo. Presently, she can tell Carl to see and this is the thing that he will see:

Picture Credit: Applied Kid Cryptography by Naor, Naor And Reingold

In this way, while Carl may get an essential thought of where Waldo really can be, he doesn’t know the real place. Anna has showed to Carl that she knows where Waldo is without pinpointing his correct place.

**How to make zero-knowledge proofs non-interactive?**

With previous zero-knowledge check system there was one big issue. For it to work, the prover and the verifier must be online in the same time. As it were, the process was “interactive”. This made the whole system wasteful and relatively difficult to scale up. The verifiers couldn’t in any way, shape or form be online in the meantime as provers constantly? There should have been a system to make this more productive.

In 1986, Fiat and Shamir created the Fiat-Shamir heuristic and effectively changed interactive zero-knowledge proof to non-interactive zero knowledge proof. This helped the whole protocol work with no interaction. The process behind it is extremely basic.

In this way, to make it more clear, this is the way zero-knowledge used to run on before Fiat and Shamir. How about we demonstrate this utilizing basic discrete logarithms.

- Anna needs to prove to Carl that she do know a value x such that y = g^x to a base g.

- Anna chooses a random value v from a group of values Z, and calculates t = g^v and sends t to Carl.

- Carl chooses a random value c from the group Z and sends it to Anna.

- Anna calculates r = v-c*x and returns r to Carl.

- Carl sees if t= g^r * y^c holds or not ( since r= v-c*x, y= g^x and by basic cases, g^(v-c*x)* g ^ c*x = g^v = t).

- Carl doesn’t know the value of x, by only checking if t = g^r * y^c he can prove that Anna surely knows the value of x.

Presently while the above interaction is zero-knowledge, the issue with this is Anna and Carl should be on the web and trading values for it to work.

Now how would anna be able to tell Carl that she knows about something without Carl being online? She can do as such by using a basic cryptographic hash function, as Fiat and Shamir considered.

**How about we look how the case above would function in a non-interactive way:**

- Anna needs to prove to Carl that she knows an esteem x with the end goal that y = g^x to a base g.
- Anna picks a random esteem v from an group of values Z, and calculates t = g^v.
- Anna calculates c = H(g,y,t) where H() is a hash work.
- Anna calculates r = v – c*x.
- Carl or anybody would then be able to check if t = g^r * y^c.

Along these lines, as should be obvious, zero knowledge proofs were made non interactive. What’s more, this was what established the system for Zk-Snarks.

### What is the use of Zk-Snarks?

Zk-Snarks remains for “Zero-Knowledge Succinct Non-Interactive Argument of Knowledge”. Its utilization in present day blockchain innovation is huge. To fully understand its application, it is essential to know how a smart contract functions. A smart contract is fundamentally an escrow of funds which gets initiated once a specific task is finished.

For example, imagine Anna puts 100 ETH in a smart contract with Carl. Carl needs to complete a specific task, on the End of which, Carl will get the 100 ETH from the smart contract.

This gets confused when at that point assignments that Carl needs to do are multi layered and private. Assume you have entered a smart contract with Anna. Presently, you will just get the installment only if you complete A, B and C. Imagine a case where you would prefer not to uncover the subtle elements of A, B and C since they are classified to your company and you don’t need any contenders to know what you need to do.

What Zk-Snarks does is that it demonstrates that those means have been taken in the smart contract without uncovering what those means really are. It is extremely valuable is ensuring you and your company’s security. It can simply uncover some portion of the process without demonstrating the entire procedure itself and prove that you are being truthful about your cases.

### How does a Zk-Snark function?

A Zk-Snark consists of 3 algorithms: G, P and V.

G is a key generator takes an input “lambda” (which must be kept classified and shouldn’t be uncovered under any conditions) and a program C. It at that point continues to create two freely accessible keys, a proving key pk, and a verification key vk. These keys are both open and accessible to any of the concerned gatherings.

P is the prover who will use 3 things as input. The proving key pk, the random input x, which is openly accessible, and the private proclamation that they need to demonstrate the knowledge of without uncovering what it really is. We should call that private proclamation “w”. The P calculation creates a proof prf to such an extent that: prf = P(pk, x,w).

The verifier calculation V is essentially restores a boolean variable. A Boolean variable has just two options, it tends to be TRUE or it very well may be FALSE. Thus, the verifier takes in the verification key, open input x and verification prf as input, for example,

V(vk,x,prf)

..what’s more, returns TRUE if the prover is right and false generally.

So, about the parameter lambda. The value of the “Lambda” must be kept secret since then anybody can utilize it to output false evidences. These false proofs will restore an value of TRUE paying little mind to whether the prover really knows about private statement “w” or not.

**Functionality of Zk-Snark**

To show the Functionality of a Zk-Snark we will use a similar illustration work that Christian Lundkvist utilized in his article for Consensys. This is the thing that the case program resembles:

function C(x, w)

{

return ( sha256(w) == x );

}

Essentially, the function C takes in 2 values as input, an open hash value “x” and the mystery statement that should be verified “w”. In the event that the SHA-256 hash value of w breaks equals “x” at that point the function returns TRUE else it returns FALSE. (SHA-256 is the hash work that is utilized in Bitcoin).

Well, back to Anna and Carl for this case. Anna being the prover and Carl the skeptic is the verifier.

The main thing that Carl, as the verifier, needs to do is to create the proofing and verifying key utilizing the generator G. For this, Carl needs to produce the random value “lambda”. As expressed above in any case, he should be super watchful with Lambda since he can’t tell Anna its incentive to prevent her from making fake proofs.

Anyway, this is the thing that resembles:

G(C, lambda) = (pk , vk).

Since the two keys are produced, Anna needs to prove the validity of the statement by generating the proof. She will produce the proof utilizing the proving algorithm P. She will demonstrate that she knows the secret value “w” which hashes (on parsing through SHA-256) to give the output x. Along these lines, the demonstrating calculation for verification generation looks like this:

- prf = P( pk, x, w).

Now that she has generated the proof “prf”, she will give the value to Carl who will eventually run the verification algorithm of Zk-Snarks.

**This will look like this:**

- V( vk, x, prf).

Now, vk is the verifying key, x is the learned hash value and prf is the proof which he had from Anna. If this algorithm returns TRUE so that indeed means Anna was honest and for sure had the secret value “w”. If it returns FALSE then this proves that Anna was faking about knowing what “w” is.

**How Is Z-Cash Mined?**

block mining in Zcash is done by means of the equihash.

Equihash is a Proof-of-Work calculation conceived by Alex Biryukov and Dmitry Khovratovich. It depends on Generalized Birthday Problem.

An integral reason behind why equihash is being utilized is to make mining as ASIC unfriendly as possible. The issue with currencies like Bitcoin is that a large part of the mining pools corner the whole mining thing by investing a lot of cash on ASICs to mine as much bitcoin as could be.

Making your mining ASIC unfriendly implies that mining will be more like democracy and less centralized.

This is what Zcash blog said about Equihash:

“We also think it is unlikely that there will be any major optimizations of Equihash which would give the miners who know the optimization an advantage. This is because the Generalized Birthday Problem has been widely studied by computer scientists and cryptographers, and Equihash is close to the Generalized Birthday Problem. That is: it looks like a successful optimization of Equihash would be likely also an optimization of the Generalized Birthday Problem.”

So we have caught wind of this “birthday problem” a lot now, what’s going on here? What is the birthday issue or the birthday conundrum?

If you meet any stranger out by chance, the odds are low for both of you to have the exact same birthday. Actually, accepting that all long periods of the year have a similar probability of having a birthday, the odds of someone else sharing your birthday is 1/365 which is 0.27%.

At the end of the day, it is extremely low.

In any case, having said that, in the event that you get together 20-30 persons in a single room, the chances of two individuals sharing precisely the same birthday rises up cosmically. Actually, there is a 50-50 chance for 2 individuals of having a similar birthday in this situation!

For what reason does that happen? It is a result of a simple rule in likelihood which goes like this. Assume you have N various chances of an occasion happening, at that point you require square root of N random things for them to have a half shot of an impact.

So applying this theory for birthday events, you have 365 unique potential outcomes of birthday events, so you simply require Sqrt(365), which is ~23~, haphazardly picked individuals for half shot of two individuals sharing birthdays.

**Zcash Coin Distribution**

Since Zcash is a fork of Bitcoin there are a few similarities.

Zcash also has a 21 million coins most extreme supply and they are altogether anticipated that would be mined by 2032. Like clockwork, the block reward gets split to hold the supply in line.

Not at all like the majority of alternate coins however, Zcash wasn’t pre-mined and nor is it ICO supported.

Zcash had a gathering of closed investors who financed then with $1 million to kickstart their advancement. The investors were then guaranteed with a 10% reward of the aggregate supply in an incremental path over the initial 4-year tperiod. This reward is known as “Founder’s Reward”.

Some of these closed investors were known names, for example, Barry Silbert, Erik Voorhes, Roger Ver, and Naval Ravikant.

**Is Zcash Regulation Difficult?**

Zcash order is clearly troublesome due to the additional security efforts, in any case, there is a route for law authorization to check the control as and when required. This is done through two techniques:

- View Key.
- Memo.

Each user in Zcash has their own “View Key”.

Whenever required, the user can share their view key with another person. The view key at that point, fundamentally, unshields every single transactions. With the view key, anybody will have the capacity to see that specific individual’s exchanges and the address of the recipient.

Zcash transactions likewise come with a memo field.

The memo field can have extra data which can be viewed only by the recipient.

According to Zooko Wilcox: “This memo could carry data between financial institutions wherever they are required by law to send that data along.”

**The Zcash Counterfeiting Problem**

Zcash was confronting a huge faking issue which was an immediate branch of their zk-snark programming.

In Zcash 1.0, the private exchanges depend on SNARK open parameters for the creation and verification of zero-knowledge proofs. Producing these SNARK open parameters requires the making of an open/private key match and afterward destroying the private key and keeping the general open key.

After all, this is where things get hard some how.

On the off chance that somebody gets hold of that private key, at that point they can make fake coins!

This as a rule isn’t an issue in an open record like bitcoin where every one of the exchanges are open for the world to see. Nonetheless, in Zcash, the security prevents anybody from checking the condition of the coins.

This how Zooko Wilcox depicts the private key or, as he calls it, “toxic waste” issue:

“We call the private key “the toxic waste”, and our protocol is designed to ensure that the toxic waste never comes into existence at all. Imagine having a bunch of different chemical byproducts in your factory, each of which is individually harmless, but if you let all of them mix together they will form a dangerous substance that’s difficult to manage safely. Our approach is to keep the individually-harmless chemicals separate until they are destroyed, so the toxic waste never comes into existence at all.”

Thus, keeping in mind the end goal to decrease the shot of an attacker to get their hand on the “toxic waste”, a detailed ceremony was led.

**The Ceremony**

The ceremony is delightfully recorded in the Radiolab digital broadcast.

The ceremony’s motivation was as per the following:

Make a protected multiparty calculation in which numerous individuals each create a “shard” of people in open/private key combine.

Once that is made, every part devastates their shard of the private key and after that meet up to join the open key shards to make the general open or public key.

So fundamentally, if just a single member annihilates their private key shard then it is difficult to reproduce. The analysis flops just if the majority of the members have been dishonest.

You should read Morgan Peck’s first-hand account of the cermony. The sheer lengths to which these individuals went to lead it is greatly excellent.

This is Zooko Wilcox’s announcement on the primary concern of the service:

“We have performed a remarkable feat of cryptographic and infosec engineering in order to generate SNARK public parameters for Zcash 1.0 “Sprout”. The general design of this Ceremony was based on Multi-Party Computation, air-gaps, and indelible evidence trails. Six different people each took one part of the Ceremony. The Multi-Party Computation ensures that even if all five of the others were compromised, or were secretly colluding, to try to reconstruct the toxic waste, one single Witness behaving honestly and deleting their shard of the toxic waste would prevent it from ever being reconstructable. Despite the remarkable strength of this Ceremony, I intend to advocate for a major upgrade to the Zcash protocol next year which will add a layer of detection in addition to the current layer of prevention.”

**Ethereum + Zcash = <3 ?**

Picture Courtesy: Zcash

Zcash is a cryptocurrency set by Zerocoin Electic Coin Company on ninth of September 2016 and is the first case a cryptocurrency including the ideas of blockchain technology with Zk-Snarks. It intends to give totally protected and secure exchange spaces for its clients without uncovering specific elements, (for example, their addresses) to anybody.

Ethereum needs to incorporate Zk-Snarks as it enters its Metropolis stage and how they are intending to do as such is by making a partnership with Zcash which will incorporate a common trade of significant worth. The chief developer of Zcash, Zooko Wilcox, gave an introduction in DevCon2 in Shanghai which investigated the eventual fate of such a alliance. As indicated by him, there are 3 different ways that Z-Cash and by expansion, zk-snarks could be coordinated with Ethereum.

The primary technique is called Baby (Zoe = Zcash on Ethereum). It includes a zk-snark pre-compiler on Ethereum and makes a smaller than expected Zcash smart contract on Ethereum. The thought is to see whether the Ethereum system can make a zk-snark empowered DAPP over its blockchain.

The Second technique is to incorporate the Ethereum computability inside the Zcash blockchain. As Wilcox puts seems to be, the best resource of Ethereum is its calculability and people need to see whether they can incorporate it on a zk-snark based blockchain like Zcash. Will people make DAPPS on a blockchain made on zero-knowledge proofs? That is something that they are holding up to see.

The third and the most energizing part is Project Alchemy. This is basiclly the association and interoperation of the two blockchains with the end goal that one can flawlessly move between the two. The manner in which that Zcash wants to do that is by cloning the BTC Relay. It is an Ethereum content which was composed to make a Bitcoin light customer inside Ethereum. The Zcash clone will use a similar idea to make a Zcash light customer inside Ethereum.

In the event that this works then we will have the first ever, decentralized cash framework on the planet which encourages the formation of DAPPS with zero-knowledge instilled in it.

**Looking Forward **

Zcash is certainly one of the most smoking and the most energizing coins out there right now. It has been performing truly well since its very beginning.

Picture Credit: CoinMarketCap

As of writing, the Zcash market top stands at $1,734,866,483.

The cost of 1 Zec remains at $559.80.

It is clear to understand why people value the security given by Zcash in an undeniably transparent world.

Actually, Edward Snowden himself has given his seal of endorsement to Zcash: