Pushing the Boundaries of Scalability and Rethinking Smart Contracts with Zilliqa

Zilliqa (ZIL) is doing exciting things that no other blockchain is doing. Designed from the ground up to use sharding to be highly scalable and have an extremely high throughput. Zilliqa uses a non-Turing complete custom smart contract language called Scilla, which has been designed for security in mind.

Let’s start with an explanation of what sharding is, and how Zilliqa is using it to maximize transaction throughput and scalability so that the platform can meet the needs of global demand. Sharding is a trick of database architecture that allows us to split the ZIL blockchain into smaller more manageable consensus groups called shards.

Think of shards like blockchain sub-sections that all work independently, but when processed together in parallel with the other shards, make up the immutable public ledger of the blockchain. Miners only verify transactions of their shard, and multiple shards each process transactions data unique to each shard, in parallel with the other shards.

This allows for each shard on the network to dramatically increase the number of transactions per second that ZIL can handle.

How does Zilliqa work under the hood?

ZIL uses Proof of Work (POW) to secure the chain and prevent attacks from adversarial network participants, but rather unlike Bitcoin, Ethereum or other traditional POW coins which use POW to attain the Nakamoto consensus, ZIL only uses POW to secure the blockchain. Its consensus mechanism is a Byzantine Fault Tolerance consensus with finality, which decides which blocks will form the chain.

ZIL shards the network by means of an elected group of dedicated nodes called directory service nodes (DS) which do the proof of work mining to shard the network, assign nodes to shards and secure the blockchain from bad actors.

Sharding leverages a deterministic function to assign a node to a shard. For a new node to join the network, it can attempt to solve PoW1 to become a DS node or a PoW2 to become a member of a shard. If it’s elected a DS node, it will mine DS blocks and help shard the network, if it joins a shard, it will mine transaction blocks (TX), which contain transaction from users of the network.

Sharding allows for amazing blockchain performance until a point, where it can run into broadcast network limitations. Admittedly there’s a “sweet spot” for ZIL to run optimally, and reach hundreds of thousands of transactions per second.

From the white paper:

“The sharded architecture is ideal for running computation-intensive tasks in an efficient manner. Examples include simple computations such as search, sort, and linear algebra computations, to more complex computations such as training a neural net, data mining, financial modeling, etc.”

Smart contract language created with security in mind

Zilliqa’s smart contract layer will run a new smart contract language called Scilla, which has been designed as a principled language with smart contract safety in mind. Scilla will restrict smart contracts to a principled structure which will make them substantially more secure.

Smart contracts are really difficult to create without a large attack surface, due to the immutable nature of blockchains. They cannot be altered once they are deployed, without a hard fork. This means unlike traditional software, where bugs in the code can be fixed with an update or patch, a smart contract cannot be debugged in this way. This makes auditing code extremely important, and even then there are still many risks, like the DAO, and Parity smart contract exploits have shown.

Smart contracts also require computational costs, in the form of gas fees. Amrit Kumar, Co-Founder of Zilliqa, gives a wonderful explanation of this in his recent post on the Zilliqa blog:

“while writing a contract, a developer must make sure that every function therein will run as expected without hitting gas limits. An improper resource analysis may lead to situations where funds may get stuck simply because a part of the smart contract code cannot be executed to due gas limits. Such constraints are not present in traditional software systems.”

Scilla resolves many of these issues by disentangling the contract-specific effects (e.g., functions) from blockchain-wide interactions (i.e., sending/receiving funds and messages). This gives a lot less room for an attacker to execute or interpret the state of the contract in a way unintended by the developers of the smart contract. A clear reasoning mechanism in a principled and structured way can eliminate many bugs at a language-level. This leads to much safer and secure smart contracts.

Smart contracts, unlike traditional legal contracts, leave no room for any arbitration, or interpretation of the spirit of the agreement. This can cause significant problems in real life economic activity in a Byzantine environment where a certain portion of network participants must be assumed to be acting maliciously.

User funds will always be at risk in a situation involving financial activity, and many recent attacks on smart contracts and blockchains themselves, show that this is a matter to be taken very seriously.

As thousands of cryptocurrency investors and entrepreneurs keep flooding this space and start interacting with smart contracts, security measures like Zilliqa’s programming language Scilla become more and more valuable.

Leave a Reply

You must be logged in to post a comment.