twork because other masternodes will reject
the new block.
C.
Censorship Attack
In the event that there are more than 3/4 malicious
masternodes in the XinFin Network,
censorship attacks may occur. For example, if the
malicious masternodes refuse valid blocks
or simply become inactive, the chain is stuck. To
avoid censorship attacks, masternodes are
paid for their effort of correctly working so that
the chain is actively updated in a consistent
manner.
More importantly, becoming a masternode means a certain
number of coins is locked
—10,000,000 XDC in this case. Therefore, to control
more than 3/4 masternodes, attackers
must hold a considerable amount of XDC and gain substantial
support from coin-holders.
Given the inhibiting cost, the attackers do not have
incentives to engage in any malicious
activity that could harm the chain
However, in the worst-case scenario, XinFin Network
can conduct a soft fork to reduce the
number of masternodes, keeping the chain running and
figuring out slasher mechanisms to
weed out the malicious masternodes.
D.
Relay Attack
The XinFin Network supports EIP155. The EIP-155 provides
unique identifiers to a
blockchain helping it overcome relay attacks. With
EIP-155, two conditions are met: (a)
definition of an integer for Chain-id for a blockchain
and (b) signing of a
chain-id
into a
transaction data. This prompts attackers to send the
same transaction to different
blockchains. With specifications in the EIP-155, blockchains
have to define a
chain-id
and
register the
chain-id
in a public repository.
9
9
Zoltu, Micah. “Ethereum/EIPs.” GitHub, September
29, 2020. https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md.
A challenge for using an integer for chain-id is that it’s not broad enough to cover all
blockchains and it doesn't prevent the use of the
same
chain-id
by different blockchains.
Furthermore, using an integer fails to address issues
introduced by two forked blockchains
having the same
chain-id
. In this context, the XinFin Network has adopted a more robust
blockchain identifier that overcomes these drawbacks,
especially for cross chain operations
where multiple chains are involved thus providing
extensive protection against relay attacks.
With the XinFin Network, the process through which
a transaction id is made unique is as
illustrated with the following example:
Consider a transaction with:
nonce = 9, gas price
= 20 * 10**9, start gas = 21000, to =
xdc3535353535353535353535353535353535353535, value
= 10**18, data='' (empty).
Once signed the “signing data" becomes:
0xec098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a764000080018
080
And, the "signing hash" becomes:
0xdaf5a779ae972f972197303d7b574746c7ef83eadac0f2791ad23db92e4c8e53
In the event that a transaction within the XinFin
Network is signed with a private key like
0x4646464646464646464646464646464646464646464646464646464646464646
,
then the v, r, s values
would be:
(37, 18515461264373351373200002665853028612451056578545711640558177340181847433846,
46948507304638947509940763649030358759909902576025900602547168820602576006531)
With the
u
se of 37 instead 27 in the v, r, s values,
the signed Tx would become:
0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025
a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb7033
04b3800ccf555c9f3dc64214b297fb1966a3b6d83
Within the XinFin Network, a cross chain-id can be
used to present a relay attack. Notably,
applications handling cross chain transactions can
verify cross
chain-id
via their block hash
and decide whether the transaction is valid or not.
Transactions without a verifiable cross
chain-id
are rejected. In effect, EIP-155 specifications
provide a robust approach to
preventing relay attacks.
Table 1 shows chains and
chain-ids
recognized on the network.
TABLE 1
CHAINS AND CHAIN_ID
CHAIN ID
Chain(s)
1
Ethereum mainnet
2
Morden (disused), Expanse mainnet
3
Ropsten
4
Rinkeby
30
Rootstock mainnet
31
Rockstock testnet
42
Kovan
61
Ethereum Classic mainnet
62
Ethereum Classic testnet
1337
Geth private chains (default)
77
Sokol, the public POA Network testnet
99
Core, the public POA Network main network
50
XinFin Mainnet
51
XinFin Testnet
E.
Safety and Liveness
A consensus protocol is considered live if it can
eventually propagate and make valid
transactions onto the blockchain. A liveness fault
occurs when transaction omission,
information withholding, or message reordering, among
a number of violations are observed.
This type of fault is unlikely to happen in XinFin
Network because the block creation
masternodes list is ordered in a predetermined way
for each epoch, thus if even an attacking
masternode omits some transactions, the latter will
be processed and validated by the next
honest masternode in the next block.
Furthermore, safety implies having a single agreed
upon chain where there are not two or
more competing chains with valid transactions in either
chain. As such, consensus protocols
are safe when blocks have settlement finality, or
else probabilistic finality. The XinFin
Network provides safety because it has a settlement
finality.
To note, XinFin Network has implemented the
Istanbul
Byzantine Fault Tolerant (IBFT)
consensus mechanism. The IBFT consensus mechanism
ensures instant finality, higher
throughput, manageable validator set, and a high Transaction
Per Second (TPS) rate.
10
10
Yutelin. “Istanbul Byzantine Fault Tolerance · Issue
#650 · Ethereum/EIPs.” GitHub, June 22, 2017.
https://github.com/ethereum/EIPs/issues/650
With the IBFT consensus mechanism, the XinFin Network
introduces several benefits
guaranteeing the network's safety and liveness. First,
the XinFin Network—via the
IBFT—guarantees immediate block finality. That is
because only 1 block is proposed at a
specific chain height. Thus, the single chain removes forking, prevents uncle blocks, and the
risks that a transaction may be “undone” once on the
chain at a later date. It’s worth noting
that XinFin’s MyContract—a next generation smart-contract
platform—will be IBFT
compliant, enabling the consensus to scale up to 2500
TPS.
Second, the IBFT consensus mechanism reduces times
between blocks. This occurs by
effectively reducing efforts needed to construct and
validate blocks, increasing the
throughput of the network. Third, with the IBFT consensus,
the XinFin Network ensures high
data integrity and fault tolerance. To clarify, the
IBFT employs a group of validators to ensure
the integrity of each block being proposed. Plus,
a super majority (66%) of the validators are
required to sign a block Byzantine, which is inserted
to the chain, making block forgery very
difficult. Thirdly, the IBFT consensus mechanism guarantees
operational flexibility. Notably,
the ‘leadership’ of the network's validators rotates
over time, preventing faulty nodes from
exerting long-term influence over the chain, introducing
undesirable liveness and safety
issues.
11
F.
DDOS Attack
Distributed denial of service (DDoS) attacks occur
when malicious characters overwhelm the
target or the related infrastructure with malicious
traffic. Employing networks of malware
compromised computers, bots, and other devices, an
attacker remotely controls the target
infrastructure. DDOS adversary affects the bandwidth
and connectivity leading to the
disruption of services on a network. To add, cloud-based
ecosystems suffer significant
losses since DDOS causes service degradation and in
some cases complete service denial.
11
Yutelin. “Istanbul Byzantine Fault Tolerance · Issue
#650 · Ethereum/EIPs.”
Fig.6.Distributed denial of service (DDoS) attack.
12
In the context of the XinFin Network, masternodes
are required to run on reputable public
cloud providers like AWS, Microsoft Azure or Google
Cloud, which provide multiple DDOS
prevention mechanisms. When some nodes are attacked
or fail-stop, the network still
operates correctly as long as the number of failing
and/or attacked nodes remains less than
1/4 of the number of masternodes.
G.
Spam Attack
XinFin Network keeps the same transaction fee mechanism
as Ethereum which employs gas
prices.
13
(Gas refers to the unit that measures the
amount of computational effort required to
execute specific operations on the Ethereum network).
14
However, the XinFin Network
supports a minimum transaction fee (1 wei--approx.
1/100 the gas price of Ethereum).
Concerns have been raised on the likelihood of spamming
given that attackers try to
broadcast a huge amount of low fee transactions to
the system. To deter spamming attacks,
however, the XinFin Network’s masternodes always sort
transactions and pick up only high
fee transactions into the proposing block. Thus, spammers
have little chance of harming the
system.
IV. RELATED WORK
Consensus plays an important role in guaranteeing
the success of distributed and
decentralized systems. Bitcoin’s core consensus protocol,
often referred to as the Nakamoto
consensus, realizes a “replicated state machine” abstraction.
In the abstraction, nodes in a
permissionless network reach agreement about a set
of transactions committed as well as
their ordering.
15
However, known permissionless consensus
protocols such as Bitcoin’s
Nakamoto consensus come at a cost. Bitcoin and Ethereum
rely on PoW to enforce, albeit
roughly, the idea of “one vote per hash power” and
to defend against Sybil attacks.
Unfortunately, PoW-based Bitcoin and Ethereum are
known to have terrible performance
(Bitcoin’s transaction processing performance is at
peak of around 7 transactions per second
as previously mentioned). Moreover, PoW is much criticized
because it costs a lot in terms of
electric energy consumed.
XinFin’s XDC Network Consensus is able to achieve
99% less energy consumption
compared to Proof of Work based networks like Bitcoin
or Ethereum. Data generated from
XinFin’s 140 Validators nodes power usage is compared
to that of Bitcoin and Ethereum in
Figure 7 below.
15
Nakamoto, Satoshi. “Bitcoin: A Peer-to-Peer Electronic
Cash System.” bitcoin.org, 2008. https://bitcoin.org/bitcoin.pdf.
14
Richards, Sam. “Gas and Fees.” ethereum.org, January
15, 2021. https://ethereum.org/en/developers/docs/gas/.
13
Buterin, Vitalik. “Ethereum Whitepaper.” ethereum.org,
2013. https://ethereum.org/en/whitepaper/.
12
Wani, Sharyar, Mohammed Imthiyas, Hamad Almohamedh, KhalidM Al Hamed, Sultan Almotairi, and Yonis Gulzar. “Distributed Denial of Service (DDoS) Mitigation
Using ...”
Fig.7. Comparison of Energy Consumption between Bitcoin,
Ethereum and XinFin XDC Network.
To design an efficient and cost-effective consensus
protocol in the permissionless model,
PoS has been discussed extensively in the Bitcoin
and Ethereum forum. A PoS blockchain
can substitute the costly PoW in Nakamoto’s blockchain
while still providing similar
guarantees in terms of transaction processing in the
presence of a dishonest minority of
users (this “minority” is to be understood here in
the context of stake rather than
computational power.) The Ethereum design, Casper,
published by Buterin & Griffith,
provides as its initial version a PoW/PoS hybrid consensus
protocol, which might eventually
switch to a pure XDPoS system. As with the XinFin
Network, Ethereum Casper requires that
validators (similar to block creators) deposit a specified
amount of ETH
—
a concept similar
to that used in the XinFin Network.
XinFin’s Delegated Proof of Stake (XDPoS) consensus
protocol, proposed in this paper, can
be seen as a hybrid model. In particular, XinFin applied
XDPoS with Double Validation to
create and verify blocks smoothly and efficiently.
Whenever potential fork branches are
detected, XinFin employs the concept PoW to select
the longest branch and then discard the
other branches. With this hybrid approach, XDPoS does
not only increase the performance
and security of the blockchain, but it also reduces
forks in an efficient and practical manner.
Recently, there are several consensus protocol research
works that are closely related to
XinFin Network such as EOS and Ouroboros of Cardano.
The mechanism of relying on
masternodes to reach consensus is utilized by Bitshares
and EOS, whose consensus
protocol is termed Delegated Proof-of-Stake (DPoS).
This DPoS is similar to the XinFin
Delegated Proof of Stake consensus in the XinFin Network.
Both systems are similar in the
sense that masternodes (block creators or witnesses
in DPoS) are elected through a voting
system.
16
However, XinFin Network requires that masternodes
need to deposit a required
minimum amount of XDC to become a masternode candidate,
which puts more pressure on
masternodes to work honestly. Furthermore, the Double
Validation mechanism of XinFin
Network lowers the probability of handshaking attacks
and having invalid blocks, as
16
Lee, Greg. “EOSIO/Documentation.” GitHub, April 28,
2018. https://github.com/EOSIO/Documentation/blob/master/TechnicalWhitePaper.md.
previously analyzed. EOS also has a maximum of 21 block producers for each epoch, which
is less decentralized than XinFin Network with a maximum of 108 masternodes.
17
,
18
The research-backed Cardano blockchain solution, namely
Ouroboros, with the ADA coin,
which is purely based on Proof-of-Stake, promises
to provide rigorous security guarantees.
Similar to the XinFin Network, Ouroboros has a set
of block producers for each epoch
creating blocks in a given sequence. Additionally,
each block producer candidate needs to
deposit a minimum amount of stake (an amount of ADA).
19
Worth noting, however, is that
Ouroboros only provides Single Validation, while the
XinFin Network carries out Double
Validation providing several advantages over Single
Validation, as previously analyzed. In
Ouroboros, the order of block producers, selected
among stakers, is based on a biased
randomization, while the XinFin Network randomization
for block verifiers is potentially
uniform and based on smart contracts. Furthermore,
the use of voting as in XinFin Network
and DPoS enables more incentive equality between stakers.
V. CONCLUSION AND PERSPECTIVES
In this paper, the XinFin Network proposed a XDPoS
blockchain protocol which has heuristic
and rigorous security guarantees, in addition to fast
finality. Also presented is a novel reward
mechanism, showing a capability to lower the probability
of having forks, and guaranteeing
fast confirmation time. Plus, the reward mechanism
indicates that the contributions and
benefits of masternodes are fair in the sense that
the probability distribution function is
uniform, eventually.
Perspectives
●
Future work: The XinFin team is currently working
on the implementation of the
XDPoS, which will be released on schedule as stated
in its roadmap. Furthermore, in
line with the network’s novel consensus protocol,
its team will investigate the
Sharding mechanism in order to provide even better
transaction processing and
performance. The XinFin team believes that the Sharding
technique with a stable
number of masternodes will provide better stability
and efficiency to the blockchain.
At the same time, the XinFin team commits to keeping
EVM-compatible smart
contracts within the network’s masternode Sharding
framework.
●
Economic sustainability is also an important concept
for a blockchain based
decentralized network. That means to maintain the
network in a sustainable
condition, an equilibrium needs to be achieved, in
which the cost of running the
network infrastructure could be offset by the revenues
generated. In this context, the
cost of network infrastructure consists of two parts:
the physical cost of having
hardware such as servers, memories that pass the network
technical requirements;
and the capital cost of having XDC locked into smart-contracts.
The revenues for
masternodes would primarily come from Reward Engine
emission, and later on from
service revenues such as token exchange fees provided
by applications running on
19
Hoskinson, Charles. “Why We Are Building Cardano
--a Subjective Approach.”
18
Lee , Greg. “EOSIO/Documentation.
17
Lee, Greg. “EOSIO/Documentation.
top of the XinFin Network. We will publish a XinFin Network economic analysis and
proposal, separate from this technical paper, at a
later date.
VI. Updated Note as on 17th march, 2021
Consensus level issue:
XDPoS Network is stable for the last 2 years but one
small Side Chain has been created as
of 14th march, 2021
Here is the event description and how fixed by the
masternode holders:
Incident date as on:
14-03-2021
Total Node affected:
67 out of 143
Side Chain Created at Blocks No:
27307800
Byzantine Fault/Problem
: Two separate networks started
after block 27307800 where one
original network and 27 nodes started synching as
an additional side network within a few
minutes 67 nodes became part of the side network.
Issue also described as
Byzantine fault
.
Quick fix
: Got Validators support (side chain validators)
and resolve additional network
issues by restarting/syncing nodes with original nodes
network.
XinFin Network
reference to understand issue:
XinFin Network is Fork of Ethereum Network and change
Network Consensus to XDPoS
Reference to GitHub code for consensus:
https://github.com/XinFinOrg/XDPoSChain/tree/master/consensus
Current network consensus details:
Validators Node have to stake 10Millions XDC to become
a part of validators Network.
Nos of masternoder/validators:
108
Backup Node:
32
Transaction process:
⅔ Node Validation to Write Block
of the transaction
Block time:
2 Seconds.
Block confirmation time to sync:
32 Blocks.
Current size of data:
40GB+
More details on Consensus at:
https://XinFin.org/XinFin-consensus
Network Bounty
: Technical as well as Research team
is still looking to resolve the above
consensus level issues. Foundation announced a large
bounty to prevent the
above-mentioned network consensus issue. XinFin Network
invites the technical/research
team to welcome suggestions to resolve the above issue.
Please create a GitHub pull
request and claim
XDC bounty
if you would like to
collaborate with a solution.
This whitepaper evolved on a time-to-time basis after
Livenet and testing various situations
and errors faced by the network. Please feel free
to add/suggest your feedback on the
GitHub page.
Endnotes:
1.
CB Insights. “58 Big Industries Blockchain Could Disrupt.”
CB Insights Research. CB
Insights, March 19, 2021.
https://www.cbinsights.com/research/industries-disrupted-blockchain/
.
2.
Ganne Emmanuelle, and Deepesh Patel. “Blockchain
& DLT In Trade: Where Do We
Stand?” Trade Finance Global. © Trade Finance Global,
October 1, 2020.
https://www.tradefinanceglobal.com/wp-content/uploads/2020/11/2020_TFG_BLOCKCH
AIN-_-DLT-IN-TRADE_Compressed.pdf
.
3.
Digiconomist “Bitcoin Energy Consumption Index.” Digiconomist,
March 10, 2021.
https://digiconomist.net/bitcoin-energy-consumption/
.
4.
Digiconomist “Ethereum Energy Consumption Index (Beta).”
Digiconomist, March 5,
2021.
https://digiconomist.net/ethereum-energy-consumption
.
5.
XinFin. 2021. "How to Deploy a XinFin Public masternode".
XinFin.Org.
https://docs.XinFin.org/docs/raw/masternodes
.
6.
Hoskinson, Charles. “Why We Are Building Cardano --a
Subjective Approach.”
https://whitepaper.io/search/result?q=Cardano. Cardano.
Accessed March 28, 2021.
https://assets.whitepaper.io/documents/HkUIhFWhL/HkUIhFWhL.pdf?AWSAccessKeyId
=AKIAI7X7HAN3A7HLG22A&Expires=1616935771&Signature=42S80pEKu3c1R5yA%
2Bh6p1i5srrA%3D
7.
Zoltu , Micah. “Ethereum/EIPs.” GitHub, September
29, 2020.
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md
.
8.
Yutelin. “Istanbul Byzantine Fault Tolerance · Issue
#650 · Ethereum/EIPs.” GitHub,
June 22, 2017.
https://github.com/ethereum/EIPs/issues/650
9.
Wani, Sharyar, Mohammed Imthiyas, Hamad Almohamedh,
KhalidM Alhamed, Sultan
Almotairi, and Yonis Gulzar. “Distributed Denial of
Service (DDoS) Mitigation Using ...”
Multidisciplinary Digital Publishing Institute. Accessed
March 29, 2021.
https://www.mdpi.com/2073-8994/13/2/227/pdf
.
10.
Buteri프로젝트로 돌아가기