Study of Klaytn
Blockchain
What is Klaytn
Blockchain?
o Klaytn is a global
public blockchain platform developed by GroundX,
the blockchain affiliate of the leading South Korean Internet
company, Kakao.
o Kakao’s global public blockchain project Klaytn is an enterprise-grade, service-centric platform providing an natural
development environment and friendly end-user experience that brings
user-friendly blockchain experience to millions.
o It combines
the best features
of both public
blockchains (decentralized data & control, distributed
governance) and private
blockchains (low latency, high scalability) via an efficient
'hybrid' design.
o Klaytn is secured
by participation from numerous highly-reputable brands
around the globe, working together to create a reliable business platform atop
a robust system of
decentralized trust.
o Klaytn enables businesses and entrepreneurs
today to capture value using blockchain technology.
o Blockchain
Applications (BApps) are first-class citizens in Klaytn's
world. We struggle to offer the highest performance and the most productive
environment that caters to a wide spectrum of engineering audience, from
micro startups to enterprise divisions.
o
With combination of Klaytn
features, including low-latency network responsiveness, reliable yet powerful
transaction throughput, flexible scalability through Service Chains, and
transaction fee subsidization for end-users, BApp designers will be liberated to
deliver the best experience for their customers.
o Further, Klaytn network's seamless interoperability with legacy
enterprise assets (via Enterprise Proxy) offers quick onramp for teams planning
to newly integrate blockchain features into their offerings.
Klaytn is a
highly optimized, BFT-based public blockchain that aims to met the enterprise-grade
reliability.
Key design goals are:
·
Immediate finality.
·
High TPS that meets real-world use cases.
·
Lower the cost of running Blockchain Applications.
·
Lower the barriers to entry for end-users.
·
Ease the technology adoption process for industry.
Klaytn launched its mainnet,
Cypress, on Jun/27/2019 with the following specifications.
·
1-second block generation and confirmation time.
·
4,000 transactions per second.
·
Low gas price that is almost 1/10 of Ethereum.
·
Runs EVM (Ethereum Virtual Machine) and supports the
execution of Solidity contracts.
·
19 reputable corporations worldwide initially formed Klaytn Governance Council to operate consensus nodes. The
current number of consensus nodes is shown in the Klaytnscope.
· More than 50 initial service partners have committed to launch Blockchain Applications on Klaytn.
o
Klaytn can be partitioned
into three logical subnetworks based on their roles and purposes. The below
figure displays the high-level view of the Klaytn
ecosystem.
Klaytn Ecosystem and its Logical Subnetworks (CCN, ENN, SCN)
o
Core
Cell Network (CCN)
o
CCN consists of Core Cells (CCs) that
verify and execute transactions submitted through Endpoint Nodes (ENs). CCN is responsible for creating
and propagating blocks throughout the network.
o
ENN consists of Endpoint Nodes (ENs)
that mainly create transactions, handle RPC API requests, and process data
requests from service chains.
o
SCNs are Klaytn
subnetworks composed of auxiliary blockchains independently operated by
blockchain applications (BApps). Service chains are
connected to the main chain via ENs.
Core Cell Network and Endpoint Node Network form a Klaytn main chain or mainnet.
Blockchain Applications can run on the Klaytn main
chain, Cypress, or can operate on their own blockchains called Service Chains.
Klaytn Network Topology
In this section, the network topology
of Klaytn main chain are described. A tiered
network architecture with role-based node types is implemented in Klaytn to optimize the network performance.
o
Before going over the Klaytn main chain network topology, there is need to get
familiar with the different types of Klaytn nodes.
o
A Core Cell (CC) is composed of a
single Consensus
Node (CN) and two Proxy Nodes (PNs). Consensus Nodes are participating in
the block generation process, while Proxy Nodes provide the interface to the
network.
o
PNs transmit the transaction requests
to the Consensus Nodes, and propagate the blocks down
to the Endpoint Nodes.
o
ENs serve as endpoints for Klaytn network handling RPC API requests and processing
data sent to and from service chains.
o
Bootnodes are special-type nodes operated by Klaytn to help newly joining nodes register to the network
and to discover other nodes to connect with.
o
CN bootnodes
reside within the CNN (Consensus Node Network) and are not exposed to the
public, while PN and EN bootnodes are publicly
visible.
o
PN bootnodes
only allow permitted PNs to be registered, and let
eligible PNs connect with ENs. EN bootnodes
provide ENs with information on which PNs to connect to.
o
CNs, PNs, and ENs form logical
networks, Consensus Node Network (CNN), Proxy Node Network (PNN), and Endpoint
Node Network (ENN), respectively.
o
Below figure shows the overall
topology of Klaytn mainnet,
where Core Cell Network (CCN) is further broken down into Consensus Node
Network (CNN) and Proxy Node Network (PNN). Endpoint Node Network (ENN) is also
shown as the surrounding network connected directly to PNN.
o
Consensus Node Network (CNN)
o CNs form a
full-mesh network among themselves called CNN.
o CNN applies
BFT (Byzantine Fault Tolerance) over a WAN (wide area network) and requires
each CN to satisfy stringent hardware and network resource requirements to
carry out BFT consensus at a sufficient performance level.
o
Proxy Node Network (PNN)
o PNN
consists of PNs. Typically, PNs maintain just one connection with a PN in a neighboring Core Cell. The number of peer connections is
subject to change depending on the network configuration.
o
Endpoint Node Network (ENN)
o The
outermost subnetwork, ENN, is solely composed of ENs connected to each other and also to a number of PNs.
o
Block Generation and Propagation
o Block
generation and propagation design, along with the consensus algorithm used,
plays an important role in reducing the latency of a blockchain platform.
o
Block Generation Cycle
o A 'round'
is a block generation cycle in Klaytn. Each round
generates a new block, and is immediately followed by
the start of a new round. Klaytn targets each round
to be approximately one second, although block generation interval may be
influenced by network traffic and node operation conditions.
o
Proposer and Committee Selection
o In each
round, Klaytn randomly but deterministically selects
a Consensus Node (CN) as the proposer for the block to be created.
o Then
selects a group of CNs as the committee for the given round. Klaytn is not directly involved in the selection of either
the proposer or committee;
o instead,
each CN uses a random number derived from the most recent block header to run a
cryptographic operation which yields proof that the CN has (or has not) been
selected for this round.
o The
committee size should be Byzantine resistant; if the size of the CNN is small,
all CNs (except the proposer) are eligible to be selected as committee members.
o
Block Proposal and Validation
o Once
selected, the proposer broadcasts its proof of selection for the round (i.e., a
cryptographic proof verifiable by the public key of the proposer) to all CNs.
o Thereafter,
the CNs selected as committee for the given round responds to the proposer with
their own proofs of selection, notifying the proposer to whom to broadcast the
new block to be proposed.
o The
proposer then selects a set of transactions from its transaction pool and
creates a block by ordering them.
o Lastly, the
proposer executes consensus with the committee to agree upon and finalize the
newly created block.
o Note that Klaytn plans to continuously improve its consensus algorithm to achieve higher
security and efficiency.
o
Block Propagation
o A proposed
block must receive signatures from more than two-thirds of the committee members to be
successfully finalized.
o When the
committee reaches consensus, the new block is propagated to all CNs and the
consensus round ends.
o Once the
new block is propagated to all CNs, the information of the newly created block
can be made available to all Klaytn network
participants by delivering block header and body data to ENN through PNN.
o
Public Disclosure and Open Validation
o Service
providers and end-users on Klaytn network can freely
validate block generation results and check if the CN committee have generated
the block according to proper procedures.
o Such
validation includes checking if the block header contains more than two-thirds
of the committee signatures.
o All CNs
must support open validation and are required to post their public keys (used
to sign blocks) in a publicly accessible space (e.g., block headers).
o Open
validation promotes transparency, deter censorship, and prevent malicious behaviors.
o
Separated Propagation Channels for Blocks and
Transactions (Multichannel Propagation)
o A network's
latency is heavily affected by its degree of congestion. Assuming the network's
throughput remains constant, increased number of transactions will cause the
network's latency to be proportionately delayed.
o Latency
delay is a critical issue in BApps; typical users of
legacy mobile apps or web services will not tolerate response time that takes
more than a few seconds, and blockchain services have no reason to assume a higher
user tolerance.
o Klaytn adopts a multichannel
approach in order to handle network congestion issues.
By assigning separate propagation channels for transactions and blocks, Klaytn network is able to
propagate newly created blocks in a timely manner even when the network faces
heavy congestion with high number of transactions. In this way, Klaytn ensures that BApps on its
network can stay responsive to end-user requests regardless of intermittent
network traffic spikes.
o Block
Rewards
o For each round, block reward (which is the sum of 9.6 newly minted KLAY and transaction fees paid to process the block) will be distributed to the network participants according to preset distribution ratios.
o The proposer of the newly created block will receive 100% of the reward to be awarded to CNs, whereas the committee will receive none.
o Note that the probability of being selected as the proposer is influenced by the amount of KLAY staked by the CN, implying that a CN with more KLAY invested in the platform will probabilistically receive more rewards.
o Details of block reward distribution can be found in the Klaytn Token Economy section.