Ameya
Ameya Blockchain, Web3, Startups

StarkNet and the future of Ethereum scaling

StarkNet and the future of Ethereum scaling

As the world shifts towards a more decentralized future - with an ever-increasing demand for control and ownership of assets to shift into the hands of the people from the opaque and often tyrannical powers that be- the importance of blockchain protocols continues to grow, since they are the essential infrastructure required for this pivotal transition. Apart from making money borderless and transparent in the form of cryptocurrencies, blockchain technology has unlocked a variety of different applications such as DeFi (decentralized finance), NFTs (non-fungible tokens) and more - all of which has led to a rapid increase in adoption by everyday users - and not just the nerds and cypherpunks.

This leads one to ask, is it all a bed of roses then? The answer, unfortunately, is no. In fact, the complex systems behind blockchain protocols lead to something known as the “blockchain trilemma” - a phrase coined by Ethereum co-founder Vitalik Buterin - which refers to a three-pronged problem where a protocol struggles to have the three major aspects which make up a “perfect” blockchain - security, decentralization and scalability.

triangle

To understand this better and see how important this problem is, let us consider Ethereum, the second-largest blockchain network in the world by market capitalization and the first blockchain to bring about the revolutionary concept of “smart contracts” - pieces of code which govern transactions much like contracts in the real world - but faster and more reliable since they’re executed by computers, not humans.

While Ethereum is fairly decentralized and extremely secure, it is currently facing issues with the third aspect of the trilemma - scalability. This has happened because of an exponential growth in users which the existing infrastructure hasn’t been able to match. Consequently, this has led the fee for using the network - known as “gas fees” - skyrocketing due to the exceptional demand, making it uneconomical to use for a large fraction of users.

fees

Is it all over for Ethereum then? The answer to this, too, fortunately, is an emphatic no. Enter Starknet, a permissionless, decentralized ZK-rollup which operates as a layer 2 network over Ethereum.

stn

StarkNet? ZK-rollup? Layer 2? WTF is going on?

It is common to be put-off by these complex-sounding terms - trust me, I was too when I first read about them - but get to know what they are and you will appreciate the sheer genius behind what they’ve achieved.

StarkNet is developed by Starkware - which raised a $50M series C funding round led by Paradigm at a $2B valuation last November - which has two major offerings in StarkNet and StarkEx. Although the focus of this article is StarkNet, people often tend to get confused between the two.

StarkWare derives its name from something known as STARK proofs in cryptography - but it will serve us well to use an Iron Man analogy here. Consider StarkEx as the array of different automated machinery than Tony Stark possesses - say, Dum E and Dum U, the pair of hydraulic arm robots he uses as assistants in his workshop - which help him in achieving specific goals like assembling and breaking stuff.

pet

Tony Stark petting Dum-E

StarkEx does exactly this - but with Ethereum (which in our case, is Tony Stark). It powers specific uses on Ethereum such as perpetual contracts, spot trading, and NFT minting, by providing a layer 2 scalability engine. With that comes the question…

What is a layer-2?

Put simply, it is a term used for infrastructure operating on top of the underlying blockchain, boosting its capabilities, without severely affecting the already existing benefits it offers, just like Dum E and U, JARVIS offer external support to Tony Stark without affecting Tony himself, and instead enhance his abilities and productivity. The underlying blockchain - no prizes for guessing - is known as a layer 1 network. Bitcoin and Ethereum - the top two blockchains by market cap - are layer 1s.

So, what is StarkNet?

It is the Iron Man’s suit equivalent, but for Ethereum. That means - it is a layer 2 network providing general purpose use - much like how Iron Man’s suit can do practically anything and everything Tony requires - unlike StarkEx, which only serves some specific use cases. This means that a developer working on it can deploy dApps (decentralized applications) with potentially any use case that he/she requires.

fly

Alright! Now, what’s a ZK-rollup, what’s STARK, are they different? What’s going on???

Okay! Let’s break these down. ZK-rollup stands for zero-knowledge rollup - and while this seems scary (and the math behind it definitely is!) - a simple explanation for it would be that it “rolls” multiple transactions on Ethereum (the underlying layer 1) into a single bundle, increasing speed as well as scalability, since the number of transactions that has to be processed is now significantly lesser. This is a concept being implemented by many layer 2 protocols - zkSync, Hermez, Aztec etc. - the concept which truly differentiates StarkNet from others is that it uses STARK proofs to maintain the integrity of transactions done over the network - while enhancing scalability.

ZK-STARKs (zero knowledge-STARKs) allow the underlying blockchains to move transactions to an off-chain prover, who then uses an on-chain verifier to verify these transactions. During the entire process, the prover’s inputs are not exposed on the blockchain (since it’s off-chain), but their integrity is validated on-chain. This means that even though the computation for the transaction is done off-chain, the on-chain verification mechanism ensures that no malicious computation has been carried out.

Zero-knowledge proofs:

Also, as you might have observed, both of these concepts are preceded by this phrase - ZK or “zero knowledge” - and may be curious what it actually means. Zero-knowledge refers to a cryptographic proof technique where, a “prover” can prove that a statement or a process carried out by him/her is valid, to a verifier, without revealing the crucial information of the statement or the inner workings of the process to the verifier.

This is much like when your friend challenges you to lose 10 pounds in a month, and you do it. In this situation, the friend need not know what went into losing the 10 pounds - whether it was running, calisthenics, weightlifting, cycling or something else. Your friend, at the beginning of the month, very carefully sets up an extremely accurate weighing machine, so that there is absolute surety of your weight. All you now do is step on the machine, note down the weight, and come back again after a month to check your weight on the machine. If the difference between the readings comes out to be >= 10 pounds, you have successfully completed the challenge and have proven the same to your friend (the verifier).

pet

Weight loss is what matters - and as long as it’s with healthy habits and a humane diet- it doesn’t matter how you did it!

Similarly, on StarkNet, a verifier performs the big computations on the transaction off-chain, and zero-knowledge proofs help in proving the transaction on-chain without performing these huge transactions all over again on the network, and instead only in a few steps.

However, ZK-STARKs are non-interactive ZK-proofs, meaning that the prover and verifier require no interaction with each other. How does this happen? Explore more about this cutting-edge technology here: ZK-STARKs

Now that is super cool. How do you interact with StarkNet though? Does StarkNet even have its own token like other layer 2s?

StarkNet alpha has already been deployed on the Ethereum mainnet, and the easiest way for one to interact with the network is through the ArgentX wallet. You can download it (it’s just a simple browser extension!) here.

However, as StarkNet does not have its own token, the only way (currently) to interact with the network is to start building on it. It has its own language, known as Cairo, used to write and deploy smart contracts. StarkNet will soon also have a bridge connecting Ethereum and StarkNet, allowing interoperability and greater flexibility of use between the two networks.

Sounds intriguing? Head right over to the technical docs to start building!

To check out the list of projects currently building on StarkNet, see here


Thank you to Nitzan from StarkNet for proofreading this article.

Thanks for reading! I hope you’ve enjoyed reading this article. You can find me on Linkedin and GitHub.

comments powered by Disqus