bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 4쪽 중 2쪽
eportMalicious
method. With the reportMalicious
method only Validators can call, pass a message and
a block-number. If more than 2/3 of the
validators agree on the
reportMalicious
, a slashing
will be executed. The process can slash
a portion of the entire 100% stake of a Validator
Node.
C. XinFin Network Consensus Protocol
Motivation for XinFin’s Double Validation
On the XDPoS, Double Validation is motivated by the
need for an additional trust-less
validation layer that enhances security via a provable
uniform distribution. The trust-less
validation layer is achieved through decentralized
randomization. To clarify, once a
masternode creates a block, and before it’s added to XinFin’s blockchain, it’s mandatory that
such a masternode is verified by a randomly selected
set of masternodes.
Leveraging Double Validation, XinFin’s hybrid protocol
strengthens the network, improves
XDPoS security, reduces possibilities for nothing-at-stake
and fork attacks, and makes the
hybrid blockchain unique among Delegated Proof-of-Stake-based
blockchains.
Double Validation Process
Within the XinFin Network, masternodes have equal
responsibility in running the network
and keeping it stable. The network’s Full nodes (in
this case masternodes) run on powerful
hardware configurations and high-speed network connectivity,
ensuring the required block
time (estimated to be two seconds).
Moreover, only masternodes can produce and seal blocks.
For blocks to be produced and
sealed, the XinFin Network consensus relies on the
concept of Double Validation to improve
the reliability of existing consensus mechanisms,
namely Single Validation.
In the next section, we will cover XinFin’s Double
Validation process, then analyse the
differences and improvements of Double Validation
compared to Single Validation.
XinFin’s Double Validation (DV) is similar to some
existing PoS-based blockchains such as
Cardano. In the process, each block is created by
a block producer. A block producer is
primarily a masternode that takes its block creation
permission turn following a
pre-determined and circular sequence of masternodes
in each epoch.
5
However, the DV process in the XinFin Network differs
from the process in other
blockchains. It’s worth noting that DV in the XinFin
Network requires the signatures of two
masternodes on a block for the block to be published
on its blockchain. The block creator
(first masternode) provides the first signature. The
second masternode, which is the block
verifier, is randomly selected among a set of voted
masternodes to verify and sign a new
block.
In subsequent sections—for a more convenient read—the
terms ‘block creator’ and ‘block
verifier’ are used interchangeably for masternode
1 (block producer) and the randomly
selected masternode 2, respectively. The process of
randomly selecting the block verifiers is
detailed in the next paragraphs. Additionally, there
is no mining in the block creation as
demonstrated in Proof-of-Work-based blockchains (e.g.,
Ethereum and Bitcoin). This means
that a created block is valid if, and only if, it
is sealed by two signatures from a block creator
and a corresponding block verifier that confirms its
accuracy.
At XinFin, there is a strong belief that the unique
DV technique enhances the stability of the
blockchain by diminishing the probability of producing
‘garbage’ blocks, while simultaneously
maintaining the system security and consistency. Randomization
of block verifiers in DV is a
key factor in reducing risks associated with paired
masternodes trying to commit malicious
blocks.
Additionally, comparing XinFin’s blockchain architecture
with other blockchain setups
indicates that there are significant advantages to
the unique DV technique. Specifically, DV
introduces improvements in block time by only requiring
two signatures per block. In the
interest of demonstrating how the XinFin Network has
undergone enhancements, compared
5
Hoskinson, Charles. “Why We Are Building Cardano
--a Subjective Approach.”
to existing PoS-based blockchains, the following figures analyze the differences between
Double Validation and Single Validation mechanisms.
The limitations in some existing
blockchains serve to highlight the improvement introduced by Double Validation over Single
Validation.
In Fig. 2 and Fig. 3 below, benefits introduced by
DV as compared to SV are compared by
analyzing some attack scenarios.
Fig. 2. Single Validation (SV): (a) SV with block
creation masternode as an attacker and (b) SV with
two consecutive block
creation masternodes as attackers
●
Single Validation
In Single Validation and in an epoch, each masternode
(e.g., M1 in figure 2.), sequentially
takes its turn to create a block (e.g., block100).
The next masternode (e.g., M2) in the
sequence then validates the new block100. In the event
that block100 is invalid (implying
that M1 is potentially an attacker) and that the new
block contains a transaction that invalidly
benefits M1, an honest M2 rejects block 100 and creates
a valid block 100 next to block 99
(see Fig. 2 [a].)
However, if M2 is also an attacker (see Fig. 2 [b])
that cooperates with M1, M2 ignores the
invalidation of block100, signs it, and creates the
next block, namely block101 that is valid.
Subsequently, if masternode M3 verifies the validity
of block101, M3 signs block101 and
creates a block102. This way, Single Validation potentially
leaves the blockchain with
‘garbage’ or invalid blocks which require a ‘rebase’
to restore the validity of the blockchain.
●
Double Validation (DV)
With XinFin's DV technique, the likelihood of having
garbage blocks in the blockchain is
significantly reduced. In this case let’s assume that
M1 and M2 are the block creator and
block verifier of block100, respectively.
If block100 is invalid and M2 is honest (see Fig.
3 [a]), the next block creator M3, when
creating block101, notes that block100 doesn't have
the required number of signatures (two
signatures in XinFin’s case), and thus, rejects block100
and creates another block100 next
to block99. In the event that M2 is also an attacker
pairing/handshaking with M1 (see Fig. 3
[b]), M2 signs block100 despite its invalidity. Worth
noting is that XinFin’s block verifiers or
M2 are randomly selected, therefore there is little
chance of successfully pairing M1 and M2.
This limits the possibility of invalid blocks being
added to the blockchain.
Next, even after M3 verifies that block100 has two valid signatures, M3 still rejects it
because block100 is invalidated by M3 that will create
another valid block100. To break the
stability and consistency of XinFin’s blockchain,
in this case, M3 should be an attacker
together with M1 and M2. This scenario has a low probability
of occurring since block
verifiers are randomly selected. That said, DV strengthens
the consistency of the blockchain
and makes it hard to disrupt.
Fig. 3. Double Validation (DV): (a) DV with block
creator as an attacker and (b) DV with both block
creator and
block verifiers as attackers
Randomization for Block Verifiers for Double Validation
The First masternode or Block Creator: Within a given
epoch, the first masternode/block
creator(
v1
) is selected by a round-turn game and it
can be formally defined as an array.
6
The
array’s formula is as follows:
(equation: 1)
Random Matrix and Smart Contract
To select random verifiers for a subsequent epoch
(
e+1
), 3 (three) steps are followed. To
understand the three steps explained below, let
m
be the number of masternodes,
n
be the
number of slots in an epoch.
6
EMPTY
Step 1: Random Numbers Generation and Commitment Phase
First,
at the beginning of epoch
e
, each masternode
Vi
creates an array of
n + 1
special
random numbers
Recommendi
= [ri.1, ri.2, ..., ri.
n,
θ
i]
, where
ri. k
∈
[1, ..., m]
indicates
the recommendation of an ordered list of block verifiers
for the next epoch of
Vi
,
and
θ
i
∈
{−1, 0, 1}
is used for increasing the unpredictability
of the random numbers.
Second, each masternode
Vi
has to encrypt the array
Recommendi
using a secret key SKi,
say
Secreti = Encrypt (
Recommendi
, SKi)
as the encrypted
array. Next, each masternode
forms a “lock” message that contains encrypted array
Secreti, signs off this message with its
blockchain’s private key through the Elliptic Curve
Digital Signature Algorithm (ECDSA)
scheme that’s currently used in Ethereum and Bitcoin
along with the corresponding epoch
index and its public key generated from its private
key. After forming a “lock” message and
signing off the message via the ECDSA verifiable key,
every masternode can check who
created this lock message through ECDSA verification
scheme and which epoch it relates to.
Thereafter, each node
Vi
sends their lock message
with its signature and public key to a
Smart Contract stored in the blockchain. The process
enables each masternode to collect
and know the locks from all other masternodes.
7
Step 2: Recovery Phase
The recovery phase is for every node to reveal its
previous lock message so other nodes
can get to know the secret array it has sent before.
A masternode only starts revealing its
lock message if all masternodes have sent their lock
messages to the smart contract or a
certain timeout event occurs. Each masternode then
opens its lock message by sending an
“unlock” message to the smart contract for other masternodes
to open the corresponding
lock. Let’s imagine a commitment-like scheme, in this
case, where a lock message is a
commitment message locking its contained recommendation
array
Recommendi
so that no
one can open or guess the contained array, and the
unlock message gives the key for other
masternodes to decrypt the box and retrieve the values
of
Recommendi
. Eventually, a
masternode has both locks and unlocks to other masternodes.
If some elector is an
adversary which might publish its lock but not intend
to send the corresponding unlock, other
masternodes can ignore the adversary’s lock and set
all its random values be 1, by default.
The idea is simple: the network can keep working successfully
even if some masternodes
are adversaries.
Step 3: Assembled Matrix and Computation Phase
At the point of the slot
n
th
of the epoch
e
, the secret
arrays Secreti in the smart contract will
be decrypted by each masternode and return the plain
version of Recommendi. Each tuple
of the first n numbers of each
Vi
will be assembled
as the
i
th
column of an
n × m
matrix. All
the last number
θ
i
forms a
m × 1
matrix. Then each
node will compute the block verifiers
ordered list by some mathematical operations as explained
below. The resulting output is a
matrix
n × 1
indicating the order of block verifiers
for the next epoch
e + 1
.
For the second masternode or block verifier, each
node computes the common array
ν2
for
the order of the block verifiers by the following
steps as in Equation 1.
7
(
equation: 2
)
(
equation: 3
)
Then,
ν2
is obtained by modulo operation of element
values of
ν 0 2
as in Equation 2:
Finality Analysis
A standard definition of “total economic finality”:
A phenomenon occurring when ¾ (three
quarters) of all masternodes make maximum-odds bets
that a given block or state will be
finalized. This condition offers very strong incentives
for masternodes to never attempt
colluding to revert a block. When masternodes make
such a maximum odds bet, in any
blockchain where that block or state is not present,
the masternodes lose their entire
deposit.
8
XinFin Network maintains this standardization in the
design so that one block is considered
as irreversible if it collects up to three-quarters
of the signatures of all members in the
masternodes committee. The time-line of the blockchain
creation process, checking finality,
and marking the block as immutable are described in
Figure 4 below.
8
Fig. 4. Timeline of Blockchain Making Process
D. Consensus Protocol: Formalization
Basic Concepts & Protocol Description
To provide a solid educational foundation and to prove
that the XinFin Network can achieve
its claims, in the following section, we will present
a preliminary examination of the concepts
discussed in our yellow paper and an overview of XinFin
Delegated Proof of Stake (XDPoS).
To start, we will provide a presentation of XinFin’s
proof of stake consensus algorithm. The
formalization follows that of notable tokens, such
as Cardano and Thunder, in recent
literature. More specifically, XinFin places emphasis
on the following concepts and
definitions that were presented in literature for
Cardano and Thunder tokens and adapts
them to the context of XinFin Network.
Time, Slots, Epoch
Ideally, each epoch is divided into 900 block times.
Each of these block times is referred to
as a block slot. Only one block can be created in
a slot. The main assumption is that there is
a roughly synchronized clock that allows for masternodes
to learn the current slot. This
simplification effectively permits masternodes to
execute the signing and validation process
of the XDPoS consensus, where each masternode must
collectively create a block to the
current slot. Simplified further, each slot SLR is
accessed by an integer
r
∈
{1, 2, ...}
, and is
supposed that the real-time window that corresponds
to each slot has the following
properties, which are similar to what is specified
in Cardano.
6
A.
Every masternode can determine the index of the current
slot based on the current
time. And, any discrepancies between parties’ local
time are insignificant in
comparison with the length of time represented by
a slot.
B.
The amount of a slot time is sufficient to guarantee
that any message transmitted by
an honest party at the beginning of the time window
will be received by any other
honest party by the end of that time window. While
similar to Cardono’s assumption,
the XinFin Network adopts the assumption to ensure that block creators seamlessly
propagate their created blocks to the corresponding
block verifiers. This guarantees
a block is signed by both the masternodes before the
next block creator builds
another block on top of it.
As mentioned in Section II-A, in XinFin’s setting,
it's assumed that the fixed set of
m
(150)
masternodes
V1, V2, ...., Vm
interacts throughout
the protocol to reach the consensus. For
each
Vi
, a public/private key pair
(PKI, ski)
for
a prescribed signature scheme, ideally
ECDSA, is generated.
Additionally, XinFin’s protocol adopts the assumption
that the public keys
pk1
, ..., pkm
of the
masternodes are distributed and known by all masternodes
in the protocol (that means a
masternode knows all public keys of all other nodes).
Some notable definitions of the
blockchain concepts are defined following the notation.
Definition 1 (State):
A state is an encoded string
st
∈
{0, 1}
Definition 2 (Block):
A block B generated at a slot sli contains the current
state
st
∈
{0, 1}
λ,
data d
∈
{0, 1}
∗
,
the slot number
i
and a signature
Σ =
Signski (st,
d, sli)
computed under ski corresponding
to the masternode Vi generating the block
Algorithm 1: The algorithm illustrated the consensus
protocol
Input:
m
- Number of masternodes,
n
number of slots
in an epoch
Output: The complete ledger of the blockchain C
To create the complete ledger for block C, several
steps must be completed. These are as
follows:
(a)
Creating the empty blockchain (stack)
C
(b)
Commencing an Initial Coin Offering
(ICO) to raise funds to support the provision of cryptocurrencies
and blockchain-related
products and services
(c)
Issuance of tokens/coins
to holders. These tokens do not provide
equity stake, rather they deliver their owners some
stake in a product or service created by
the company and
(d)
Voting for the masternode committee
(masternodes)
VC ← {V1; V2; ...,
Vm}
.
Thereafter,
(e)
Initiate the first epoch
e1
← {sl1
,
sl2
, ..., sln
};
(f)
Randomly generate the array
of second masternodes for the first epoch
SV1 ← [v 1 2.1
, v1 2.2
, ..., v1 2. n
]
;
(g)
Create the
genesis block B0
;
(h
) Update the blockchain
C ← C.
push(B0
)
; while true do while j is less
than n to create block Bj
by the first masternode;
Update the blockchain C
← C. push (Bj
)
;
Then, step
(i)
validate the block Bj by the second
masternode;
(j)
broadcast and validate the
block Bj
by VCi; if Bj has more than 3/4 masternode
committee members’ signature then
FINALITY(Bj .ID) = true; if j = n then j ← 1; else
j++; if len(C) mod n = 0 then doCheckpoint();
Voting for the masternode committee for the next epoch
VC ← {V1; V2; ..., Vm}
; Random
generate the array of verifier masternodes for the
next epoch
(i + 1)th; SVi+1 ← [v i+1 2.1 ,
vi+1 2.2 , ..., vi+1 2.n ]; ei+1 ← i
∗
n
∗
2 + e1;
i++
;
Here’s a pictorial summary of the process:
Definition 3 (Blockchain):
A blockchain C is a sequence of blocks
B1
, ..., Bn
associated with a strictly increasing
sequence of slots for which the state sti of
Bi
is
equal to H(Bi−1), where H is a
collision-resistant cryptography hash function. To
add, a blockchain has a number of
properties, including the length of a chain len(C)
= n, which is its number of blocks, and the
block Bn
is the head of the chain, denoted head(C).
As mentioned earlier, in the XinFin Network model,
each time slot
sli
is set
as 2 seconds
and an epoch is a set as
R
of 900 slots
{sl1
, sl2
,
..., sl900
}. The duration of an epoch equals
1800 seconds. In summary, the consensus protocol of
XinFin Network consensus can be
formalized in Algorithm 1. Algorithm 1 is simulated
and explained as a process shown in Fig.
5
Fig. 5. Randomization of Block Verifiers, Creating
and Validating Blocks in Each Epoch
III. SECURITY ANALYSIS
A.
Nothing-at-stake
Nothing-at-stake is a well-known problem in PoS-based
blockchain, just like the 51% attack
in PoW algorithms. For PoW-based miners, it’s mandatory
to have CapEx (capital
expenditures) for buying mining equipment such as
ASICs. Similarly, there's a need for
OpEx (operation expenditures) such as electricity
to solve mathematical puzzles securing
the network. That means, there is always an intrinsic
cost for miners in mining regardless of
its success. In case of a fork, miners therefore always
allocate their resource (equipment) to
the chain that they believe is correct in order to
get incentives for compensating the intrinsic
costs in mining.
On the contrary, PoS-based systems don't rely on mining.
During an ideal execution creating
a fork, the only costs incurred relate to block validation
and signing. That is because
masternodes do not incur intrinsic costs. In this
case, there’s an inherent problem of the
masternode having no downside to staking both forks.
Therefore, there are actually two
issues in the original design of PoS. On one hand,
for any masternode, the optimal strategy
is to validate every chain/fork, so that the masternode
receives its rewards no matter which
fork wins. On the other hand, for attackers/malicious
masternodes, they can easily create a
fork for double spending.
The XinFin Network handles these two problems exceptionally.
(Note: Through the XinFin
Network consensus protocol, the XinFin Network maintains
a certain order of masternodes
in creating and sealing blocks during each epoch).
For the first issue, random/arbitrary forks never happen because block creation by the
masternodes is predetermined in each epoch. For the
second issue, the Double Validation
mechanism ensures that only one block can be validated
by the second randomly selected
masternode. That’s even when one malicious masternode
creates two blocks at its turn.
B.
Long-range attack
Within the XinFin Network, a block is valid only if
it collects Double Validation and is finalized
once 3/4 of masternodes verify. Therefore, as long
as the number of attackers or malicious
nodes and/or fail-stop nodes is less than or equal
to 1/4 the number of masternodes, the
number of masternodes signing a block is at least
3/4 the total number of masternodes,
which makes the block finalized.
Thus, there is no chance for one malicious masternode
to create a longer valid chain on the
XinFin Ne프로젝트로 돌아가기