QuarkChain technically, in a nutshell

in #quarkchain6 years ago

Welcome, handsome stranger! I am glad you stumbled upon my article about QuarkChain. I will be focusing on core concepts behind QuarkChain network here. Please note that this article represents my own understanding of the concepts. It has not been proofread by QuarkChain team. I encourage everyone to read the official white paper. If you spot an inaccuracy or error, please let me know in the comment section. Thanks :)

Problem

One of the most fundamental problems of current blockchain networks is scalability. The biggest players in this space are only able to process handful of transactions per seconds (TPS). To be more specific, Bitcoin can process 3-4 TPS and Ethereum around 15 TPS. These numbers might have been be good enough in early days of blockchains, but in order to meet the demand of real-world applications and enterprises, it needs to be able to scale significantly.
In comparison, non-blockchain solutions like VISA can handle thousands of transactions per seconds.
QuarkChain network aims to be able to do ~100 thousand transactions per second in 2018 and possibly all the way up to ~1 million transactions per second later in 2019.

Sharding and two-layered architecture

Scaling in centralized world is not that hard. But it is still a challenge in the world of decentralized and permissionless blockchains networks. Blockchain networks always balance between decentralization, scalability and security. Solving the scalability issue by compromising on decentralization or security would be the easy way out. But solving the problem while still remaining decentralized and permissionless, with security on appropriate level, is the real challenge. The challenge that QuarkChain is trying to tackle.
Early blockchains like Bitcoin and Ethereum brought a lot of innovation, but they were not designed for scalability. And fixing these scalability issues in existing projects is hard and can take years.

So how does QuarkChain try to solve the scalability issue?

It introduces sharding. Sharding is a popular technology often used in centralized world. What’s innovative about QuarkChain is that it tries to solve the scalability issue without compromising on decentralization and permissionless, while still trying to remain secure.

Screenshot from 2018-05-13 13-06-38.png
QuarkChain two-layered architecture (source [1])

QuarkChain has two-layered architecture. It consists of a single root chain and there can be up to 2 billion minor (shard) chains.
As the number of shards increases, shards can process more transactions and thus capacity of the whole system effectively increases.

In this two-layered model, minor chains take care of ledger and processing transactions. Each shard only processes subset of all transactions on the network.

The single root chain validates blocks from all minor chains. It is protected by 50% hash power of the whole network.

This architecture makes QuarkChain the first project to utilize state sharding in blockchain space.

One of the unique QuarkChain features is seamless support of cross-shard transaction. But more on that later.

Reaching consensus

If each shard processes only subset of all transactions, how can the network reach consensus and prevent malicious behavior like for example double-spend attack?

QuarkChain utilizes hybrid proof-of-work (POW) algorithm. The root chain adapts standard POW algorithm as we know it from Bitcoin or Ethereum. This means that if fork happens on the root chain, then fork which has the longest length will win and survive.

On the other hand, each shard runs root-chain-first POW. When forks happen in a shard, then node will first compare their root chains. Fork with the longest root chain will survive.

How to ensure even hash power distribution?

QuarkChain introduces a concept of “collaborative mining”. The goal is to design an incentive mechanism and difficulty algorithms and thus ensure that hash power is distributed evenly among root chain (50%) and shards, so TPS increases with number of shards.

Miners can choose to mine either the root chain or any minor chain (shard). The idea is that miners will selfishly choose to mine where they will benefit most by contributing their hash power. Good incentive mechanism and difficulty algorithms can ensure that miners pursuing their own interest will spread hash power evenly across all shards, while 50% will be protecting the root chain.

The white paper describes this interesting idea, but unfortunately doesn’t go into too much details.

Cross-shard transactions and Smart Wallet

QuarkChain supports cross-shard transactions. Meaning, users can send funds from an address in one shard to another address in different shard.

But how does this work? Users will have their primary account in one shard. They can also have addresses in all other shards. Cross-shard transactions will first transfer funds to user’s target-shard address and then to the target address. The whole process should only take couple of minutes.

Of course, maintaining addresses in all shards doesn’t sound like fun. That’s where smart wallet comes into the picture.

User will have 2 accounts. Primary account residing in his or her default shard. And secondary account which manages addresses in all other shards. The wallet will take care of account management so user doesn’t have to know about all the shard complexity underneath.

In short, user’s coins will mostly live in their primary accounts, in their default shards. But portions of their coins can be spread across multiple shards when user is making a payment or executing a smart contract. Smart wallet will be able to automatically transfer coins from non-default shards/addresses back to the primary one.

Smart Contracts

Smart contracts will be supported on QuarkChain network. QuarkChain project decided reuse probably the most well-known and widely used platform for executing smart contracts - Ethereum Virtual Machine (EVM). This was a great decision in my opinion. Team can truly focus on the scalability issue and it will be easy for people to migrate their existing smart contracts to QuarkChain, once the network is launched.

Show me the code!

QuarkChain is not yet another rebranded Ethereum fork - it’s written from scratch. Great news is that the project should be open sourced later this year. Keep an eye on their GitHub: https://github.com/QuarkChain

And that's all folks

Thank you for taking the time to read this article. Please leave a comment!

Thanks,
Michal

Sources

[1]: White paper: https://quarkchain.io/QUARK%20CHAIN%20Public%20Version%200.3.4.pdf
[2]: BlockchainBrad’s interview with QuarkChain CEO, Qi Zhou:

Sort:  

@michal-87, congratulations on making your first post! I gave you an upvote!

Please give me a follow and take a moment to read this post regarding commenting and spam.
(tl;dr - if you spam, you will be flagged!)

Congratulations @michal-87! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

SteemitBoard - Witness Update
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.032
BTC 60844.65
ETH 2995.69
USDT 1.00
SBD 3.88