bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 5쪽 중 3쪽
process in which the validator committee reaches agreement and
produces a chain of blocks for the guardian pool to finalize. Inspired by recent Proof-of-Stake
research works including Tendermint , Casper FFG , and Hot-Stuff , we have designed and 13 14 15
implemented the block settlement algorithm described below. It employs a rotating block
proposer strategy where the validators take turns to propose new blocks. Then, the
committee votes on the blocks to determine their order using a protocol similar to Casper FFG
and Hot-Stuff.
13
Buchman et al . Tendermint: Byzantine Fault Tolerance in the Age of Blockchains
14
Buterin et al . Casper the Friendly Finality Gadget
15
Yin et al . HotStuff: BFT Consensus in the Lens of Blockchain
17
Block Proposal
The validators rotate in a round robin fashion to play the role of block proposer, which is
responsible for proposing the next block for the validator committee to vote on. To enable the
round robin rotation, each proposer maintains a local logical clock called epoch . Assuming
there are m validators, during epoch t , the validator with index ( t mod m ) is elected as the
proposer for that epoch. We note it is important that:
1) The epoch t should not be stalled so the liveness of the proposer rotation is
guaranteed; and
2) The epoch t of different validators should be mostly in sync, i.e. most of the time all
the validators have the same t value, so they can agree on which node should produce
the next block.
Below is our protocol for proposer election and block proposal.
Algorithm 1: Round Robin Block Proposal
t ← 0, proposer ← 0
voted ← false, received ← false, timeout ← false
loop begin
proposer ← t mod m
if ( proposer == self.index ) and (not proposed yet) begin // node elected as the proposer
propose one block
end
voted ← the node has proposed or voted for a block for epoch t
received ← the node has received m /3 + 1 EpochChange ( t + 1) messages
timeout ← timeout reached
if voted or received or timeout begin
broadcast message EpochChange ( t + 1)
end
if the node has received 2 m /3 EpochChange ( t + 1) messages begin
t ← t + 1 // enters epoch t + 1
voted ← false, received ← false, timeout ← false
end
sleep for some time
end
Algorithm 1 . The round robin block proposal protocol
The protocol defines a message EpochChange ( t+1) , which can be viewed as a synchronization
message passed among the validators to assist them to advance to the next epoch t + 1
together. Essentially, a validator broadcasts message EpochChange ( t + 1) to all other
validators if any of the following conditions is met:
1) the node has proposed or voted for a block in epoch t , or
2) the node has received m /3 + 1 EpochChange ( t + 1) messages from other validators, or
3) the node timed out for epoch t (the timeout is set to 4 ).Δ
18
On the other hand, the validator enters epoch t + 1 when it has received 2 m /3
EpochChange ( t +1) messages from other nodes.
Here we show that this protocol meets the above two requirements.
Eventual Progression : All the honest nodes will eventually enter epoch t+1 . In the worst case,
all the honest nodes (at least 2 m /3 + 1 nodes) reach timeout and broadcast the
EpochChange ( t +1) messages. Under the timing model assumption, all these messages will be
delivered within time after being sent out. Thus each honest node will receive at least 2 m /3 Δ
EpochChange ( t + 1) messages, and it then enters epoch t + 1 .
Epoch Synchrony : Intuitively, this means the epochs of all the honest nodes “move together”.
More precisely, we claim that the time any two honest nodes enter epoch t + 1 differ by at
most most 2 . To prove this, we note that since there are at most f faulty nodes, for the first Δ
honest node to enter epoch t + 1 , at least m /3 other honest nodes must have broadcasted the
EpochChange ( t + 1) messages. This honest node then also broadcasts an EpochChange ( t+1)
message following the protocol. After at most , any honest node should have received at Δ
least m /3 + 1 EpochChange ( t + 1) messages, which triggers them to also broadcast the
EpochChange ( t + 1) message. After , all the honest nodes receive 2 m /3 EpochChange ( t+1) Δ
messages and enter epoch t+1 . Thus, at most 2 after the first honest node enters epoch t+ Δ
1 , the last honest node will enters the same epoch.
In practice, when the network latency is small enough, all the honest nodes should enter
epoch t + 1 at almost the same time. As a result, they can agree on who is the next proposer.
Also we note that for the actual implementation, the EpochChange ( t + 1) messages can be
combined with other types of messages (e.g. block votes) to improve the efficiency. So that in
the normal case (no proposer failure), no additional synchronization overhead is added to the
system for epoch changes.
Block Consensus Among Validators
The protocol to settle proposed blocks involves a PBFT-based voting procedure among all
validators, similar to Casper FFG and Hot-Stuff. In the Theta Ledger blockchain, the header of
each block contains a hash pointer to its parent block (i.e. the previous block in the chain),
similar to Bitcoin and Ethereum. Two blocks are conflicting if neither block is an ancestor of the
other. If there are multiple, conflicting block proposals for the same epoch, an honest validator
keeps all of them until one becomes settled, and then it discards all conflicting blocks.
The block settlement protocol operates epoch by epoch. The proposer for the current epoch
sends to all validators a block proposal. A validator reacts by broadcasting a vote for the block.
All messages are signed by their senders.
The header of the proposed block might carry a commit-certificate , which consists of at least
(2 m /3 + 1) signed votes for its parent block. We note that under the assumption that no more
than m /3 validators are faulty, at most one block per height can obtain a commit-certificate. A
commit-certificate for a block indicates this block and all its predecessors are committed. The
proposed block may carry no commit-certificate, if its parent block did not get ≥ 2 m /3 + 1
signed votes.
For the validators that are not the current proposer, their job is to vote on the proposed blocks.
Once a validator receives the new block, it broadcasts a signed vote to all validators, so it can
19
be collected by the proposer of the next epoch to form the commit-certificate. If two
consecutive blocks A and B both receive a commit-certificate, then the parent block A and all
its predecessors are considered settled . To ensure safety, we require that honest nodes never
vote for a block that conflicts with a settled block . When there are forks (either due to faulty
proposer or asynchrony), the honest nodes should vote for the blocks on the longest fork .
The figure below illustrates the block settlement process. Assume that the proposer for height
101 is faulty, and it proposed two conflicting blocks X 101 and Y 101 , which leads to two branches.
Assuming neither block X 101 nor Y 101 gets ≥2 m /3+1 votes, then, neither the header of X 102 nor
Y 102 contains the commit-certificate (denoted by nil in the figure). However, at some point
branch X grows faster, and two consecutive blocks X 102 and X 103 both obtain ≥2 m /3+1 votes.
After that the upper branch X up to block X 102 is considered settled. And the lower branch Y can
be discarded.
Figure 6 . The block settlement process
The above example also illustrates one advantage of our implementation compared to other
PBFT based protocols like Tendermint — a block that does not receive a commit-certificate
can also be included in the settled chain, as long as one of its successor blocks is settled. For
instance, block X 101 in the example did not get a commit-certificate, but after block X 102 is
settled, it is also considered settled. This reduces the waste of computation power and helps
increase the transaction throughput.
Analysis
Safety : Safety means all honest validators agree on the same chain of blocks. More precisely, if
one honest validator accepts a block A, then any future blocks accepted by other honest
validators will appear in a chain of blocks that already contains A. The argument for safety is
similar to Casper FFG and Hot-Stuff and is omitted here. We just want to point out that safety
stems from the requirement that honest nodes never vote for a block that conflicts with a
settled block.
Liveness : Liveness means the validator committee always makes progress, i.e., always able to
produce and agree on new blocks. Here we show that under our timing model, during the
synchronous periods, the committee can always achieve the liveness goal. First, in the “Block
Proposal” section, we have proved that the epoch can always advance, and all the honest
20
validators march forward together. In an epoch where the proposer is an honest validator, it
will propose a new block. For the block settlement process, liveness depends on that during
the synchronous periods, there are infinitely many epochs where two proposers in a row are
honest, and wait sufficiently long to form the commit-certificate. We note this is guaranteed
to happen infinitely often with the round robin rotation, since at least 2/3 of the validators are
honest.
Transaction throughput : With ten to twenty validators, the committee can produce and settle
the chain of blocks rather quickly. Average block production and settlement time is in the order
of seconds, and this leads to high throughput of as much as 1000+ transactions per second.
The Block Finalization Process
In this section, we will discuss the “leapfrogging” block finalization process in detail. As
mentioned above, the guardians only need to reach consensus on the hashes of the
checkpoint blocks, which are the blocks whose heights are multiple of of some integer T (e.g. T
= 100 ).
To see why it is sufficient to finalize just the checkpoint blocks, we note that the transaction
execution engine of the blockchain software can be viewed as a “deterministic state machine”,
whereas a transaction can be viewed as a deterministic state transfer function. If two nodes
run the same state machine, then from an identical initial state, after executing the same
sequence of transactions, they will reach an identical end state. Note that this is true even
when some of the transactions are invalid, as long as those transactions can be detected by
the state machine and skipped. For example, assume there is a transaction that tries to spend
more tokens than the balance of the source account. The state machine can simply skip this
transaction after performing a sanity check. This way the “bad” transactions have no impact
on the state.
In the context of blockchain, if all the honest nodes have the same copy of the blockchain, they
can be ensured to arrive at the same end state after processing all the blocks in order. But with
one caveat — the blockchain might contain a huge amount of data. How can two honest
nodes compare whether they have the same chain of blocks efficiently?
Here the immutability characteristic of the blockchain data structure becomes highly relevant.
Since the header of each block contains the hash of the previous block, as long as two nodes
have the same hash of the checkpoint block, with overwhelming probability, they should have
an identical chain of blocks from genesis up to the checkpoint. Of course each guardian node
needs to verify the integrity of the blockchain. In particular, the block hash embedded in each
block header is actually the hash of the previous block. We note that a node can perform the
integrity checks on its own, no communication with other nodes is required.
Interestingly, the immutability characteristic also enhances the tolerance to network
asynchrony or even partition. With network partition, the guardians may not be able to reach
consensus on the hash of a checkpoint. However, after the network is recovered, they can
move on to vote on the next checkpoint. If they can then reach agreement, then all the blocks
up to the next checkpoint are finalized, regardless of whether or not they have consensus on
the current checkpoint.
To provide byzantine fault tolerance, an honest node needs to be assured that at least
two-thirds of the guardians have the same checkpoint block hash. Hence it needs to receive
21
signatures for a checkpoint hash from at least two-third of all guardians before the node can
mark the checkpoint as finalized. This is to ensure safety, which is similar to the “commit” step
in the celebrated PBFT protocol.
Since the guardians only need to vote on checkpoint hashes every T blocks, they have more
time to reach consensus. A straightforward implementation of checkpoint finalization is thus
to follow the PBFT “commit” step where each guardian broadcasts its signature to all other
guardians. This requires each node to send, receive and process O ( n ) messages, where each
message can be a couple kilobytes long. Even with T blocks time, this approach still cannot
scale beyond a couple hundred guardian nodes, unless we select a large T value, which is
undesirable since it increases the block finalization latency.
Scaling to Thousands of Guardians
To reduce the communication complexity and scale to thousands of guardians, we have
designed an aggregated signature gossip scheme inspired by the BLS signature aggregation
technique and the gossip protocol. The scheme requires each guardian node to process a 16
much smaller number of messages to reach consensus, which is much more practical. Below
are the steps of the aggregated signature gossip protocol. It uses the BLS algorithm for
signature aggregation.
Algorithm 2: Aggregated Signature Gossip
finalized ← false, ← SignBLS ( sk i , height cp || hash cp ), ← InitSignerVector ( i ) σi ci
for t = 1 to L begin
send ( , ) to all its neighboring guardians σi ci
if finalized break
wait for ( , ) from all neighbors until timeoutσj cj
verify each ( , ), discard if it is invalidσj cj
aggregate valid signatures , σi ←σi ∙ ∏
j
σj od p ci ← c( i+ ∑
j
cj)m
calculate the number of unique signers s ← ∑
n
I(c )i k[ ]>0
if finalized ← true n s ≥ 32
end
Algorithm 2. The aggregated signature gossip protocol
The core idea is rather simple. Each guardian node keeps combining the partially aggregated
signatures from its neighbors, and then gossips this newly aggregated signature out. This way
the signature share of each node can reach other nodes at exponential speed by using the
gossip protocol. In addition, the signature aggregation keeps the size of the messages small,
and thus reduces the communication overhead.
In the above diagram, i is the index of the current guardian node. The first line of the protocol
uses function SignBLS () to generate its initial aggregated signature . It essentially signs a σi
16
Boneh et al . A Survey of Two Signature Aggregation Techniques
22
message which is the concatenation of the height and hash of the checkpoint block using the
BLS signature algorithm, with multiplicative cyclic group G of prime order p , and generator g :
hi ←H pk, height || hash( i cp cp)
σi ←(h)i
ski
In the first formula above, function is a hash function that takes both the H :G ×{0, 1} * →G
public key pk i and the message as input. This is to prevent the rogue public-key attack . 17
The protocol also uses function InitSignerVector() to initialize the signer vector , which is an ci
n dimensional integer vector whose j th entry represents how many times the j th guardian has
signed the aggregated signature. After initialization, its i th entry is set to 1 , and the remaining
entries are all set to 0 .
After initialization, the guardian enters a loop. In each iteration, the guardian first sends out its
current aggregated signature and the signer vector to all its neighbors. Then, if it has not σi ci
considered the checkpoint as finalized, it waits for the signature and signer vector from all its
neighbors, or waits until timeout. Upon receiving all the signature and signer vectors, it checks
the validity of ( , ) using the BLS aggregated signature verification algorithm.σj cj
(pk , height || hash ) hu ←H u cp cp
check if e σ , g( j ) = ∏
n
u
(e )(h , pk )u u
c [u]j
where is a bilinear mapping function from to G T , another multiplicative e:G ×G →GT G ×G
cyclic group also of prime order p . All the invalid signatures and their associated signer vectors
are discarded for the next aggregation step. It is worth pointing out that besides height cp ,
hash cp , the above check also requires the public key pk u of the relevant guardians as input. All
this information should be available locally, since when a guardian locks up its stake, its public
key should be attached to the stake locking transaction which has already been written into
the blockchain. Hence, no communication with other nodes is necessary to retrieve these
inputs.
The aggregation step aggregates the BLS signature , and updates the signer vector . Note σj cj
that for the vector update, we take mod p for each entry. We can do this because
, which is a multiplicative cyclic group of prime order p . This guarantees that e(h , pk )u u ∈GT
the entries of vector can always be represented with a limited number of bits.cj
, σi ←σi ∙ ∏
j
σj od p ci ← c( i+ ∑
j
cj)m
The algorithm then calculates the number of unique signers of the aggregated signature.
s ← ∑
n
I(c )i k[ ]>0
17
Boneh et al . BLS MultiSignatures With PublicKey Aggregation
23
Here function I: {true, false} → {1, 0} maps a true condition to 1 , and false to 0 . Hence the
summation counts how many unique signers have contributed to the aggregated signature. If
the signature is signed by more than two-third of all the guardians, the guardian considers the
checkpoint to be finalized.
If the checkpoint is finalized, the aggregated signature will be gossipped out in the next
iteration. Hence within O ( log ( n )) iterations all the honest guardians will have an aggregated
signature that is signed by more than two-third of all the guardians if the network is not
partitioned.
The loop has L iterations, L should be in the order of O ( log ( n )) to allow the signature to
propagate through the network.
Analysis
Aggregated Signature Gossip Correctness : To prove the correctness of the aggregated
signature gossip protocol, we need to prove two claims. First, if an aggregated signature is
correctly formed by honest nodes according to Algorithm 2, it can pass the check given by
Formula (4). Second, the aggregated signature is secure against forgery. Stated more formally,
forging a fake aggregated signature in the context of Algorithm 2 means to find σ ∈ G and
integers c 1 , c 2 , … c n which satisfy the equation below
e(σ, g) = ∏
n
u=1
(e )(h , pk )u u
cu
for randomly chosen , …, , and random message hashes h 1 …, h n ∈ G . pk1 =gsk1 ∈ G pkn =gskn
It can be shown that this is as hard as the Computational Diffie-Hellman (CDH) problem. For
the proof of these two claims, please refer to our multi-level BFT technical report.
Finalization Safety : Safety of the block finalization is easy to prove. Under the 2/3
supermajority honesty assumption, If two checkpoint hashes for the same height both get
aggregated signatures from at least 2/3 of all guardians, at least one honest guardian has to
sign different hashes for the same height, which is not possible.
Finalization Liveness : Without network partition, as long as L is large enough, it is highly likely
that after O ( log ( n )) iteration, all the honest nodes will see an aggregated signature that
combines the signatures of all honest signers. This is similar to how 프로젝트로 돌아가기