<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://icstaging.mywikis.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=VictorShoup</id>
	<title>Internet Computer Wiki Staging - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://icstaging.mywikis.net/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=VictorShoup"/>
	<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/wiki/Special:Contributions/VictorShoup"/>
	<updated>2026-06-06T06:15:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=1123</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=1123"/>
		<updated>2021-12-01T16:44:51Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is designed to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
==Assumptions==&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically synchronous&lt;br /&gt;
for short intervals of time.&lt;br /&gt;
In such intervals of synchrony, all undelivered     &lt;br /&gt;
messages will be delivered in less than time &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;,&lt;br /&gt;
for some fixed bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a reasonable bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
==Protocol overview==&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; &lt;br /&gt;
[[#Random Beacon|(see below)]].&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is synchronous,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not synchronous,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
Even if the protocol proceeds for a few rounds without extending the&lt;br /&gt;
finalized path, the height of the tree will continue to grow&lt;br /&gt;
with each round, so that when the finalized path is extended in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the finalized path will be of length &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
A consequence of this,&lt;br /&gt;
even if the &amp;lt;i&amp;gt;latency&amp;lt;/i&amp;gt; occasionally&lt;br /&gt;
occasionally increases because of faulty replicas or unexpectedly &lt;br /&gt;
high network latency,&lt;br /&gt;
the &amp;lt;i&amp;gt;throughput&amp;lt;/i&amp;gt; of the protocol&lt;br /&gt;
remains essentially constant. &lt;br /&gt;
&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol may proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
==Public keys==&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages&lt;br /&gt;
sent by replicas.&lt;br /&gt;
&lt;br /&gt;
The protocol also uses the &lt;br /&gt;
&amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
The protocol will use these multi-signatures&lt;br /&gt;
for [[#Notarization|notarizations]] and [[#Finalization|finalization]],&lt;br /&gt;
which are aggregations of &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; signatures on messages&lt;br /&gt;
of a certain form.&lt;br /&gt;
&lt;br /&gt;
==Random Beacon==&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Block making==&lt;br /&gt;
&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
==Notarization==&lt;br /&gt;
&lt;br /&gt;
A block is effectively added to the tree of blocks when it becomes &lt;br /&gt;
&amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, &lt;br /&gt;
&amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must &amp;lt;b&amp;gt;support&amp;lt;/b&amp;gt; its notarization.&lt;br /&gt;
&lt;br /&gt;
Given a proposed block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
a replica will determine if the proposal is &amp;lt;b&amp;gt;valid&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; has the syntactic form described above.&lt;br /&gt;
In particular, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; should contain the hash of &lt;br /&gt;
a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt; that is already&lt;br /&gt;
in the tree of blocks (i.e., already notarized).&lt;br /&gt;
In addition, the payload of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; must satisfy certain&lt;br /&gt;
conditions (in particulat, all of the transaction requests in the payload&lt;br /&gt;
must satisfy various constraints, but these constraints are unrelated&lt;br /&gt;
to consensus).&lt;br /&gt;
Also, the rank of the block maker (as recorded in the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;) &lt;br /&gt;
must match&lt;br /&gt;
the rank assigned in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; by the random beacon&lt;br /&gt;
to the replica that proposed the block (as recorded in the block proposal) .&lt;br /&gt;
&lt;br /&gt;
If the block is valid and certain other constraints hold,&lt;br /&gt;
the replica will &amp;lt;b&amp;gt;support&amp;lt;/b&amp;gt; the notarization of the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity of the supporting replica, and&lt;br /&gt;
* the supporting replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &lt;br /&gt;
&amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the set of identities of the &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; supporting replicas,&lt;br /&gt;
* an aggregation of the &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; signatures on the message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As soon as a replica obtains a notarized block of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
it will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and will subsequently not support the notarization of&lt;br /&gt;
any other blocks at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At this point in time, such a replica will also relay this &lt;br /&gt;
notarization to all other replicas.&lt;br /&gt;
Note that this replica may have obtained the notarization either by&lt;br /&gt;
(1) receiving it from another replica, or (2) aggregating &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt;&lt;br /&gt;
notarization shares that it has received.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;growth invariant&amp;lt;/b&amp;gt; states that each honest replica will &lt;br /&gt;
eventually complete each round, so that the tree of notarized blocks&lt;br /&gt;
continues to grow (and this holds only assuming asynchronous eventual delivery,&lt;br /&gt;
and not partial synchrony).&lt;br /&gt;
We prove the growth invariant  &lt;br /&gt;
[[#Proof of growth invariant|below]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finalization==&lt;br /&gt;
&lt;br /&gt;
There may be more than one &lt;br /&gt;
notarized block at a given height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
However, if a block is &amp;lt;b&amp;gt;finalized&amp;lt;/b&amp;gt;, then we can be sure that there&lt;br /&gt;
is no other notarized block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;safety invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a block to become finalized, &lt;br /&gt;
&amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its finalization.&lt;br /&gt;
Recall that round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; ends for a replica when &lt;br /&gt;
it obtains a notarized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At that point in time, such a replica will &lt;br /&gt;
check if it supported the notarization of any block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;i&amp;gt;other&amp;lt;/i&amp;gt; than block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; (it may or may not have &lt;br /&gt;
supported the notarization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; itself).&lt;br /&gt;
If not, the replica will support the finalization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
by broadcasting a &lt;br /&gt;
&amp;lt;b&amp;gt;finalization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A finalization share has exactly the same format as a notarization share&lt;br /&gt;
(but is tagged in such a way notarization shares&lt;br /&gt;
and finalization shares cannot be confused with one another).&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; finalization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;finalization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
which has exactly the same format as a notarization&lt;br /&gt;
(but again, is appropriately tagged).&lt;br /&gt;
Any replica that obtains a finalized block will broadcast the finalization &lt;br /&gt;
to all other replicas.&lt;br /&gt;
&lt;br /&gt;
We prove the safety invariant  &lt;br /&gt;
[[#Proof of safety invariant|below]].&lt;br /&gt;
One consequence of the safety invariant is the following.&lt;br /&gt;
Suppose two blocks &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; are finalized,&lt;br /&gt;
where &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; has height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; has height&lt;br /&gt;
&amp;lt;math&amp;gt;h&#039;\le h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the safety invariant implies that the path &lt;br /&gt;
in the tree of notarized blocks&lt;br /&gt;
ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; is a prefix of the path ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
(if not, then there would be two notarized blocks at height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt;,&lt;br /&gt;
contradicting the finalization invariant).   &lt;br /&gt;
Thus, whenever a replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
it may view all ancestors of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; as being &lt;br /&gt;
&amp;lt;b&amp;gt;implicitly finalized&amp;lt;/b&amp;gt;, and because of the&lt;br /&gt;
safety invariant, the &amp;lt;b&amp;gt;safety property&amp;lt;/b&amp;gt; is&lt;br /&gt;
guaranteed to hold for these (explicitly and implicitly) finalized blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Delay functions==&lt;br /&gt;
&lt;br /&gt;
The protocol makes use of two &amp;lt;b&amp;gt;delay functions&amp;lt;/b&amp;gt;, &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;,&lt;br /&gt;
which control&lt;br /&gt;
the timing of block making and notarization activity.&lt;br /&gt;
Both of these functions map the rank &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; of the proposing replica&lt;br /&gt;
no a nonnegative delay amount,&lt;br /&gt;
and it is assumed that each function is monotonely increasing in &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;,&lt;br /&gt;
and that &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}(r) \le \Delta_\textrm{n}(r)&amp;lt;/math&amp;gt;&lt;br /&gt;
for all &amp;lt;math&amp;gt;r = 0, \ldots, n-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
The recommended definition of these functions is&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}(r) = 2 \delta r&amp;lt;/math&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}(r) = 2 \delta r + \epsilon&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; is an upper bound on the time to deliver&lt;br /&gt;
messages from one honest replica to another,&lt;br /&gt;
and &amp;lt;math&amp;gt;\epsilon \ge 0&amp;lt;/math&amp;gt; is a &amp;quot;governor&amp;quot; to keep the&lt;br /&gt;
protocol from running too fast.&lt;br /&gt;
With these definitions, liveness will be ensured in those&lt;br /&gt;
rounds in which (1) the leader is honest, and (2) messages really&lt;br /&gt;
are delivered between honest parties within time &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Indeed,&lt;br /&gt;
if (1) and (2) both hold in a given round, then the block proposed&lt;br /&gt;
by the leader in that round will be finalized.&lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;liveness invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
We prove this &lt;br /&gt;
[[#Proof of liveness invariant|below]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Putting it all together==&lt;br /&gt;
&lt;br /&gt;
We now describe in more detail how the protocol works;&lt;br /&gt;
specifically, we describe more precisely when a replica will&lt;br /&gt;
propose a block and when a replica will support the notarization of a block. &lt;br /&gt;
A given replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will record the time at which it &lt;br /&gt;
enters a given round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
which happens when it has obtained (1) some notarization for a &lt;br /&gt;
block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;, and (2) the random beacon for&lt;br /&gt;
round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Since the random beacon for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; has been determined,&lt;br /&gt;
&amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; can determine its own rank &amp;lt;math&amp;gt;r_P&amp;lt;/math&amp;gt;, as well as the &lt;br /&gt;
rank &amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt; of each other replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; &lt;br /&gt;
for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Random beacon details===&lt;br /&gt;
&lt;br /&gt;
As soon as a replica enters round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, it will generate and broadcast &lt;br /&gt;
its share of the random beacon at round &amp;lt;math&amp;gt;h+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Block making details===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will only propose its own block &amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;&lt;br /&gt;
provided (1) at least &amp;lt;math&amp;gt;\Delta_\textrm{m}(r_P)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no valid lower ranked block currently seen by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that since &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; is guaranteed to have a notarized block&lt;br /&gt;
of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
when it enters round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, it can make its proposed&lt;br /&gt;
block a child of this notarized block (or any other &lt;br /&gt;
notarized block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; that it may have).&lt;br /&gt;
Also note that when &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; broadcasts its proposal for &amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;,&lt;br /&gt;
it must also ensure that it also has relayed the notarization of &lt;br /&gt;
&amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;&#039;s parent to all replicas.&lt;br /&gt;
&lt;br /&gt;
Suppose a replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; sees&lt;br /&gt;
a valid block proposal from a replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;&lt;br /&gt;
of rank&lt;br /&gt;
&amp;lt;math&amp;gt;r_P &amp;lt; r_Q&amp;lt;/math&amp;gt;&lt;br /&gt;
such that&lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{m}(r_P)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no block of rank less than &amp;lt;math&amp;gt;r_P&amp;lt;/math&amp;gt; &lt;br /&gt;
currently seen by &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then at this point in time, if it has not already done so,&lt;br /&gt;
&amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; will relay this block proposal&lt;br /&gt;
(along with the notarization of the proposed block&#039;s parent) &lt;br /&gt;
to all other replicas. &lt;br /&gt;
&lt;br /&gt;
===Notarization details===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will support the notarization &lt;br /&gt;
of a valid block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; proposed by a &lt;br /&gt;
replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; of rank &lt;br /&gt;
&amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt;&lt;br /&gt;
provided &lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{n}(r_Q)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and&lt;br /&gt;
(2) there is no block of rank less than &amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt; &lt;br /&gt;
currently seen by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Proof of growth invariant===&lt;br /&gt;
&lt;br /&gt;
The growth invariant states that&lt;br /&gt;
each honest replica will &lt;br /&gt;
eventually complete each round.&lt;br /&gt;
Assume that all honest replicas have started round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Let &amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; be the rank of the lowest ranked &lt;br /&gt;
honest replica &amp;lt;math&amp;gt;P^*&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Eventually, &amp;lt;math&amp;gt;P^*&amp;lt;/math&amp;gt; will either (1) propose its own block,&lt;br /&gt;
or (2) relay a valid block proposed by a lower ranked replica. &lt;br /&gt;
In either case, some block must eventually be supported by all honest replicas,&lt;br /&gt;
which means that some block will become notarized and all honest replicas&lt;br /&gt;
will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Proof of safety invariant===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;safety invariant&amp;lt;/b&amp;gt; states that if a block is finalized in a given round,&lt;br /&gt;
then no other block may be notarized in that round.&lt;br /&gt;
Here is a proof of the safety invariant:&lt;br /&gt;
# Suppose that the number of corrupt parties is exactly &amp;lt;math&amp;gt;f^* \le f &amp;lt; n/3&amp;lt;/math&amp;gt;.&lt;br /&gt;
# If a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is finalized, then its finalization must have been supported by a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (by the security property for aggregate signatures). &lt;br /&gt;
# Suppose (by way of contradction) that another block &amp;lt;math&amp;gt;B&#039; \ne B&amp;lt;/math&amp;gt; were notarized. Then its notarization must have been supported by a set &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (again, by the security property for aggregate signatures).&lt;br /&gt;
# The sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; are disjoint (by the finalization logic).&lt;br /&gt;
# Therefore, &amp;lt;math&amp;gt;n-f^* \ge |S \cup S&#039;| = |S| + |S&#039;| \ge 2 (n-f-f^*)&amp;lt;/math&amp;gt;, which implies &amp;lt;math&amp;gt;n \le 3f&amp;lt;/math&amp;gt;, a contradiction.&lt;br /&gt;
&lt;br /&gt;
===Proof of liveness invariant===&lt;br /&gt;
&lt;br /&gt;
We say that the network is &lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;-synchronous at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;&amp;lt;/b&amp;gt; if &lt;br /&gt;
if all messages that have been sent by honest replicas at or before time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; arrive at their destinations before time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;liveness invariant&amp;lt;/b&amp;gt; may be stated as follows.&lt;br /&gt;
Suppose that &amp;lt;math&amp;gt;\Delta_\mathrm{n}(1) \ge \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Also &lt;br /&gt;
suppose that in a given round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, we have &lt;br /&gt;
* the leader &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is honest,&lt;br /&gt;
* the first honest replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; to finish round &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; does so at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the network is &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;-synchronous at times &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t+\delta+\Delta_\mathrm{m}(0)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the block proposed by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; will be finalized.&lt;br /&gt;
&lt;br /&gt;
Here is a proof of the liveness invariant:&lt;br /&gt;
# Under partial synchrony at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, all honest replicas will enter round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; before time &amp;lt;math&amp;gt;t+\delta&amp;lt;/math&amp;gt; (the notarization that ended round &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, as well as the necessary round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon shares, will arrive at all honest replicas before this time).&lt;br /&gt;
# The leader &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; will propose a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; before time &amp;lt;math&amp;gt;t+\delta+\Delta_\mathrm{m}(0)&amp;lt;/math&amp;gt;, and again by partial synchrony, this block proposal will be delivered to all other replicas before time &amp;lt;math&amp;gt;t+2\delta+\Delta_\mathrm{m}(0)&amp;lt;/math&amp;gt;. &lt;br /&gt;
# Since &amp;lt;math&amp;gt;\Delta_\mathrm{n}(1) \ge \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt;, the protocol logic guarantees that each honest replica supports the notarization of block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and no other block, and thus &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; will become notarized and finalized.  &lt;br /&gt;
&lt;br /&gt;
==Other issues==&lt;br /&gt;
&lt;br /&gt;
===Growth latency===&lt;br /&gt;
&lt;br /&gt;
Under a partial synchrony assumption, we can also formulate and prove&lt;br /&gt;
a quantitative version of the growth invariant.&lt;br /&gt;
For simplicity, assume that the delay functions are defined&lt;br /&gt;
as recommended above: &amp;lt;math&amp;gt;\Delta_\textrm{m}(r) = 2 \delta r&amp;lt;/math&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}(r) = 2 \delta r + \epsilon&amp;lt;/math&amp;gt;,&lt;br /&gt;
and further assume that &amp;lt;math&amp;gt;\epsilon \le \delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Suppose that at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, the highest numbered round entered&lt;br /&gt;
by any honest replica is &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Let &amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; be the rank of the lowest ranked &lt;br /&gt;
honest replica &amp;lt;math&amp;gt;P^*&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Finally, suppose that the network is &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;-synchronous&lt;br /&gt;
at all times in the interval &amp;lt;math&amp;gt;[t,t+(3r^*+2)\delta]&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then all honest replicas will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; before time&lt;br /&gt;
&amp;lt;math&amp;gt;t+3(r^*+1)\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Locally adjusted delay functions===&lt;br /&gt;
 &lt;br /&gt;
When a replica does not see any finalized blocks for several rounds, it will &lt;br /&gt;
start increasing its own delay function &amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
for notarization.&lt;br /&gt;
Replicas need not agree on these locally adjusted notarization delay functions.&lt;br /&gt;
&lt;br /&gt;
Also, while replicas do not explicitly adjust the delay function &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;, we can mathematically model local clock drift &lt;br /&gt;
by locally adjusting both delay functions.&lt;br /&gt;
&lt;br /&gt;
Thus, there are many delay fucntions,&lt;br /&gt;
parameterized by replica and round.&lt;br /&gt;
The critical condition &amp;lt;math&amp;gt;\Delta_\mathrm{n}(1) \ge \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt; needed for liveness then becomes&lt;br /&gt;
&amp;lt;math&amp;gt;\max \Delta_\mathrm{n}(1) \ge \min \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt;,&lt;br /&gt;
where the &amp;lt;math&amp;gt;\max&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\min&amp;lt;/math&amp;gt; are taken over all the honest replicas in a given round.&lt;br /&gt;
Thus, if finalization fails for enough rounds, all honest replicas&lt;br /&gt;
will eventually increase their notarization delay until this holds and finalization&lt;br /&gt;
will then resume.&lt;br /&gt;
If some honest replicas increase their notarization latency function&lt;br /&gt;
more than other replicas, there no penalty in terms of liveness&lt;br /&gt;
(but there may be in terms of growth latency).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fairness===&lt;br /&gt;
&lt;br /&gt;
Another property that is important in consensus protocols is &amp;lt;b&amp;gt;fairness&amp;lt;/b&amp;gt;.&lt;br /&gt;
Rather than give a general definition, we simply observe that &lt;br /&gt;
the liveness invariant also implies a useful fairness property.&lt;br /&gt;
Recall that the liveness invariant basically says that in any round&lt;br /&gt;
where the leader is honest and the network is synchronous, &lt;br /&gt;
then the block proposed by the leader will be finalized.&lt;br /&gt;
In those rounds where this happens, the fact that the leader is&lt;br /&gt;
honest ensures that it will include in the payload of its block&lt;br /&gt;
all of the transaction requests it knows about (modulo limits on&lt;br /&gt;
the payload size).&lt;br /&gt;
So, very roughly speaking, &lt;br /&gt;
any transaction request that is disseminated to enough&lt;br /&gt;
replicas will be included in a finalized block in a reasonable amount&lt;br /&gt;
of time with high probability.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=453</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=453"/>
		<updated>2021-11-11T17:29:35Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is designed to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
==Assumptions==&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically synchronous&lt;br /&gt;
for short intervals of time.&lt;br /&gt;
In such intervals of synchrony, all undelivered     &lt;br /&gt;
messages will be delivered in less than time &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;,&lt;br /&gt;
for some fixed bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a reasonable bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
==Protocol overview==&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; &lt;br /&gt;
[[#Random Beacon|(see below)]].&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is synchronous,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not synchronous,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
Even if the protocol proceeds for a few rounds without extending the&lt;br /&gt;
finalized path, the height of the tree will continue to grow&lt;br /&gt;
with each round, so that when the finalized path is extended in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the finalized path will be of length &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
A consequence of this,&lt;br /&gt;
even if the &amp;lt;i&amp;gt;latency&amp;lt;/i&amp;gt; occasionally&lt;br /&gt;
occasionally increases because of faulty replicas or unexpectedly &lt;br /&gt;
high network latency,&lt;br /&gt;
the &amp;lt;i&amp;gt;throughput&amp;lt;/i&amp;gt; of the protocol&lt;br /&gt;
remains essentially constant. &lt;br /&gt;
&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol may proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
==Public keys==&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages&lt;br /&gt;
sent by replicas.&lt;br /&gt;
&lt;br /&gt;
The protocol also uses the &lt;br /&gt;
&amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
The protocol will use these multi-signatures&lt;br /&gt;
for [[#Notarization|notarizations]] and [[#Finalization|finalization]],&lt;br /&gt;
which are aggregations of &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; signatures on messages&lt;br /&gt;
of a certain form.&lt;br /&gt;
&lt;br /&gt;
==Random Beacon==&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Block making==&lt;br /&gt;
&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
==Notarization==&lt;br /&gt;
&lt;br /&gt;
A block is effectively added to the tree of blocks when it becomes &lt;br /&gt;
&amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, &lt;br /&gt;
&amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must &amp;lt;b&amp;gt;support&amp;lt;/b&amp;gt; its notarization.&lt;br /&gt;
&lt;br /&gt;
Given a proposed block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
a replica will determine if the proposal is &amp;lt;b&amp;gt;valid&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; has the syntactic form described above.&lt;br /&gt;
In particular, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; should contain the hash of &lt;br /&gt;
a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt; that is already&lt;br /&gt;
in the tree of blocks (i.e., already notarized).&lt;br /&gt;
In addition, the payload of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; must satisfy certain&lt;br /&gt;
conditions (in particulat, all of the transaction requests in the payload&lt;br /&gt;
must satisfy various constraints, but these constraints are unrelated&lt;br /&gt;
to consensus).&lt;br /&gt;
Also, the rank of the block maker (as recorded in the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;) &lt;br /&gt;
must match&lt;br /&gt;
the rank assigned in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; by the random beacon&lt;br /&gt;
to the replica that proposed the block (as recorded in the block proposal) .&lt;br /&gt;
&lt;br /&gt;
If the block is valid and certain other constraints hold,&lt;br /&gt;
the replica will &amp;lt;b&amp;gt;support&amp;lt;/b&amp;gt; the notarization of the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity of the supporting replica, and&lt;br /&gt;
* the supporting replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &lt;br /&gt;
&amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the set of identities of the &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; supporting replicas,&lt;br /&gt;
* an aggregation of the &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; signatures on the message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As soon as a replica obtains a notarized block of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
it will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and will subsequently not support the notarization of&lt;br /&gt;
any other blocks at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At this point in time, such a replica will also relay this &lt;br /&gt;
notarization to all other replicas.&lt;br /&gt;
Note that this replica may have obtained the notarization either by&lt;br /&gt;
(1) receiving it from another replica, or (2) aggregating &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt;&lt;br /&gt;
notarization shares that it has received.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;growth invariant&amp;lt;/b&amp;gt; states that each honest replica will &lt;br /&gt;
eventually complete each round, so that the tree of notarized blocks&lt;br /&gt;
continues to grow (and this holds only assuming asynchronous eventual delivery,&lt;br /&gt;
and not partial synchrony).&lt;br /&gt;
We prove the growth invariant  &lt;br /&gt;
[[#Proof of growth invariant|below]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finalization==&lt;br /&gt;
&lt;br /&gt;
There may be more than one &lt;br /&gt;
notarized block at a given height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
However, if a block is &amp;lt;b&amp;gt;finalized&amp;lt;/b&amp;gt;, then we can be sure that there&lt;br /&gt;
is no other notarized block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;safety invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a block to become finalized, &lt;br /&gt;
&amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its finalization.&lt;br /&gt;
Recall that round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; ends for a replica when &lt;br /&gt;
it obtains a notarized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At that point in time, such a replica will &lt;br /&gt;
check if it supported the notarization of any block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;i&amp;gt;other&amp;lt;/i&amp;gt; than block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; (it may or may not have &lt;br /&gt;
supported the notarization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; itself).&lt;br /&gt;
If not, the replica will support the finalization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
by broadcasting a &lt;br /&gt;
&amp;lt;b&amp;gt;finalization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A finalization share has exactly the same format as a notarization share&lt;br /&gt;
(but is tagged in such a way notarization shares&lt;br /&gt;
and finalization shares cannot be confused with one another).&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; finalization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;finalization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
which has exactly the same format as a notarization&lt;br /&gt;
(but again, is appropriately tagged).&lt;br /&gt;
Any replica that obtains a finalized block will broadcast the finalization &lt;br /&gt;
to all other replicas.&lt;br /&gt;
&lt;br /&gt;
We prove the safety invariant  &lt;br /&gt;
[[#Proof of safety invariant|below]].&lt;br /&gt;
One consequence of the safety invariant is the following.&lt;br /&gt;
Suppose two blocks &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; are finalized,&lt;br /&gt;
where &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; has height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; has height&lt;br /&gt;
&amp;lt;math&amp;gt;h&#039;\le h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the safety invariant implies that the path &lt;br /&gt;
in the tree of notarized blocks&lt;br /&gt;
ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; is a prefix of the path ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
(if not, then there would be two notarized blocks at height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt;,&lt;br /&gt;
contradicting the finalization invariant).   &lt;br /&gt;
Thus, whenever a replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
it may view all ancestors of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; as being &lt;br /&gt;
&amp;lt;b&amp;gt;implicitly finalized&amp;lt;/b&amp;gt;, and because of the&lt;br /&gt;
safety invariant, the &amp;lt;b&amp;gt;safety property&amp;lt;/b&amp;gt; is&lt;br /&gt;
guaranteed to hold for these (explicitly and implicitly) finalized blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Delay functions==&lt;br /&gt;
&lt;br /&gt;
The protocol makes use of two &amp;lt;b&amp;gt;delay functions&amp;lt;/b&amp;gt;, &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;,&lt;br /&gt;
which control&lt;br /&gt;
the timing of block making and notarization activity.&lt;br /&gt;
Both of these functions map the rank &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; of the proposing replica&lt;br /&gt;
no a nonnegative delay amount,&lt;br /&gt;
and it is assumed that each function is monotonely increasing in &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;,&lt;br /&gt;
and that &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}(r) \le \Delta_\textrm{n}(r)&amp;lt;/math&amp;gt;&lt;br /&gt;
for all &amp;lt;math&amp;gt;r = 0, \ldots, n-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
The recommended definition of these functions is&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}(r) = 2 \delta r&amp;lt;/math&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}(r) = 2 \delta r + \epsilon&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; is an upper bound on the time to deliver&lt;br /&gt;
messages from one honest replica to another,&lt;br /&gt;
and &amp;lt;math&amp;gt;\epsilon \ge 0&amp;lt;/math&amp;gt; is a &amp;quot;governor&amp;quot; to keep the&lt;br /&gt;
protocol from running too fast.&lt;br /&gt;
With these definitions, liveness will be ensured in those&lt;br /&gt;
rounds in which (1) the leader is honest, and (2) messages really&lt;br /&gt;
are delivered between honest parties within time &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Indeed,&lt;br /&gt;
if (1) and (2) both hold in a given round, then the block proposed&lt;br /&gt;
by the leader in that round will be finalized.&lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;liveness invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
We prove this &lt;br /&gt;
[[#Proof of liveness invariant|below]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Putting it all together==&lt;br /&gt;
&lt;br /&gt;
We now describe in more detail how the protocol works;&lt;br /&gt;
specifically, we describe more precisely when a replica will&lt;br /&gt;
propose a block and when a replica will support the notarization of a block. &lt;br /&gt;
A given replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will record the time at which it &lt;br /&gt;
enters a given round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
which happens when it has obtained (1) some notarization for a &lt;br /&gt;
block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;, and (2) the random beacon for&lt;br /&gt;
round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Since the random beacon for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; has been determined,&lt;br /&gt;
&amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; can determine its own rank &amp;lt;math&amp;gt;r_P&amp;lt;/math&amp;gt;, as well as the &lt;br /&gt;
rank &amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt; of each other replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; &lt;br /&gt;
for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Random beacon details===&lt;br /&gt;
&lt;br /&gt;
As soon as a replica enters round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, it will generate and broadcast &lt;br /&gt;
its share of the random beacon at round &amp;lt;math&amp;gt;h+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Block making details===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will only propose its own block &amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;&lt;br /&gt;
provided (1) at least &amp;lt;math&amp;gt;\Delta_\textrm{m}(r_P)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no valid lower ranked block currently seen by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that since &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; is guaranteed to have a notarized block&lt;br /&gt;
of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
when it enters round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, it can make its proposed&lt;br /&gt;
block a child of this notarized block (or any other &lt;br /&gt;
notarized block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; that it may have).&lt;br /&gt;
Also note that when &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; broadcasts its proposal for &amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;,&lt;br /&gt;
it must also ensure that it also has relayed the notarization of &lt;br /&gt;
&amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;&#039;s parent to all replicas.&lt;br /&gt;
&lt;br /&gt;
Suppose a replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; sees&lt;br /&gt;
a valid block proposal from a replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;&lt;br /&gt;
of rank&lt;br /&gt;
&amp;lt;math&amp;gt;r_P &amp;lt; r_Q&amp;lt;/math&amp;gt;&lt;br /&gt;
such that&lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{m}(r_P)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no block of rank less than &amp;lt;math&amp;gt;r_P&amp;lt;/math&amp;gt; &lt;br /&gt;
currently seen by &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then at this point in time, if it has not already done so,&lt;br /&gt;
&amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; will relay this block proposal&lt;br /&gt;
(along with the notarization of the proposed block&#039;s parent) &lt;br /&gt;
to all other replicas. &lt;br /&gt;
&lt;br /&gt;
===Notarization details===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will support the notarization &lt;br /&gt;
of a valid block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; proposed by a &lt;br /&gt;
replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; of rank &lt;br /&gt;
&amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt;&lt;br /&gt;
provided &lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{n}(r_Q)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and&lt;br /&gt;
(2) there is no block of rank less than &amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt; &lt;br /&gt;
currently seen by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Proof of growth invariant===&lt;br /&gt;
&lt;br /&gt;
The growth invariant states that&lt;br /&gt;
each honest replica will &lt;br /&gt;
eventually complete each round.&lt;br /&gt;
Assume that all honest replicas have started round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Let &amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; be the rank of the lowest ranked &lt;br /&gt;
honest replica &amp;lt;math&amp;gt;P^*&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Eventually, &amp;lt;math&amp;gt;P^*&amp;lt;/math&amp;gt; will either (1) propose its own block,&lt;br /&gt;
or (2) relay a valid block proposed by a lower ranked replica. &lt;br /&gt;
In either case, some block must eventually be supported by all honest replicas,&lt;br /&gt;
which means that some block will become notarized and all honest replicas&lt;br /&gt;
will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Proof of safety invariant===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;safety invariant&amp;lt;/b&amp;gt; states that if a block is finalized in a given round,&lt;br /&gt;
then no other block may be notarized in that round.&lt;br /&gt;
Here is a proof of the safety invariant:&lt;br /&gt;
# Suppose that the number of corrupt parties is exactly &amp;lt;math&amp;gt;f^* \le f &amp;lt; n/3&amp;lt;/math&amp;gt;.&lt;br /&gt;
# If a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is finalized, then its finalization must have been supported by a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (by the security property for aggregate signatures). &lt;br /&gt;
# Suppose (by way of contradction) that another block &amp;lt;math&amp;gt;B&#039; \ne B&amp;lt;/math&amp;gt; were notarized. Then its notarization must have been supported by a set &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (again, by the security property for aggregate signatures).&lt;br /&gt;
# The sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; are disjoint (by the finalization logic).&lt;br /&gt;
# Therefore, &amp;lt;math&amp;gt;n-f^* \ge |S \cup S&#039;| = |S| + |S&#039;| \ge 2 (n-f-f^*)&amp;lt;/math&amp;gt;, which implies &amp;lt;math&amp;gt;n \le 3f&amp;lt;/math&amp;gt;, a contradiction.&lt;br /&gt;
&lt;br /&gt;
===Proof of liveness invariant===&lt;br /&gt;
&lt;br /&gt;
We say that the network is &lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;-synchronous at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;&amp;lt;/b&amp;gt; if &lt;br /&gt;
if all messages that have been sent by honest replicas at or before time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; arrive at their destinations before time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;liveness invariant&amp;lt;/b&amp;gt; may be stated as follows.&lt;br /&gt;
Suppose that &amp;lt;math&amp;gt;\Delta_\mathrm{n}(1) \ge \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Also &lt;br /&gt;
suppose that in a given round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, we have &lt;br /&gt;
* the leader &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is honest,&lt;br /&gt;
* the first honest replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; to finish round &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; does so at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the network is &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;-synchronous at times &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t+\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the block proposed by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; will be finalized.&lt;br /&gt;
&lt;br /&gt;
Here is a proof of the liveness invariant:&lt;br /&gt;
# Under partial synchrony at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, all honest replicas will enter round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; before time &amp;lt;math&amp;gt;t+\delta&amp;lt;/math&amp;gt; (the notarization that ended round &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, as well as the necessary round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon shares, will arrive at all honest replicas before this time).&lt;br /&gt;
# The leader &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; will propose a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; before time &amp;lt;math&amp;gt;t+\delta&amp;lt;/math&amp;gt;, and again by partial synchrony, this block proposal will be delivered to all other replicas before time &amp;lt;math&amp;gt;t+2\delta&amp;lt;/math&amp;gt;. &lt;br /&gt;
# Since &amp;lt;math&amp;gt;\Delta_\mathrm{n}(1) \ge \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt;, the protocol logic guarantees that each honest replica supports the notarization of block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and no other block, and thus &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; will become notarized and finalized.  &lt;br /&gt;
&lt;br /&gt;
==Other issues==&lt;br /&gt;
&lt;br /&gt;
===Growth latency===&lt;br /&gt;
&lt;br /&gt;
Under a partial synchrony assumption, we can also formulate and prove&lt;br /&gt;
a quantitative version of the growth invariant.&lt;br /&gt;
For simplicity, assume that the delay functions are defined&lt;br /&gt;
as recommended above: &amp;lt;math&amp;gt;\Delta_\textrm{m}(r) = 2 \delta r&amp;lt;/math&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}(r) = 2 \delta r + \epsilon&amp;lt;/math&amp;gt;,&lt;br /&gt;
and further assume that &amp;lt;math&amp;gt;\epsilon \le \delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Suppose that at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, the highest numbered round entered&lt;br /&gt;
by any honest replica is &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Let &amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; be the rank of the lowest ranked &lt;br /&gt;
honest replica &amp;lt;math&amp;gt;P^*&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Finally, suppose that the network is &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;-synchronous&lt;br /&gt;
at all times in the interval &amp;lt;math&amp;gt;[t,t+(3r^*+2)\delta]&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then all honest replicas will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; before time&lt;br /&gt;
&amp;lt;math&amp;gt;t+3(r^*+1)\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Locally adjusted delay functions===&lt;br /&gt;
 &lt;br /&gt;
When a replica does not see any finalized blocks for several rounds, it will &lt;br /&gt;
start increasing its own delay function &amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
for notarization.&lt;br /&gt;
Replicas need not agree on these locally adjusted notarization delay functions.&lt;br /&gt;
&lt;br /&gt;
Also, while replicas do not explicitly adjust the delay function &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;, we can mathematically model local clock drift &lt;br /&gt;
by locally adjusting both delay functions.&lt;br /&gt;
&lt;br /&gt;
Thus, there are many delay fucntions,&lt;br /&gt;
parameterized by replica and round.&lt;br /&gt;
The critical condition &amp;lt;math&amp;gt;\Delta_\mathrm{n}(1) \ge \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt; needed for liveness then becomes&lt;br /&gt;
&amp;lt;math&amp;gt;\max \Delta_\mathrm{n}(1) \ge \min \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt;,&lt;br /&gt;
where the &amp;lt;math&amp;gt;\max&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\min&amp;lt;/math&amp;gt; are taken over all the honest replicas in a given round.&lt;br /&gt;
Thus, if finalization fails for enough rounds, all honest replicas&lt;br /&gt;
will eventually increase their notarization delay until this holds and finalization&lt;br /&gt;
will then resume.&lt;br /&gt;
If some honest replicas increase their notarization latency function&lt;br /&gt;
more than other replicas, there no penalty in terms of liveness&lt;br /&gt;
(but there may be in terms of growth latency).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fairness===&lt;br /&gt;
&lt;br /&gt;
Another property that is important in consensus protocols is &amp;lt;b&amp;gt;fairness&amp;lt;/b&amp;gt;.&lt;br /&gt;
Rather than give a general definition, we simply observe that &lt;br /&gt;
the liveness invariant also implies a useful fairness property.&lt;br /&gt;
Recall that the liveness invariant basically says that in any round&lt;br /&gt;
where the leader is honest and the network is synchronous, &lt;br /&gt;
then the block proposed by the leader will be finalized.&lt;br /&gt;
In those rounds where this happens, the fact that the leader is&lt;br /&gt;
honest ensures that it will include in the payload of its block&lt;br /&gt;
all of the transaction requests it knows about (modulo limits on&lt;br /&gt;
the payload size).&lt;br /&gt;
So, very roughly speaking, &lt;br /&gt;
any transaction request that is disseminated to enough&lt;br /&gt;
replicas will be included in a finalized block in a reasonable amount&lt;br /&gt;
of time with high probability.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=438</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=438"/>
		<updated>2021-11-11T17:01:34Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is designed to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
==Assumptions==&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically synchronous&lt;br /&gt;
for short intervals of time.&lt;br /&gt;
In such intervals of synchrony, all undelivered     &lt;br /&gt;
messages will be delivered in less than time &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;,&lt;br /&gt;
for some fixed bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a reasonable bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
==Protocol overview==&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; &lt;br /&gt;
[[#Random Beacon|(see below)]].&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is synchronous,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not synchronous,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
Even if the protocol proceeds for a few rounds without extending the&lt;br /&gt;
finalized path, the height of the tree will continue to grow&lt;br /&gt;
with each round, so that when the finalized path is extended in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the finalized path will be of length &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
A consequence of this,&lt;br /&gt;
even if the &amp;lt;i&amp;gt;latency&amp;lt;/i&amp;gt; occasionally&lt;br /&gt;
occasionally increases because of faulty replicas or unexpectedly &lt;br /&gt;
high network latency,&lt;br /&gt;
the &amp;lt;i&amp;gt;throughput&amp;lt;/i&amp;gt; of the protocol&lt;br /&gt;
remains essentially constant. &lt;br /&gt;
&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol may proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
==Public keys==&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages&lt;br /&gt;
sent by replicas.&lt;br /&gt;
&lt;br /&gt;
The protocol also uses the &lt;br /&gt;
&amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
The protocol will use these multi-signatures&lt;br /&gt;
for [[#Notarization|notarizations]] and [[#Finalization|finalization]],&lt;br /&gt;
which are aggregations of &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; signatures on messages&lt;br /&gt;
of a certain form.&lt;br /&gt;
&lt;br /&gt;
==Random Beacon==&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Block making==&lt;br /&gt;
&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
==Notarization==&lt;br /&gt;
&lt;br /&gt;
A block is effectively added to the tree of blocks when it becomes &lt;br /&gt;
&amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, &lt;br /&gt;
&amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must &amp;lt;b&amp;gt;support&amp;lt;/b&amp;gt; its notarization.&lt;br /&gt;
&lt;br /&gt;
Given a proposed block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
a replica will determine if the proposal is &amp;lt;b&amp;gt;valid&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; has the syntactic form described above.&lt;br /&gt;
In particular, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; should contain the hash of &lt;br /&gt;
a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt; that is already&lt;br /&gt;
in the tree of blocks (i.e., already notarized).&lt;br /&gt;
In addition, the payload of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; must satisfy certain&lt;br /&gt;
conditions (in particulat, all of the transaction requests in the payload&lt;br /&gt;
must satisfy various constraints, but these constraints are unrelated&lt;br /&gt;
to consensus).&lt;br /&gt;
Also, the rank of the block maker (as recorded in the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;) &lt;br /&gt;
must match&lt;br /&gt;
the rank assigned in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; by the random beacon&lt;br /&gt;
to the replica that proposed the block (as recorded in the block proposal) .&lt;br /&gt;
&lt;br /&gt;
If the block is valid and certain other constraints hold,&lt;br /&gt;
the replica will &amp;lt;b&amp;gt;support&amp;lt;/b&amp;gt; the notarization of the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity of the supporting replica, and&lt;br /&gt;
* the supporting replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &lt;br /&gt;
&amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the set of identities of the &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; supporting replicas,&lt;br /&gt;
* an aggregation of the &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; signatures on the message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As soon as a replica obtains a notarized block of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
it will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and will subsequently not support the notarization of&lt;br /&gt;
any other blocks at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At this point in time, such a replica will also relay this &lt;br /&gt;
notarization to all other replicas.&lt;br /&gt;
Note that this replica may have obtained the notarization either by&lt;br /&gt;
(1) receiving it from another replica, or (2) aggregating &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt;&lt;br /&gt;
notarization shares that it has received.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;growth invariant&amp;lt;/b&amp;gt; states that each honest replica will &lt;br /&gt;
eventually complete each round, so that the tree of notarized blocks&lt;br /&gt;
continues to grow (and this holds only assuming asynchronous eventual delivery,&lt;br /&gt;
and not partial synchrony).&lt;br /&gt;
We prove the growth invariant  &lt;br /&gt;
[[#Proof of growth invariant|below]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finalization==&lt;br /&gt;
&lt;br /&gt;
There may be more than one &lt;br /&gt;
notarized block at a given height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
However, if a block is &amp;lt;b&amp;gt;finalized&amp;lt;/b&amp;gt;, then we can be sure that there&lt;br /&gt;
is no other notarized block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;safety invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a block to become finalized, &lt;br /&gt;
&amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its finalization.&lt;br /&gt;
Recall that round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; ends for a replica when &lt;br /&gt;
it obtains a notarized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At that point in time, such a replica will &lt;br /&gt;
check if it supported the notarization of any block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;i&amp;gt;other&amp;lt;/i&amp;gt; than block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; (it may or may not have &lt;br /&gt;
supported the notarization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; itself).&lt;br /&gt;
If not, the replica will support the finalization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
by broadcasting a &lt;br /&gt;
&amp;lt;b&amp;gt;finalization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A finalization share has exactly the same format as a notarization share&lt;br /&gt;
(but is tagged in such a way notarization shares&lt;br /&gt;
and finalization shares cannot be confused with one another).&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;n-f&amp;lt;/math&amp;gt; finalization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;finalization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
which has exactly the same format as a notarization&lt;br /&gt;
(but again, is appropriately tagged).&lt;br /&gt;
Any replica that obtains a finalized block will broadcast the finalization &lt;br /&gt;
to all other replicas.&lt;br /&gt;
&lt;br /&gt;
We prove the safety invariant  &lt;br /&gt;
[[#Proof of safety invariant|below]].&lt;br /&gt;
One consequence of the safety invariant is the following.&lt;br /&gt;
Suppose two blocks &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; are finalized,&lt;br /&gt;
where &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; has height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; has height&lt;br /&gt;
&amp;lt;math&amp;gt;h&#039;\le h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the safety invariant implies that the path &lt;br /&gt;
in the tree of notarized blocks&lt;br /&gt;
ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; is a prefix of the path ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
(if not, then there would be two notarized blocks at height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt;,&lt;br /&gt;
contradicting the finalization invariant).   &lt;br /&gt;
Thus, whenever a replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
it may view all ancestors of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; as being &lt;br /&gt;
&amp;lt;b&amp;gt;implicitly finalized&amp;lt;/b&amp;gt;, and because of the&lt;br /&gt;
safety invariant, the &amp;lt;b&amp;gt;safety property&amp;lt;/b&amp;gt; is&lt;br /&gt;
guaranteed to hold for these (explicitly and implicitly) finalized blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Delay functions==&lt;br /&gt;
&lt;br /&gt;
The protocol makes use of two &amp;lt;b&amp;gt;delay functions&amp;lt;/b&amp;gt;, &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;,&lt;br /&gt;
which control&lt;br /&gt;
the timing of block making and notarization activity.&lt;br /&gt;
Both of these functions map the rank &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; of the proposing replica&lt;br /&gt;
no a nonnegative delay amount,&lt;br /&gt;
and it is assumed that each function is monotonely increasing in &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;,&lt;br /&gt;
and that &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}(r) \le \Delta_\textrm{n}(r)&amp;lt;/math&amp;gt;&lt;br /&gt;
for all &amp;lt;math&amp;gt;r = 0, \ldots, n-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
The recommended definition of these functions is&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}(r) = 2 \delta r&amp;lt;/math&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}(r) = 2 \delta r + \epsilon&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; is an upper bound on the time to deliver&lt;br /&gt;
messages from one honest replica to another,&lt;br /&gt;
and &amp;lt;math&amp;gt;\epsilon \ge 0&amp;lt;/math&amp;gt; is a &amp;quot;governor&amp;quot; to keep the&lt;br /&gt;
protocol from running too fast.&lt;br /&gt;
With these definitions, liveness will be ensured in those&lt;br /&gt;
rounds in which (1) the leader is honest, and (2) messages really&lt;br /&gt;
are delivered between honest parties within time &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Indeed,&lt;br /&gt;
if (1) and (2) both hold in a given round, then the block proposed&lt;br /&gt;
by the leader in that round will be finalized.&lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;liveness invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
We prove this &lt;br /&gt;
[[#Proof of liveness invariant|below]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Putting it all together==&lt;br /&gt;
&lt;br /&gt;
We now describe in more detail how the protocol works;&lt;br /&gt;
specifically, we describe more precisely when a replica will&lt;br /&gt;
propose a block and when a replica will support the notarization of a block. &lt;br /&gt;
A given replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will record the time at which it &lt;br /&gt;
enters a given round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
which happens when it has obtained (1) some notarization for a &lt;br /&gt;
block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;, and (2) the random beacon for&lt;br /&gt;
round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Since the random beacon for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; has been determined,&lt;br /&gt;
&amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; can determine its own rank &amp;lt;math&amp;gt;r_P&amp;lt;/math&amp;gt;, as well as the &lt;br /&gt;
rank &amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt; of each other replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; &lt;br /&gt;
for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Random beacon details===&lt;br /&gt;
&lt;br /&gt;
As soon as a replica enters round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, it will generate and broadcast &lt;br /&gt;
its share of the random beacon at round &amp;lt;math&amp;gt;h+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Block making details===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will only propose its own block &amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;&lt;br /&gt;
provided (1) at least &amp;lt;math&amp;gt;\Delta_\textrm{m}(r_P)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no valid lower ranked block currently seen by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that since &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; is guaranteed to have a notarized block&lt;br /&gt;
of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
when it enters round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, it can make its proposed&lt;br /&gt;
block a child of this notarized block (or any other &lt;br /&gt;
notarized block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; that it may have).&lt;br /&gt;
Also note that when &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; broadcasts its proposal for &amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;,&lt;br /&gt;
it must also ensure that it also has relayed the notarization of &lt;br /&gt;
&amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;&#039;s parent to all replicas.&lt;br /&gt;
&lt;br /&gt;
Suppose a replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; sees&lt;br /&gt;
a valid block proposal from a replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;&lt;br /&gt;
of rank&lt;br /&gt;
&amp;lt;math&amp;gt;r_P &amp;lt; r_Q&amp;lt;/math&amp;gt;&lt;br /&gt;
such that&lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{m}(r_P)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no block of rank less than &amp;lt;math&amp;gt;r_P&amp;lt;/math&amp;gt; &lt;br /&gt;
currently seen by &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then at this point in time, if it has not already done so,&lt;br /&gt;
&amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; will relay this block proposal&lt;br /&gt;
(along with the notarization of the proposed block&#039;s parent) &lt;br /&gt;
to all other replicas. &lt;br /&gt;
&lt;br /&gt;
===Notarization details===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will support the notarization &lt;br /&gt;
of a valid block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; proposed by a &lt;br /&gt;
replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; of rank &lt;br /&gt;
&amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt;&lt;br /&gt;
provided &lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{n}(r_Q)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and&lt;br /&gt;
(2) there is no block of rank less than &amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt; &lt;br /&gt;
currently seen by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Proof of growth invariant===&lt;br /&gt;
&lt;br /&gt;
The growth invariant states that&lt;br /&gt;
each honest replica will &lt;br /&gt;
eventually complete each round.&lt;br /&gt;
Assume that all honest replicas have started round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Let &amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; be the rank of the lowest ranked &lt;br /&gt;
honest replica &amp;lt;math&amp;gt;P^*&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Eventually, &amp;lt;math&amp;gt;P^*&amp;lt;/math&amp;gt; will either (1) propose its own block,&lt;br /&gt;
or (2) relay a valid block proposed by a lower ranked replica. &lt;br /&gt;
In either case, some block must eventually be supported by all honest replicas,&lt;br /&gt;
which means that some block will become notarized and all honest replicas&lt;br /&gt;
will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Proof of safety invariant===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;safety invariant&amp;lt;/b&amp;gt; states that if a block is finalized in a given round,&lt;br /&gt;
then no other block may be notarized in that round.&lt;br /&gt;
Here is a proof of the safety invariant:&lt;br /&gt;
# Suppose that the number of corrupt parties is exactly &amp;lt;math&amp;gt;f^* \le f &amp;lt; n/3&amp;lt;/math&amp;gt;.&lt;br /&gt;
# If a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is finalized, then its finalization must have been supported by a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (by the security property for aggregate signatures). &lt;br /&gt;
# Suppose (by way of contradction) that another block &amp;lt;math&amp;gt;B&#039; \ne B&amp;lt;/math&amp;gt; were notarized. Then its notarization must have been supported by a set &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (again, by the security property for aggregate signatures).&lt;br /&gt;
# The sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; are disjoint (by the finalization logic).&lt;br /&gt;
# Therefore, &amp;lt;math&amp;gt;n-f^* \ge |S \cup S&#039;| = |S| + |S&#039;| \ge 2 (n-f-f^*)&amp;lt;/math&amp;gt;, which implies &amp;lt;math&amp;gt;n \le 3f&amp;lt;/math&amp;gt;, a contradiction.&lt;br /&gt;
&lt;br /&gt;
===Proof of liveness invariant===&lt;br /&gt;
&lt;br /&gt;
We say that the network is &lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;-synchronous at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;&amp;lt;/b&amp;gt; if &lt;br /&gt;
if all messages that have been sent by honest replicas at or before time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; arrive at their destinations before time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;liveness invariant&amp;lt;/b&amp;gt; may be stated as follows.&lt;br /&gt;
Suppose that &amp;lt;math&amp;gt;\Delta_\mathrm{n}(1) \ge \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Also &lt;br /&gt;
suppose that in a given round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, we have &lt;br /&gt;
* the leader &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is honest,&lt;br /&gt;
* the first honest replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; to finish round &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; does so at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the network is &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;-synchronous at times &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;t+\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the block proposed by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; will be finalized.&lt;br /&gt;
&lt;br /&gt;
Here is a proof of the liveness invariant:&lt;br /&gt;
# Under partial synchrony at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, all honest replicas will enter round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; before time &amp;lt;math&amp;gt;t+\delta&amp;lt;/math&amp;gt; (the notarization that ended round &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, as well as the necessary round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon shares, will arrive at all honest replicas before this time).&lt;br /&gt;
# The leader &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; will propose a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; before time &amp;lt;math&amp;gt;t+\delta&amp;lt;/math&amp;gt;, and again by partial synchrony, this block proposal will be delivered to all other replicas before time &amp;lt;math&amp;gt;t+2\delta&amp;lt;/math&amp;gt;. &lt;br /&gt;
# Since &amp;lt;math&amp;gt;\Delta_\mathrm{n}(1) \ge \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt;, the protocol logic guarantees that each honest replica supports the notarization of block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and no other block, and thus &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; will become notarized and finalized.  &lt;br /&gt;
&lt;br /&gt;
==Other issues==&lt;br /&gt;
&lt;br /&gt;
===Growth latency===&lt;br /&gt;
&lt;br /&gt;
Under a partial synchrony assumption, we can also formulate and prove&lt;br /&gt;
a quantitative version of the growth invariant.&lt;br /&gt;
For simplicity, assume that the delay functions are defined&lt;br /&gt;
as recommended above: &amp;lt;math&amp;gt;\Delta_\textrm{m}(r) = 2 \delta r&amp;lt;/math&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}(r) = 2 \delta r + \epsilon&amp;lt;/math&amp;gt;,&lt;br /&gt;
and further assume that &amp;lt;math&amp;gt;\epsilon \le \delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Suppose that at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, the highest numbered round entered&lt;br /&gt;
by any honest replica is &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Let &amp;lt;math&amp;gt;r^*&amp;lt;/math&amp;gt; be the rank of the lowest ranked &lt;br /&gt;
honest replica &amp;lt;math&amp;gt;P^*&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Finally, suppose that the network is &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;-synchronous&lt;br /&gt;
at all times in the interval &amp;lt;math&amp;gt;[t,t+(3r^*+2)\delta]&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then all honest replicas will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; before time&lt;br /&gt;
&amp;lt;math&amp;gt;t+3(r^*+1)\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Locally adjusted delay functions===&lt;br /&gt;
 &lt;br /&gt;
When a replica does not see any finalized blocks for several rounds, it will &lt;br /&gt;
start increasing its own delay function &amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;&lt;br /&gt;
for notarization.&lt;br /&gt;
Replicas need not agree on these locally adjusted notarization delay functions.&lt;br /&gt;
&lt;br /&gt;
Also, while replicas do not explicitly adjust the delay function &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;, we can mathematically model local clock drift &lt;br /&gt;
by locally adjusting both delay functions.&lt;br /&gt;
&lt;br /&gt;
Thus, there are many delay fucntions,&lt;br /&gt;
parameterized by replica and round.&lt;br /&gt;
The critical condition &amp;lt;math&amp;gt;\Delta_\mathrm{n}(1) \ge \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt; needed for liveness then becomes&lt;br /&gt;
&amp;lt;math&amp;gt;\max \Delta_\mathrm{n}(1) \ge \min \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt;,&lt;br /&gt;
where the &amp;lt;math&amp;gt;\max&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\min&amp;lt;/math&amp;gt; are taken over all the honest replicas in a given round.&lt;br /&gt;
Thus, if finalization fails for enough rounds, all honest replicas&lt;br /&gt;
will eventually increase their notarization delay until this holds and finalization&lt;br /&gt;
will then resume.&lt;br /&gt;
If some honest replicas increase their notarization latency function&lt;br /&gt;
more than other replicas, there no penalty in terms of liveness&lt;br /&gt;
(but there may be in terms of growth latency).&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=432</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=432"/>
		<updated>2021-11-10T23:40:53Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is designed to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
==Assumptions==&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically synchronous&lt;br /&gt;
for short intervals of time.&lt;br /&gt;
In such intervals of synchrony, all undelivered     &lt;br /&gt;
messages will be delivered in less than time &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;,&lt;br /&gt;
for some fixed bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a reasonable bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
==Protocol overview==&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; &lt;br /&gt;
[[#Random Beacon|(see below)]].&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is synchronous,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not synchronous,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
Even if the protocol proceeds for a few rounds without extending the&lt;br /&gt;
finalized path, the height of the tree will continue to grow&lt;br /&gt;
with each round, so that when the finalized path is extended in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the finalized path will be of length &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
A consequence of this,&lt;br /&gt;
even if the &amp;lt;i&amp;gt;latency&amp;lt;/i&amp;gt; occasionally&lt;br /&gt;
occasionally increases because of faulty replicas or unexpectedly &lt;br /&gt;
high network latency,&lt;br /&gt;
the &amp;lt;i&amp;gt;throughput&amp;lt;/i&amp;gt; of the protocol&lt;br /&gt;
remains essentially constant. &lt;br /&gt;
&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol may proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
==Public keys==&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &lt;br /&gt;
&amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
&lt;br /&gt;
==Random Beacon==&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Block making==&lt;br /&gt;
&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
==Notarization==&lt;br /&gt;
&lt;br /&gt;
A block is effectively added to the tree of blocks when it becomes &lt;br /&gt;
&amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, &lt;br /&gt;
&amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must &amp;lt;b&amp;gt;support&amp;lt;/b&amp;gt; its notarization.&lt;br /&gt;
&lt;br /&gt;
Given a proposed block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
a replica will determine if the proposal is &amp;lt;b&amp;gt;valid&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; has the syntactic form described above.&lt;br /&gt;
In particular, &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; should contain the hash of &lt;br /&gt;
a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt; that is already&lt;br /&gt;
in the tree of blocks (i.e., already notarized).&lt;br /&gt;
In addition, the payload of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; must satisfy certain&lt;br /&gt;
conditions (in particulat, all of the transaction requests in the payload&lt;br /&gt;
must satisfy various constraints, but these constraints are unrelated&lt;br /&gt;
to consensus).&lt;br /&gt;
Also, the rank of the block maker (as recorded in the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;) &lt;br /&gt;
must match&lt;br /&gt;
the rank assigned in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; by the random beacon&lt;br /&gt;
to the replica that proposed the block (as recorded in the block proposal) .&lt;br /&gt;
&lt;br /&gt;
If the block is valid and certain other constraints hold,&lt;br /&gt;
the replica will &amp;lt;b&amp;gt;support&amp;lt;/b&amp;gt; the notarization of the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity of the supporting replica, and&lt;br /&gt;
* the supporting replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &lt;br /&gt;
&amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the set of identities of the &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; supporting replicas,&lt;br /&gt;
* an aggregation of the &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; signatures on the message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Each replica will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
as soon as it obtains a notarized block of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and will not subsequently support the notarization of&lt;br /&gt;
any other blocks at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At this point in time, such a replica will also broadcast this &lt;br /&gt;
notarization to all other replicas.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Finalization==&lt;br /&gt;
&lt;br /&gt;
There may be more than one &lt;br /&gt;
notarized block at a given height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
However, if a block is &amp;lt;b&amp;gt;finalized&amp;lt;/b&amp;gt;, then we can be sure that there&lt;br /&gt;
is no other notarized block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;safety invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a block to become finalized, &lt;br /&gt;
&amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its finalization.&lt;br /&gt;
Recall that round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; ends for a replica when &lt;br /&gt;
it obtains a notarized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At that point in time, such a replica will &lt;br /&gt;
check if it supported the notarization of any block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;i&amp;gt;other&amp;lt;/i&amp;gt; than block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; (it may or may not have &lt;br /&gt;
supported the notarization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; itself).&lt;br /&gt;
If not, the replica will support the finalization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
by broadcasting a &lt;br /&gt;
&amp;lt;b&amp;gt;finalization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A finalization share has exactly the same format as a notarization share&lt;br /&gt;
(but is tagged in such a way notarization shares&lt;br /&gt;
and finalization shares cannot be confused with one another).&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; finalization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;finalization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
which has exactly the same format as a notarization&lt;br /&gt;
(but again, is appropriately tagged).&lt;br /&gt;
Any replica that obtains a finalized block will broadcast the finalization &lt;br /&gt;
to all other replicas.&lt;br /&gt;
&lt;br /&gt;
We prove the safety invariant  &lt;br /&gt;
[[#Proof of safety invariant|below]].&lt;br /&gt;
One consequence of the safety invariant is the following.&lt;br /&gt;
Suppose two blocks &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; are finalized,&lt;br /&gt;
where &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; has height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; has height&lt;br /&gt;
&amp;lt;math&amp;gt;h&#039;\le h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the safety invariant implies that the path &lt;br /&gt;
in the tree of notarized blocks&lt;br /&gt;
ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; is a prefix of the path ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
(if not, then there would be two notarized blocks at height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt;,&lt;br /&gt;
contradicting the finalization invariant).   &lt;br /&gt;
Thus, whenever a replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
it may view all ancestors of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; as being &lt;br /&gt;
&amp;lt;b&amp;gt;implicitly finalized&amp;lt;/b&amp;gt;, and because of the&lt;br /&gt;
safety invariant, the &amp;lt;b&amp;gt;safety property&amp;lt;/b&amp;gt; is&lt;br /&gt;
guaranteed to hold for these (explicitly and implicitly) finalized blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Delay functions==&lt;br /&gt;
&lt;br /&gt;
The protocol makes use of two &amp;lt;b&amp;gt;delay functions&amp;lt;/b&amp;gt;, &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;,&lt;br /&gt;
which control&lt;br /&gt;
the timing of block making and notarization activity.&lt;br /&gt;
Both of these functions map the rank &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; of the proposing replica&lt;br /&gt;
no a nonnegative delay amount,&lt;br /&gt;
and it is assumed that each function is monotonely increasing in &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;,&lt;br /&gt;
and that &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}(r) \le \Delta_\textrm{n}(r)&amp;lt;/math&amp;gt;&lt;br /&gt;
for all &amp;lt;math&amp;gt;r = 0, \ldots, n-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
The recommended definition of these functions is&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{m}(r) = 2 \delta r&amp;lt;/math&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}(r) = 2 \delta r + \epsilon&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; is an upper bound on the time to deliver&lt;br /&gt;
messages from one honest replica to another,&lt;br /&gt;
and &amp;lt;math&amp;gt;\epsilon \ge 0&amp;lt;/math&amp;gt; is a &amp;quot;governor&amp;quot; to keep the&lt;br /&gt;
protocol from running too fast.&lt;br /&gt;
With these definitions, liveness will be ensured in those&lt;br /&gt;
rounds in which (1) the leader is honest, and (2) messages really&lt;br /&gt;
are delivered between honest parties within time &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Indeed,&lt;br /&gt;
if (1) and (2) both hold in a given round, then the block proposed&lt;br /&gt;
by the leader in that round will be finalized.&lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;liveness invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
We prove this &lt;br /&gt;
[[#Proof of liveness invariant|below]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Putting it all together==&lt;br /&gt;
&lt;br /&gt;
We now describe in more detail how the protocol works;&lt;br /&gt;
specifically, we describe more precisely when a replica will&lt;br /&gt;
propose a block and when a replica will support the notarization of a block. &lt;br /&gt;
A given replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will record the time at which it &lt;br /&gt;
enters a given round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
which happens when it has obtained (1) some notarization for a &lt;br /&gt;
block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;, and (2) the random beacon for&lt;br /&gt;
round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Since the random beacon for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; has been determined,&lt;br /&gt;
&amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; can determine its own rank &amp;lt;math&amp;gt;r_P&amp;lt;/math&amp;gt;, as well as the &lt;br /&gt;
rank &amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt; of each other replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; &lt;br /&gt;
for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Block making===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will only propose its own block &amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;&lt;br /&gt;
provided (1) at least &amp;lt;math&amp;gt;\Delta_\textrm{m}(r_P)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no valid lower ranked block currently seen by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that since &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; is guaranteed to have a notarized block&lt;br /&gt;
of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
when it enters round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, it can make its proposed&lt;br /&gt;
block a child of this notarized block (or any other &lt;br /&gt;
notarized block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; that it may have).&lt;br /&gt;
&lt;br /&gt;
===Notarization===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will support the notarization &lt;br /&gt;
of a valid block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; proposed by a &lt;br /&gt;
replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; of rank &lt;br /&gt;
&amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt;&lt;br /&gt;
provided &lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{n}(r_Q)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and&lt;br /&gt;
(2) there is no block of rank less than &amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt; &lt;br /&gt;
currently seen by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Block proposal relay===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; sees&lt;br /&gt;
a valid block proposal that is proposed by a &lt;br /&gt;
replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; of rank &lt;br /&gt;
&amp;lt;math&amp;gt;r_Q &amp;lt; r_P&amp;lt;/math&amp;gt;&lt;br /&gt;
such that&lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{m}(r_Q)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no block of rank less than &amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt; &lt;br /&gt;
currently seen by &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then at this point in time, if it has not already done so,&lt;br /&gt;
&amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will broadcast this block proposal to all other replicas. &lt;br /&gt;
&lt;br /&gt;
===Proof of liveness invariant===&lt;br /&gt;
&lt;br /&gt;
Here is a proof of the liveness invariant:&lt;br /&gt;
# Suppose the first honest &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; replica finishes round &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;.&lt;br /&gt;
# Under partial synchrony at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;, all honest replicas will enter round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; before time &amp;lt;math&amp;gt;t+\delta&amp;lt;/math&amp;gt; (the notarization that ended round &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, as well as the necessary round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon shares, will arrive at all honest replicas before this time).&lt;br /&gt;
# The leader &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; will propose a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; before time &amp;lt;math&amp;gt;t+\delta&amp;lt;/math&amp;gt;, and again by partial synchrony, this block proposal will be delivered to all other replicas before time &amp;lt;math&amp;gt;t+2\delta&amp;lt;/math&amp;gt;. &lt;br /&gt;
# Assuming &amp;lt;math&amp;gt;\Delta_\mathrm{n}(1) \ge \Delta_\mathrm{m}(0) + 2\delta&amp;lt;/math&amp;gt;, the protocol logic guarantees that each honest replicas support the notarization of block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and no other block, and thus &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; will become notarized and finalized.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Proof of safety invariant===&lt;br /&gt;
&lt;br /&gt;
Here is a proof of the safety invariant:&lt;br /&gt;
# Suppose that the number of corrupt parties is exactly &amp;lt;math&amp;gt;f^* \le f &amp;lt; n/3&amp;lt;/math&amp;gt;.&lt;br /&gt;
# If a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is finalized, then its finalization must have been supported by a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (by the security property for aggregate signatures). &lt;br /&gt;
# Suppose (by way of contradction) that another block &amp;lt;math&amp;gt;B&#039; \ne B&amp;lt;/math&amp;gt; were notarized. Then its notarization must have been supported by a set &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (again, by the security property for aggregate signatures).&lt;br /&gt;
# The sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; are disjoint (by the finalization logic).&lt;br /&gt;
# Therefore, &amp;lt;math&amp;gt;n-f^* \ge |S \cup S&#039;| = |S| + |S&#039;| \ge 2 (n-f-f^*)&amp;lt;/math&amp;gt;, which implies &amp;lt;math&amp;gt;n \le 3f&amp;lt;/math&amp;gt;, a contradiction.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=431</id>
		<title>The Internet Computer for Computer Scientists</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=431"/>
		<updated>2021-11-10T20:55:22Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To a first approximation, the IC (Internet Computer) is a network of  &lt;br /&gt;
[[wikipedia:state machine replication|replicated state machines]].&lt;br /&gt;
&lt;br /&gt;
Each replicated state machine comprises a &amp;lt;b&amp;gt;subnet&amp;lt;/b&amp;gt; of &amp;lt;b&amp;gt;replicas&amp;lt;/b&amp;gt;.&lt;br /&gt;
Subnets may communicate with one another,&lt;br /&gt;
but otherwise they operate (for the most part) independently of each other.&lt;br /&gt;
&lt;br /&gt;
As in any replicated state machine, a series of &amp;lt;b&amp;gt;transaction requests&amp;lt;/b&amp;gt; is processed.&lt;br /&gt;
A transaction request may come from either an external client&lt;br /&gt;
or from another state machine in the IC.&lt;br /&gt;
The replicas in a subnet must run a &amp;lt;b&amp;gt;[[wikipedia:Consensus_(computer_science)|consensus protocol]]&amp;lt;/b&amp;gt; to order the&lt;br /&gt;
incoming transaction requests, so that each replica processes the transaction requests in the same order.&lt;br /&gt;
Each replica processes the transaction requests in the agreed-upon order.&lt;br /&gt;
In processing a transaction request, each replica will update its internal &amp;lt;b&amp;gt;state&amp;lt;/b&amp;gt; &lt;br /&gt;
according to a deterministic function that maps the pair  (current state, transaction request) to a new state.&lt;br /&gt;
Because all replicas in a subnet process transaction requests in the same order, &lt;br /&gt;
their internal states will evolve over time in exactly the same way.&lt;br /&gt;
In response to processing a transaction, a subnet may also generate an outgoing message,&lt;br /&gt;
which can be sent to either an external client or to another state machine in the IC.&lt;br /&gt;
&lt;br /&gt;
The reason for using a replicated state machine, rather than just a single state machine,&lt;br /&gt;
is to achieve [[wikipedia:fault tolerance|fault tolerance]]: a subnet should continue &lt;br /&gt;
to function &amp;amp;mdash; and to function &amp;lt;i&amp;gt;correctly&amp;lt;/i&amp;gt; &amp;amp;mdash; even if some replicas are &amp;lt;b&amp;gt;faulty&amp;lt;/b&amp;gt;.&lt;br /&gt;
Generally in this area, one considers two types of replica failures: &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; and &lt;br /&gt;
&amp;lt;b&amp;gt;[[wikipedia:Byzantine_fault|Byzantine failures]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
A &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; occurs when a replica abruptly stops and does not resume. &amp;lt;b&amp;gt;Byzantine failures&amp;lt;/b&amp;gt; are failures in which a replica may deviate in an arbitrary way from its prescribed protocol. Moreover, with Byzantine failures, one or possibly several replicas may be directly under the control of a malicious adversary.&lt;br /&gt;
Of the two types of failures, Byzantine failures are potentially far more disruptive.&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines typically make assumptions&lt;br /&gt;
about &amp;lt;b&amp;gt;how many&amp;lt;/b&amp;gt; replicas may be faulty and to &amp;lt;b&amp;gt;to what degree&amp;lt;/b&amp;gt; (crash or Byzantine) they may be faulty.&lt;br /&gt;
In the IC, the assumption is that if a given subnet has &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, then less than &amp;lt;math&amp;gt;n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
of these replicas are faulty and these faults may be Byzantine.&lt;br /&gt;
(Note that the different subnets in the IC may have different sizes.)&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines also typically make&lt;br /&gt;
assumptions about the &amp;lt;b&amp;gt;communication model&amp;lt;/b&amp;gt;, which characterizes the ability of an adversary &lt;br /&gt;
to delay the delivery of messages between replicas.&lt;br /&gt;
At opposite ends of the spectrum, we have the following models:&lt;br /&gt;
* In the &amp;lt;b&amp;gt;synchronous model&amp;lt;/b&amp;gt;, there exists some known finite time bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;, such that for any message sent, it will be delivered in less than time &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
* In the &amp;lt;b&amp;gt;asynchronous model&amp;lt;/b&amp;gt;, for any message sent, the adversary can delay its delivery by any finite amount of time, so that there is no bound on the time to deliver a message; however, each message must &amp;lt;b&amp;gt;eventually&amp;lt;/b&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the replicas in an IC-subnet are typically distributed around the globe, a synchronous communication model would be highly unrealistic.&lt;br /&gt;
In this setting, the most robust model is the asynchronous model.&lt;br /&gt;
Unfortunately, there are no known consensus protocols in this model that are truly practical.&lt;br /&gt;
So like most other practical Byzantine fault tolerant systems that cannot rely on synchronous communication,&lt;br /&gt;
the IC opts for a compromise: a  &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt; communication model.&lt;br /&gt;
Such partial synchrony models can be formulated in various ways.&lt;br /&gt;
The partial synchrony assumption used by the IC says, roughly speaking,&lt;br /&gt;
that for each subnet, communication among replicas in that subnet is periodically synchronous for short intervals of time;&lt;br /&gt;
moreover, the synchrony bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; does not need to be known in advance.&lt;br /&gt;
This partial synchrony assumption is only needed to ensure that the consensus protocol makes progress&lt;br /&gt;
(the so-called liveness property) &amp;amp;mdash; it is not needed to ensure correct behavior of consensus&lt;br /&gt;
(the so-called safety property), nor is it needed anywhere else in the IC protocol stack.&lt;br /&gt;
&lt;br /&gt;
Under the assumption of partial synchrony and Byzantine faults, it is known that our bound of &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
on the number of faults is optimal.&lt;br /&gt;
&lt;br /&gt;
Related topics:&lt;br /&gt;
* [[IC architecture overview]]&lt;br /&gt;
* [[IC canisters]]&lt;br /&gt;
* [[IC network nervous system (NNS)]]&lt;br /&gt;
* [[IC threshold signatures and distributed key generation]]&lt;br /&gt;
* [[IC crossnet communication]]&lt;br /&gt;
* [[IC catchup packages]]&lt;br /&gt;
* [[IC fault model]]&lt;br /&gt;
* [[IC tokens]]&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=430</id>
		<title>The Internet Computer for Computer Scientists</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=430"/>
		<updated>2021-11-10T20:54:43Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To a first approximation, the IC (Internet Computer) is a network of  &lt;br /&gt;
[[wikipedia:state machine replication|replicated state machines]].&lt;br /&gt;
&lt;br /&gt;
Each replicated state machine comprises a &amp;lt;b&amp;gt;subnet&amp;lt;/b&amp;gt; of &amp;lt;b&amp;gt;replicas&amp;lt;/b&amp;gt;.&lt;br /&gt;
Subnets may communicate with one another,&lt;br /&gt;
but otherwise they operate (for the most part) independently of each other.&lt;br /&gt;
&lt;br /&gt;
As in any replicated state machine, a series of &amp;lt;b&amp;gt;transaction requests&amp;lt;/b&amp;gt; is processed.&lt;br /&gt;
A transaction request may come from either an external client&lt;br /&gt;
or from another state machine in the IC.&lt;br /&gt;
The replicas in a subnet must run a &amp;lt;b&amp;gt;[[wikipedia:Consensus_(computer_science)|consensus protocol]]&amp;lt;/b&amp;gt; to order the&lt;br /&gt;
incoming transaction requests, so that each replica processes the transaction requests in the same order.&lt;br /&gt;
Each replica processes the transaction requests in the agreed-upon order.&lt;br /&gt;
In processing a transaction request, each replica will update its internal &amp;lt;b&amp;gt;state&amp;lt;/b&amp;gt; &lt;br /&gt;
according to a deterministic function that maps the pair  (current state, transaction request) to a new state.&lt;br /&gt;
Because all replicas in a subnet process transaction requests in the same order, &lt;br /&gt;
their internal states will evolve over time in exactly the same way.&lt;br /&gt;
In response to processing a transaction, a subnet may also generate an outgoing message,&lt;br /&gt;
which can be sent to either an external client or to another state machine in the IC.&lt;br /&gt;
&lt;br /&gt;
The reason for using a replicated state machine, rather than just a single state machine,&lt;br /&gt;
is to achieve [[wikipedia:fault tolerance|fault tolerance]]: a subnet should continue &lt;br /&gt;
to function &amp;amp;mdash; and to function &amp;lt;i&amp;gt;correctly&amp;lt;/i&amp;gt; &amp;amp;mdash; even if some replicas are &amp;lt;b&amp;gt;faulty&amp;lt;/b&amp;gt;.&lt;br /&gt;
Generally in this area, one considers two types of replica failures: &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; and &lt;br /&gt;
&amp;lt;b&amp;gt;[[wikipedia:Byzantine_fault|Byzantine failures]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
A &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; occurs when a replica abruptly stops and does not resume. &amp;lt;b&amp;gt;Byzantine failures&amp;lt;/b&amp;gt; are failures in which a replica may deviate in an arbitrary way from its prescribed protocol. Moreover, with Byzantine failures, one or possibly several replicas may be directly under the control of a malicious adversary.&lt;br /&gt;
Of the two types of failures, Byzantine failures are potentially far more disruptive.&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines typically make assumptions&lt;br /&gt;
about &amp;lt;b&amp;gt;how many&amp;lt;/b&amp;gt; replicas may be faulty and to &amp;lt;b&amp;gt;to what degree&amp;lt;/b&amp;gt; (crash or Byzantine) they may be faulty.&lt;br /&gt;
In the IC, the assumption is that if a given subnet has &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, then less than &amp;lt;math&amp;gt;n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
of these replicas are faulty and these faults may be Byzantine.&lt;br /&gt;
(Note that the different subnets in the IC may have different sizes.)&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines also typically make&lt;br /&gt;
assumptions about the &amp;lt;b&amp;gt;communication model&amp;lt;/b&amp;gt;, which characterizes the ability of an adversary &lt;br /&gt;
to delay the delivery of messages between replicas.&lt;br /&gt;
At opposite ends of the spectrum, we have the following models:&lt;br /&gt;
* In the &amp;lt;b&amp;gt;synchronous model&amp;lt;/b&amp;gt;, there exists some known finite time bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;, such that for any message sent, it will be delivered in time less than &amp;lt;math&amp;gt;delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
* In the &amp;lt;b&amp;gt;asynchronous model&amp;lt;/b&amp;gt;, for any message sent, the adversary can delay its delivery by any finite amount of time, so that there is no bound on the time to deliver a message; however, each message must &amp;lt;b&amp;gt;eventually&amp;lt;/b&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the replicas in an IC-subnet are typically distributed around the globe, a synchronous communication model would be highly unrealistic.&lt;br /&gt;
In this setting, the most robust model is the asynchronous model.&lt;br /&gt;
Unfortunately, there are no known consensus protocols in this model that are truly practical.&lt;br /&gt;
So like most other practical Byzantine fault tolerant systems that cannot rely on synchronous communication,&lt;br /&gt;
the IC opts for a compromise: a  &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt; communication model.&lt;br /&gt;
Such partial synchrony models can be formulated in various ways.&lt;br /&gt;
The partial synchrony assumption used by the IC says, roughly speaking,&lt;br /&gt;
that for each subnet, communication among replicas in that subnet is periodically synchronous for short intervals of time;&lt;br /&gt;
moreover, the synchrony bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; does not need to be known in advance.&lt;br /&gt;
This partial synchrony assumption is only needed to ensure that the consensus protocol makes progress&lt;br /&gt;
(the so-called liveness property) &amp;amp;mdash; it is not needed to ensure correct behavior of consensus&lt;br /&gt;
(the so-called safety property), nor is it needed anywhere else in the IC protocol stack.&lt;br /&gt;
&lt;br /&gt;
Under the assumption of partial synchrony and Byzantine faults, it is known that our bound of &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
on the number of faults is optimal.&lt;br /&gt;
&lt;br /&gt;
Related topics:&lt;br /&gt;
* [[IC architecture overview]]&lt;br /&gt;
* [[IC canisters]]&lt;br /&gt;
* [[IC network nervous system (NNS)]]&lt;br /&gt;
* [[IC threshold signatures and distributed key generation]]&lt;br /&gt;
* [[IC crossnet communication]]&lt;br /&gt;
* [[IC catchup packages]]&lt;br /&gt;
* [[IC fault model]]&lt;br /&gt;
* [[IC tokens]]&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=429</id>
		<title>The Internet Computer for Computer Scientists</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=429"/>
		<updated>2021-11-10T20:51:44Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To a first approximation, the IC (Internet Computer) is a network of  &lt;br /&gt;
[[wikipedia:state machine replication|replicated state machines]].&lt;br /&gt;
&lt;br /&gt;
Each replicated state machine comprises a &amp;lt;b&amp;gt;subnet&amp;lt;/b&amp;gt; of &amp;lt;b&amp;gt;replicas&amp;lt;/b&amp;gt;.&lt;br /&gt;
Subnets may communicate with one another,&lt;br /&gt;
but otherwise they operate (for the most part) independently of each other.&lt;br /&gt;
&lt;br /&gt;
As in any replicated state machine, a series of &amp;lt;b&amp;gt;transaction requests&amp;lt;/b&amp;gt; is processed.&lt;br /&gt;
A transaction request may come from either an external client&lt;br /&gt;
or from another state machine in the IC.&lt;br /&gt;
The replicas in a subnet must run a &amp;lt;b&amp;gt;[[wikipedia:Consensus_(computer_science)|consensus protocol]]&amp;lt;/b&amp;gt; to order the&lt;br /&gt;
incoming transaction requests, so that each replica processes the transaction requests in the same order.&lt;br /&gt;
Each replica processes the transaction requests in the agreed-upon order.&lt;br /&gt;
In processing a transaction request, each replica will update its internal &amp;lt;b&amp;gt;state&amp;lt;/b&amp;gt; &lt;br /&gt;
according to a deterministic function that maps the pair  (current state, transaction request) to a new state.&lt;br /&gt;
Because all replicas in a subnet process transaction requests in the same order, &lt;br /&gt;
their internal states will evolve over time in exactly the same way.&lt;br /&gt;
In response to processing a transaction, a subnet may also generate an outgoing message,&lt;br /&gt;
which can be sent to either an external client or to another state machine in the IC.&lt;br /&gt;
&lt;br /&gt;
The reason for using a replicated state machine, rather than just a single state machine,&lt;br /&gt;
is to achieve [[wikipedia:fault tolerance|fault tolerance]]: a subnet should continue &lt;br /&gt;
to function &amp;amp;mdash; and to function &amp;lt;i&amp;gt;correctly&amp;lt;/i&amp;gt; &amp;amp;mdash; even if some replicas are &amp;lt;b&amp;gt;faulty&amp;lt;/b&amp;gt;.&lt;br /&gt;
Generally in this area, one considers two types of replica failures: &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; and &lt;br /&gt;
&amp;lt;b&amp;gt;[[wikipedia:Byzantine_fault|Byzantine failures]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
A &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; occurs when a replica abruptly stops and does not resume. &amp;lt;b&amp;gt;Byzantine failures&amp;lt;/b&amp;gt; are failures in which a replica may deviate in an arbitrary way from its prescribed protocol. Moreover, with Byzantine failures, one or possibly several replicas may be directly under the control of a malicious adversary.&lt;br /&gt;
Of the two types of failures, Byzantine failures are potentially far more disruptive.&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines typically make assumptions&lt;br /&gt;
about &amp;lt;b&amp;gt;how many&amp;lt;/b&amp;gt; replicas may be faulty and to &amp;lt;b&amp;gt;to what degree&amp;lt;/b&amp;gt; (crash or Byzantine) they may be faulty.&lt;br /&gt;
In the IC, the assumption is that if a given subnet has &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, then less than &amp;lt;math&amp;gt;n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
of these replicas are faulty and these faults may be Byzantine.&lt;br /&gt;
(Note that the different subnets in the IC may have different sizes.)&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines also typically make&lt;br /&gt;
assumptions about the &amp;lt;b&amp;gt;communication model&amp;lt;/b&amp;gt;, which characterizes the ability of an adversary &lt;br /&gt;
to delay the delivery of messages between replicas.&lt;br /&gt;
At opposite ends of the spectrum, we have the following models:&lt;br /&gt;
* In the &amp;lt;b&amp;gt;synchronous model&amp;lt;/b&amp;gt;, there exists some known finite time bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;, such that for any message sent, the adversary can delay its delivery by less than &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; time units.&lt;br /&gt;
* In the &amp;lt;b&amp;gt;asynchronous model&amp;lt;/b&amp;gt;, for any message sent, the adversary can delay its delivery by any finite amount of time, so that there is no bound on the time to deliver a message; however, each message must &amp;lt;b&amp;gt;eventually&amp;lt;/b&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the replicas in an IC-subnet are typically distributed around the globe, a synchronous communication model would be highly unrealistic.&lt;br /&gt;
In this setting, the most robust model is the asynchronous model.&lt;br /&gt;
Unfortunately, there are no known consensus protocols in this model that are truly practical.&lt;br /&gt;
So like most other practical Byzantine fault tolerant systems that cannot rely on synchronous communication,&lt;br /&gt;
the IC opts for a compromise: a  &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt; communication model.&lt;br /&gt;
Such partial synchrony models can be formulated in various ways.&lt;br /&gt;
The partial synchrony assumption used by the IC says, roughly speaking,&lt;br /&gt;
that for each subnet, communication among replicas in that subnet is periodically synchronous for short intervals of time;&lt;br /&gt;
moreover, the synchrony bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; does not need to be known in advance.&lt;br /&gt;
This partial synchrony assumption is only needed to ensure that the consensus protocol makes progress&lt;br /&gt;
(the so-called liveness property) &amp;amp;mdash; it is not needed to ensure correct behavior of consensus&lt;br /&gt;
(the so-called safety property), nor is it needed anywhere else in the IC protocol stack.&lt;br /&gt;
&lt;br /&gt;
Under the assumption of partial synchrony and Byzantine faults, it is known that our bound of &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
on the number of faults is optimal.&lt;br /&gt;
&lt;br /&gt;
Related topics:&lt;br /&gt;
* [[IC architecture overview]]&lt;br /&gt;
* [[IC canisters]]&lt;br /&gt;
* [[IC network nervous system (NNS)]]&lt;br /&gt;
* [[IC threshold signatures and distributed key generation]]&lt;br /&gt;
* [[IC crossnet communication]]&lt;br /&gt;
* [[IC catchup packages]]&lt;br /&gt;
* [[IC fault model]]&lt;br /&gt;
* [[IC tokens]]&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=428</id>
		<title>The Internet Computer for Computer Scientists</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=428"/>
		<updated>2021-11-10T19:49:08Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To a first approximation, the IC (Internet Computer) is a network of  &lt;br /&gt;
[[wikipedia:state machine replication|replicated state machines]].&lt;br /&gt;
&lt;br /&gt;
Each replicated state machine comprises a &amp;lt;b&amp;gt;subnet&amp;lt;/b&amp;gt; of &amp;lt;b&amp;gt;replicas&amp;lt;/b&amp;gt;.&lt;br /&gt;
Subnets may communicate with one another,&lt;br /&gt;
but otherwise they operate (for the most part) independently of each other.&lt;br /&gt;
&lt;br /&gt;
As in any replicated state machine, a series of &amp;lt;b&amp;gt;transaction requests&amp;lt;/b&amp;gt; is processed.&lt;br /&gt;
A transaction request may come from either an external client&lt;br /&gt;
or from another state machine in the IC.&lt;br /&gt;
The replicas in a subnet must run a &amp;lt;b&amp;gt;[[wikipedia:Consensus_(computer_science)|consensus protocol]]&amp;lt;/b&amp;gt; to order the&lt;br /&gt;
incoming transaction requests, so that each replica processes the transaction requests in the same order.&lt;br /&gt;
Each replica processes the transaction requests in the agreed-upon order.&lt;br /&gt;
In processing a transaction request, each replica will update its internal &amp;lt;b&amp;gt;state&amp;lt;/b&amp;gt; &lt;br /&gt;
according to a deterministic function that maps the pair  (current state, transaction request) to a new state.&lt;br /&gt;
Because all replicas in a subnet process transaction requests in the same order, &lt;br /&gt;
their internal states will evolve over time in exactly the same way.&lt;br /&gt;
In response to processing a transaction, a subnet may also generate an outgoing message,&lt;br /&gt;
which can be sent to either an external client or to another state machine in the IC.&lt;br /&gt;
&lt;br /&gt;
The reason for using a replicated state machine, rather than just a single state machine,&lt;br /&gt;
is to achieve [[wikipedia:fault tolerance|fault tolerance]]: a subnet should continue &lt;br /&gt;
to function &amp;amp;mdash; and to function &amp;lt;i&amp;gt;correctly&amp;lt;/i&amp;gt; &amp;amp;mdash; even if some replicas are &amp;lt;b&amp;gt;faulty&amp;lt;/b&amp;gt;.&lt;br /&gt;
Generally in this area, one considers two types of replica failures: &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; and &lt;br /&gt;
&amp;lt;b&amp;gt;[[wikipedia:Byzantine_fault|Byzantine failures]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
A &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; occurs when a replica abruptly stops and does not resume. &amp;lt;b&amp;gt;Byzantine failures&amp;lt;/b&amp;gt; are failures in which a replica may deviate in an arbitrary way from its prescribed protocol. Moreover, with Byzantine failures, one or possibly several replicas may be directly under the control of a malicious adversary.&lt;br /&gt;
Of the two types of failures, Byzantine failures are potentially far more disruptive.&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines typically make assumptions&lt;br /&gt;
about &amp;lt;b&amp;gt;how many&amp;lt;/b&amp;gt; replicas may be faulty and to &amp;lt;b&amp;gt;to what degree&amp;lt;/b&amp;gt; (crash or Byzantine) they may be faulty.&lt;br /&gt;
In the IC, the assumption is that if a given subnet has &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, then less than &amp;lt;math&amp;gt;n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
of these replicas are faulty and these faults may be Byzantine.&lt;br /&gt;
(Note that the different subnets in the IC may have different sizes.)&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines also typically make&lt;br /&gt;
assumptions about the &amp;lt;b&amp;gt;communication model&amp;lt;/b&amp;gt;, which characterizes the ability of an adversary &lt;br /&gt;
to delay the delivery of messages between replicas.&lt;br /&gt;
At opposite ends of the spectrum, we have the following models:&lt;br /&gt;
* In the &amp;lt;b&amp;gt;synchronous model&amp;lt;/b&amp;gt;, there exists some known finite time bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;, such that for any message sent, the adversary can delay its delivery by at most &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
* In the &amp;lt;b&amp;gt;asynchronous model&amp;lt;/b&amp;gt;, for any message sent, the adversary can delay its delivery by any finite amount of time, so that there is no bound on the time to deliver a message; however, each message must &amp;lt;b&amp;gt;eventually&amp;lt;/b&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the replicas in an IC-subnet are typically distributed around the globe, a synchronous communication model would be highly unrealistic.&lt;br /&gt;
In this setting, the most robust model is the asynchronous model.&lt;br /&gt;
Unfortunately, there are no known consensus protocols in this model that are truly practical.&lt;br /&gt;
So like most other practical Byzantine fault tolerant systems that cannot rely on synchronous communication,&lt;br /&gt;
the IC opts for a compromise: a  &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt; communication model.&lt;br /&gt;
Such partial synchrony models can be formulated in various ways.&lt;br /&gt;
The partial synchrony assumption used by the IC says, roughly speaking,&lt;br /&gt;
that for each subnet, communication among replicas in that subnet is periodically synchronous for short intervals of time;&lt;br /&gt;
moreover, the synchrony bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; does not need to be known in advance.&lt;br /&gt;
This partial synchrony assumption is only needed to ensure that the consensus protocol makes progress&lt;br /&gt;
(the so-called liveness property) &amp;amp;mdash; it is not needed to ensure correct behavior of consensus&lt;br /&gt;
(the so-called safety property), nor is it needed anywhere else in the IC protocol stack.&lt;br /&gt;
&lt;br /&gt;
Under the assumption of partial synchrony and Byzantine faults, it is known that our bound of &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
on the number of faults is optimal.&lt;br /&gt;
&lt;br /&gt;
Related topics:&lt;br /&gt;
* [[IC architecture overview]]&lt;br /&gt;
* [[IC canisters]]&lt;br /&gt;
* [[IC network nervous system (NNS)]]&lt;br /&gt;
* [[IC threshold signatures and distributed key generation]]&lt;br /&gt;
* [[IC crossnet communication]]&lt;br /&gt;
* [[IC catchup packages]]&lt;br /&gt;
* [[IC fault model]]&lt;br /&gt;
* [[IC tokens]]&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=427</id>
		<title>The Internet Computer for Computer Scientists</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=427"/>
		<updated>2021-11-10T19:44:11Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To a first approximation, the IC (Internet Computer) is a network of  &lt;br /&gt;
[[wikipedia:state machine replication|replicated state machines]].&lt;br /&gt;
&lt;br /&gt;
Each replicated state machine comprises a &amp;lt;b&amp;gt;subnet&amp;lt;/b&amp;gt; of &amp;lt;b&amp;gt;replicas&amp;lt;/b&amp;gt;.&lt;br /&gt;
Subnets may communicate with one another,&lt;br /&gt;
but otherwise they operate (for the most part) independently of each other.&lt;br /&gt;
&lt;br /&gt;
As in any replicated state machine, a series of &amp;lt;b&amp;gt;transaction requests&amp;lt;/b&amp;gt; is processed.&lt;br /&gt;
A transaction request may come from either an external client&lt;br /&gt;
or from another state machine in the IC.&lt;br /&gt;
The replicas in a subnet must run a &amp;lt;b&amp;gt;[[wikipedia:Consensus_(computer_science)|consensus protocol]]&amp;lt;/b&amp;gt; to order the&lt;br /&gt;
incoming transaction requests, so that each replica processes the transaction requests in the same order.&lt;br /&gt;
Each replica processes the transaction requests in the agreed-upon order.&lt;br /&gt;
In processing a transaction request, each replica will update its internal &amp;lt;b&amp;gt;state&amp;lt;/b&amp;gt; &lt;br /&gt;
according to a deterministic function that maps the pair  (current state, transaction request) to a new state.&lt;br /&gt;
Because all replicas in a subnet process transaction requests in the same order, &lt;br /&gt;
their internal states will evolve over time in exactly the same way.&lt;br /&gt;
In response to processing a transaction, a subnet may also generate an outgoing message,&lt;br /&gt;
which can be sent to either an external client or to another state machine in the IC.&lt;br /&gt;
&lt;br /&gt;
The reason for using a replicated state machine, rather than just a single state machine,&lt;br /&gt;
is to achieve [[wikipedia:fault tolerance|fault tolerance]]: a subnet should continue &lt;br /&gt;
to function &amp;amp;mdash; and to function &amp;lt;i&amp;gt;correctly&amp;lt;/i&amp;gt; &amp;amp;mdash; even if some replicas are &amp;lt;b&amp;gt;faulty&amp;lt;/b&amp;gt;.&lt;br /&gt;
Generally in this area, one considers two types of replica failures: &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; and &lt;br /&gt;
&amp;lt;b&amp;gt;[[wikipedia:Byzantine_fault|Byzantine failures]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
A &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; occurs when a replica abruptly stops and does not resume. &amp;lt;b&amp;gt;Byzantine failures&amp;lt;/b&amp;gt; are failures in which a replica may deviate in an arbitrary way from its prescribed protocol. Moreover, with Byzantine failures, one or possibly several replicas may be directly under the control of a malicious adversary.&lt;br /&gt;
Of the two types of failures, Byzantine failures are potentially far more disruptive.&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines typically make assumptions&lt;br /&gt;
about &amp;lt;b&amp;gt;how many&amp;lt;/b&amp;gt; replicas may be faulty and to &amp;lt;b&amp;gt;to what degree&amp;lt;/b&amp;gt; (crash or Byzantine) they may be faulty.&lt;br /&gt;
In the IC, the assumption is that if a given subnet has &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, then less than &amp;lt;math&amp;gt;n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
of these replicas are faulty and these faults may be Byzantine.&lt;br /&gt;
(Note that the different subnets in the IC may have different sizes.)&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines also typically make&lt;br /&gt;
assumptions about the &amp;lt;b&amp;gt;communication model&amp;lt;/b&amp;gt;, which characterizes the ability of an adversary &lt;br /&gt;
to delay the delivery of messages between replicas.&lt;br /&gt;
At opposite ends of the spectrum, we have the following models:&lt;br /&gt;
* In the &amp;lt;b&amp;gt;synchronous model&amp;lt;/b&amp;gt;, there exists some known finite time bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;, such that for any message sent, the adversary can delay its delivery by at most &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
* In the &amp;lt;b&amp;gt;asynchronous model&amp;lt;/b&amp;gt;, for any message sent, the adversary can delay its delivery by any finite amount of time, so that there is no bound on the time to deliver a message; however, each message must &amp;lt;b&amp;gt;eventually&amp;lt;/b&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the replicas in an IC-subnet are typically distributed around the globe, a synchronous communication model would be highly unrealistic.&lt;br /&gt;
In this setting, the most robust model is the asynchronous model.&lt;br /&gt;
Unfortunately, there are no known consensus protocols in this model that are truly practical.&lt;br /&gt;
So like most other practical Byzantine fault tolerant systems that cannot rely on synchronous communication,&lt;br /&gt;
the IC opts for a compromise: a  &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt; communication model.&lt;br /&gt;
Such partial synchrony models can be formulated in various ways.&lt;br /&gt;
The partial synchrony assumption used by the IC says, roughly speaking,&lt;br /&gt;
that for each subnet, communication among replicas in that subnet is synchronous for short periods of time&lt;br /&gt;
every now and then;&lt;br /&gt;
moreover, the synchrony bound &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; does not need to be known in advance.&lt;br /&gt;
This partial synchrony assumption is only needed to ensure that the consensus protocol makes progress&lt;br /&gt;
(the so-called liveness property) &amp;amp;mdash; it is not needed to ensure correct behavior of consensus&lt;br /&gt;
(the so-called safety property), nor is it needed anywhere else in the IC protocol stack.&lt;br /&gt;
&lt;br /&gt;
Under the assumption of partial synchrony and Byzantine faults, it is known that our bound of &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
on the number of faults is optimal.&lt;br /&gt;
&lt;br /&gt;
Related topics:&lt;br /&gt;
* [[IC architecture overview]]&lt;br /&gt;
* [[IC canisters]]&lt;br /&gt;
* [[IC network nervous system (NNS)]]&lt;br /&gt;
* [[IC threshold signatures and distributed key generation]]&lt;br /&gt;
* [[IC crossnet communication]]&lt;br /&gt;
* [[IC catchup packages]]&lt;br /&gt;
* [[IC fault model]]&lt;br /&gt;
* [[IC tokens]]&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=246</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=246"/>
		<updated>2021-11-09T00:57:59Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; .&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
&lt;br /&gt;
When the network is timely, &lt;br /&gt;
the message complexity in a given round of the IC consensus protocol is &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
with overwhelming probability. &lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
==Public keys==&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &lt;br /&gt;
&amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
&lt;br /&gt;
==Random Beacon==&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Block making==&lt;br /&gt;
&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
==Notarization==&lt;br /&gt;
&lt;br /&gt;
A block is only added to the tree of blocks when it becomes &lt;br /&gt;
&amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, &lt;br /&gt;
&amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its notarization.&lt;br /&gt;
Given a proposed &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
a replica will verify a number of conditions,&lt;br /&gt;
and if these tests pass, the replica will support the notarization of the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity of the supporting replica, and&lt;br /&gt;
* the notarizing replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &lt;br /&gt;
&amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the set of identities of the &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; supporting replicas,&lt;br /&gt;
* an aggregation of the &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; signatures on the message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Each replica will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
as soon as it obtains a notarized block of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and will not subsequently notarize any other blocks at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Finalization==&lt;br /&gt;
&lt;br /&gt;
There may be more than one &lt;br /&gt;
notarized block at a given height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
However, if a block is &amp;lt;b&amp;gt;finalized&amp;lt;/b&amp;gt;, then we can be sure that there&lt;br /&gt;
is no other notarized block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;finalization invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a block to become finalized, &lt;br /&gt;
&amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its finalization.&lt;br /&gt;
Recall that round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; ends for a replica when &lt;br /&gt;
it obtains a notarized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At that point in time, such a replica will &lt;br /&gt;
check if it supported the notarization of any block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
other than block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
If not, the replica will support the finalization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
by broadcasting a &lt;br /&gt;
&amp;lt;b&amp;gt;finalization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A finalization share has exactly  the same format as a notarization share&lt;br /&gt;
(but is tagged in such a way notarization shares&lt;br /&gt;
and finalization shares cannot be confused with one another).&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; finalization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;finalization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
which has exactly the same format as a notarization.&lt;br /&gt;
&lt;br /&gt;
One can easily see that the logic for finalizing blocks&lt;br /&gt;
implies that the finalization invariant must hold.&lt;br /&gt;
Here is a proof:&lt;br /&gt;
# Suppose that the number of corrupt parties is exactly &amp;lt;math&amp;gt;f^* \le f &amp;lt; n/3&amp;lt;/math&amp;gt;.&lt;br /&gt;
# If a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is finalized, then its finalization must have been supported by a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (by the security property for aggregate signatures). &lt;br /&gt;
# If another block &amp;lt;math&amp;gt;B&#039; \ne B&amp;lt;/math&amp;gt; were notarized, then its notarization must have been supported by a set &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (again, by the security property for aggregate signatures).&lt;br /&gt;
# The sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; are disjoint (by the finalization logic).&lt;br /&gt;
# Therefore, &amp;lt;math&amp;gt;n-f^* \ge |S| + |S&#039;| \ge 2 (n-f-f^*)&amp;lt;/math&amp;gt;, which implies &amp;lt;math&amp;gt;n \le 3f&amp;lt;/math&amp;gt;, a contradiction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One consequence of the finalization invariant is the following.&lt;br /&gt;
Suppose one replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
and that another replica sees a finalized block &lt;br /&gt;
&amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&#039; \le h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the finalization invariant implies that the path in the tree of notarized blocks&lt;br /&gt;
ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; is a prefix of the path ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
(if not, then there would be two notarized blocks at height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt;,&lt;br /&gt;
contradicting the finalization invariant).   &lt;br /&gt;
Thus, whenever replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
it may view all ancestors of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; as being &lt;br /&gt;
&amp;lt;b&amp;gt;implicitly finalized&amp;lt;/b&amp;gt;, and because of the&lt;br /&gt;
finalization invariant, the &amp;lt;b&amp;gt;safety property&amp;lt;/b&amp;gt; is&lt;br /&gt;
guaranteed to hold for these (explicitly and implicitly) finalized blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Delay functions==&lt;br /&gt;
&lt;br /&gt;
The protocol makes use of two &amp;lt;b&amp;gt;delay functions&amp;lt;/b&amp;gt;, &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{p}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;,&lt;br /&gt;
which control&lt;br /&gt;
the timing of block making and notarization activity.&lt;br /&gt;
Both of these functions map the rank of the proposing replica&lt;br /&gt;
no a nonnegative delay amount,&lt;br /&gt;
and it is assumed that &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{p}(r) \le \Delta_\textrm{n}(r)&amp;lt;/math&amp;gt;&lt;br /&gt;
for all &amp;lt;math&amp;gt;r = 0, \ldots, n-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
The recommended definition of these functions is&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{p}(r) = 2 \delta r&amp;lt;/math&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}(r) = 2 \delta r + \epsilon&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; is an upper bound on the time to deliver&lt;br /&gt;
messages from one honest replica to another,&lt;br /&gt;
and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; is a &amp;quot;governor&amp;quot; to keep the&lt;br /&gt;
protocol from running too fast.&lt;br /&gt;
With these definitions, liveness will be ensured in those&lt;br /&gt;
rounds in which (1) the leader is honest, and (2) messages really&lt;br /&gt;
are delivered between honest parties within time &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Indeed,&lt;br /&gt;
if (1) and (2) both hold in a given round, then the block proposed&lt;br /&gt;
by the leader in that round will be finalized.&lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;liveness invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
Note that even if (1) or (2) do not hold in a given round, &lt;br /&gt;
the protocol is still guaranteed to make progress in the sense&lt;br /&gt;
that at least one notarized block will be added to the tree in that round.  &lt;br /&gt;
Also note that the safety property of the protocol is always &lt;br /&gt;
guaranteed.&lt;br /&gt;
&lt;br /&gt;
==Putting it all together==&lt;br /&gt;
&lt;br /&gt;
We now describe in more detail how the protocol works;&lt;br /&gt;
specifically, we describe more precisely when a replica will&lt;br /&gt;
propose a block and when a replica will support the notarization of a block. &lt;br /&gt;
A given replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will record the time at which it &lt;br /&gt;
enters a given round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
which happens when it has obtained (1) some notarization for a &lt;br /&gt;
block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;, and (2) the random beacon for&lt;br /&gt;
round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Since the random beacon for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; has been determined,&lt;br /&gt;
&amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; can determine its own rank &amp;lt;math&amp;gt;r_P&amp;lt;/math&amp;gt;, as well as the &lt;br /&gt;
rank &amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt; of each other replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; &lt;br /&gt;
for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Block making===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will only propose its own block &amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;&lt;br /&gt;
provided (1) at least &amp;lt;math&amp;gt;\Delta_\textrm{p}(r_P)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no &amp;lt;i&amp;gt;better&amp;lt;/i&amp;gt; block available to &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block is deemed to be &amp;lt;i&amp;gt;better&amp;lt;/i&amp;gt; than &amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt; &lt;br /&gt;
if it was proposed by a replica of rank less than &amp;lt;math&amp;gt;r_P&amp;lt;/math&amp;gt;&lt;br /&gt;
that has not been &amp;lt;i&amp;gt;disqualified&amp;lt;/i&amp;gt; &lt;br /&gt;
[[#Disqualify or relay|(see below)]].&lt;br /&gt;
&lt;br /&gt;
Note that since &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; is guaranteed to have a notarized block&lt;br /&gt;
of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
when it enters round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, it can make its proposed&lt;br /&gt;
block a child of this notarized block (or any other &lt;br /&gt;
notarized block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; that it may have).&lt;br /&gt;
&lt;br /&gt;
===Notarization===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will support the notarization &lt;br /&gt;
of a valid block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; proposed by a &lt;br /&gt;
non-disqualified replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; of rank &lt;br /&gt;
&amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt;&lt;br /&gt;
provided &lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{n}(r_Q)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
(2) there is no better block available to &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;,&lt;br /&gt;
and (3) there is no&lt;br /&gt;
&amp;lt;i&amp;gt;evidence of inconsistent behavior&amp;lt;/i&amp;gt; by &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; in this round&lt;br /&gt;
[[#Disqualify or relay|(see below)]].&lt;br /&gt;
&lt;br /&gt;
===Disqualify or relay===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; sees&lt;br /&gt;
of a valid block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; proposed by a &lt;br /&gt;
non-disqualified replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; of rank &lt;br /&gt;
&amp;lt;math&amp;gt;r_Q &amp;lt; r_P&amp;lt;/math&amp;gt;&lt;br /&gt;
such that&lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{p}(r_Q)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no better block available to &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
At this point in time, &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will either &lt;br /&gt;
&amp;lt;b&amp;gt;disqualify&amp;lt;/b&amp;gt; the replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; (for the current round)&lt;br /&gt;
or &lt;br /&gt;
&amp;lt;b&amp;gt;relay&amp;lt;/b&amp;gt; the block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Party &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will &amp;lt;b&amp;gt;disqualify&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; if there is&lt;br /&gt;
&amp;lt;i&amp;gt;evidence of inconsistent behavior&amp;lt;/i&amp;gt; by &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; in this round.&lt;br /&gt;
Such evidence consists of either (1) two different block proposals&lt;br /&gt;
by &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; in this round, or (2) a &amp;lt;i&amp;gt;proof of inconsistent behavior&amp;lt;/i&amp;gt;&lt;br /&gt;
obtained from another replica.&lt;br /&gt;
Such a proof of inconsistent behavior is simply a message consisting&lt;br /&gt;
of two distinct block proposals from &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;.&lt;br /&gt;
In either case, &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will mark &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; as &amp;lt;i&amp;gt;disqualified&amp;lt;/i&amp;gt;&lt;br /&gt;
for the current round, and broadcast to all replicas a proof of inconsistent &lt;br /&gt;
behavior. &lt;br /&gt;
Note that since block proposals are signed, it is infeasible&lt;br /&gt;
to construct a proof of inconsistent behavior against an honest replica.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; does not disqualify &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, and has not already&lt;br /&gt;
relayed the block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt;, it will &amp;lt;b&amp;gt;relay&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt;, which&lt;br /&gt;
means it will broadcast &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; to all replicas and mark &lt;br /&gt;
&amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; as &amp;lt;i&amp;gt;relayed&amp;lt;/i&amp;gt;.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=245</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=245"/>
		<updated>2021-11-08T21:13:23Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; .&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
&lt;br /&gt;
When the network is timely, &lt;br /&gt;
the message complexity in a given round of the IC consensus protocol is &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
with overwhelming probability. &lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
==Public keys==&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &lt;br /&gt;
&amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
&lt;br /&gt;
==Random Beacon==&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Block making==&lt;br /&gt;
&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
==Notarization==&lt;br /&gt;
&lt;br /&gt;
A block is only added to the tree of blocks when it becomes &lt;br /&gt;
&amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, &lt;br /&gt;
&amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its notarization.&lt;br /&gt;
Given a proposed &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
a replica will verify a number of conditions,&lt;br /&gt;
and if these tests pass, the replica will support the notarization of the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity of the supporting replica, and&lt;br /&gt;
* the notarizing replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &lt;br /&gt;
&amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the set of identities of the &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; supporting replicas,&lt;br /&gt;
* an aggregation of the &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; signatures on the message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Each replica will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
as soon as it obtains a notarized block of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and will not subsequently notarize any other blocks at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Finalization==&lt;br /&gt;
&lt;br /&gt;
There may be more than one &lt;br /&gt;
notarized block at a given height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
However, if a block is &amp;lt;b&amp;gt;finalized&amp;lt;/b&amp;gt;, then we can be sure that there&lt;br /&gt;
is no other notarized block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;finalization invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a block to become finalized, &lt;br /&gt;
&amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its finalization.&lt;br /&gt;
Recall that round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; ends for a replica when &lt;br /&gt;
it obtains a notarized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At that point in time, such a replica will &lt;br /&gt;
check if it supported the notarization of any block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
other than block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
If not, the replica will support the finalization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
by broadcasting a &lt;br /&gt;
&amp;lt;b&amp;gt;finalization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A finalization share has exactly  the same format as a notarization share&lt;br /&gt;
(but is tagged in such a way notarization shares&lt;br /&gt;
and finalization shares cannot be confused with one another).&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; finalization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;finalization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
which has exactly the same format as a notarization.&lt;br /&gt;
&lt;br /&gt;
One can easily see that the logic for finalizing blocks&lt;br /&gt;
implies that the finalization invariant must hold.&lt;br /&gt;
Here is a proof:&lt;br /&gt;
# Suppose that the number of corrupt parties is exactly &amp;lt;math&amp;gt;f^* \le f &amp;lt; n/3&amp;lt;/math&amp;gt;.&lt;br /&gt;
# If a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is finalized, then its finalization must have been supported by a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (by the security property for aggregate signatures). &lt;br /&gt;
# If another block &amp;lt;math&amp;gt;B&#039; \ne B&amp;lt;/math&amp;gt; were notarized, then its notarization must have been supported by a set &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (again, by the security property for aggregate signatures).&lt;br /&gt;
# The sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; are disjoint (by the finalization logic).&lt;br /&gt;
# Therefore, &amp;lt;math&amp;gt;n-f^* \ge |S| + |S&#039;| \ge 2 (n-f-f^*)&amp;lt;/math&amp;gt;, which implies &amp;lt;math&amp;gt;n \le 3f&amp;lt;/math&amp;gt;, a contradiction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One consequence of the finalization invariant is the following.&lt;br /&gt;
Suppose one replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
and that another replica sees a finalized block &lt;br /&gt;
&amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&#039; \le h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the finalization invariant implies that the path in the tree of notarized blocks&lt;br /&gt;
ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; is a prefix of the path ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
(if not, then there would be two notarized blocks at height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt;,&lt;br /&gt;
contradicting the finalization invariant).   &lt;br /&gt;
Thus, whenever replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
it may view all ancestors of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; as being &lt;br /&gt;
&amp;lt;b&amp;gt;implicitly finalized&amp;lt;/b&amp;gt;, and because of the&lt;br /&gt;
finalization invariant, the &amp;lt;b&amp;gt;safety property&amp;lt;/b&amp;gt; is&lt;br /&gt;
guaranteed to hold for these (explicitly and implicitly) finalized blocks.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Delay functions==&lt;br /&gt;
&lt;br /&gt;
The protocol makes use of two &amp;lt;b&amp;gt;delay functions&amp;lt;/b&amp;gt;, &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{p}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\Delta_\textrm{n}&amp;lt;/math&amp;gt;,&lt;br /&gt;
which control&lt;br /&gt;
the timing of block making and notarization activity.&lt;br /&gt;
Both of these functions map the rank of the proposing replica&lt;br /&gt;
no a nonnegative delay amount,&lt;br /&gt;
and it is assumed that &lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{p}(r) \le \Delta_\textrm{n}(r)&amp;lt;/math&amp;gt;&lt;br /&gt;
for all &amp;lt;math&amp;gt;r = 0, \ldots, n-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
The recommended definition of these functions is&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{p}(r) = 2 \delta r&amp;lt;/math&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
&amp;lt;math&amp;gt;\Delta_\textrm{n}(r) = 2 \delta r + \epsilon&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt; is an upper bound on the time to deliver&lt;br /&gt;
messages from one honest replica to another,&lt;br /&gt;
and &amp;lt;math&amp;gt;\epsilon&amp;lt;/math&amp;gt; is a &amp;quot;governor&amp;quot; to keep the&lt;br /&gt;
protocol from running too fast.&lt;br /&gt;
With these definitions, liveness will be ensured in those&lt;br /&gt;
rounds in which (1) the leader is honest, and (2) messages really&lt;br /&gt;
are delivered between honest parties within time &amp;lt;math&amp;gt;\delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
Indeed,&lt;br /&gt;
if (1) and (2) both hold in a given round, then the block proposed&lt;br /&gt;
by the leader in that round will be finalized.&lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;liveness invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
Note that even if (1) or (2) do not hold in a given round, &lt;br /&gt;
the protocol is still guaranteed to make progress in the sense&lt;br /&gt;
that at least one notarized block will be added to the tree in that round.  &lt;br /&gt;
Also note that the safety property of the protocol is always &lt;br /&gt;
guaranteed.&lt;br /&gt;
&lt;br /&gt;
==Putting it all together==&lt;br /&gt;
&lt;br /&gt;
We now describe in more detail how the protocol works;&lt;br /&gt;
specifically, we describe more precisely when a replica will&lt;br /&gt;
propose a block and when a replica will support the notarization of a block. &lt;br /&gt;
A given replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will record the time at which it &lt;br /&gt;
enters a given round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
which happens when it has obtained (1) some notarization for a &lt;br /&gt;
block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;, and (2) the random beacon for&lt;br /&gt;
round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Since the random beacon for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; has been determined,&lt;br /&gt;
&amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; can determine its own rank &amp;lt;math&amp;gt;r_P&amp;lt;/math&amp;gt;, as well as the &lt;br /&gt;
rank &amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt; of each other replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; &lt;br /&gt;
for round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Block making===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will only propose its own block &amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt;&lt;br /&gt;
provided (1) at least &amp;lt;math&amp;gt;\Delta_\textrm{p}(r_P)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no &amp;lt;i&amp;gt;better&amp;lt;/i&amp;gt; block available to &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block is deemed to be &amp;lt;i&amp;gt;better&amp;lt;/i&amp;gt; than &amp;lt;math&amp;gt;B_P&amp;lt;/math&amp;gt; &lt;br /&gt;
if it was proposed by a replica of rank less than &amp;lt;math&amp;gt;r_P&amp;lt;/math&amp;gt;&lt;br /&gt;
that has not been &amp;lt;i&amp;gt;disqualified&amp;lt;/i&amp;gt;.&lt;br /&gt;
We will discuss &amp;lt;i&amp;gt;disqualification&amp;lt;/i&amp;gt; below.&lt;br /&gt;
&lt;br /&gt;
Note that since &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; is guaranteed to have a notarized block&lt;br /&gt;
of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
when it enters round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, it can make its proposed&lt;br /&gt;
block a child of this notarized block (or any other &lt;br /&gt;
notarized block of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt; that it may have).&lt;br /&gt;
&lt;br /&gt;
===Notarization===&lt;br /&gt;
&lt;br /&gt;
Replica &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will support the notarization &lt;br /&gt;
of a valid block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; proposed by a &lt;br /&gt;
non-disqualified replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; of rank &lt;br /&gt;
&amp;lt;math&amp;gt;r_Q&amp;lt;/math&amp;gt;&lt;br /&gt;
provided &lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{n}(r_Q)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no better block available to &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Disqualify or relay===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Suppose &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; sees&lt;br /&gt;
of a valid block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; proposed by a &lt;br /&gt;
non-disqualified replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; of rank &lt;br /&gt;
&amp;lt;math&amp;gt;r_Q &amp;lt; r_P&amp;lt;/math&amp;gt;&lt;br /&gt;
such that&lt;br /&gt;
(1) at least &amp;lt;math&amp;gt;\Delta_\textrm{p}(r_Q)&amp;lt;/math&amp;gt; time&lt;br /&gt;
units have passed since the beginning of the round,&lt;br /&gt;
and (2) there is no better block available to &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;.&lt;br /&gt;
At this point in time, &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will either &lt;br /&gt;
&amp;lt;b&amp;gt;disqualify&amp;lt;/b&amp;gt; the replica &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; (for the current round)&lt;br /&gt;
or &lt;br /&gt;
&amp;lt;b&amp;gt;relay&amp;lt;/b&amp;gt; the block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Party &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will &amp;lt;b&amp;gt;disqualify&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; if it&lt;br /&gt;
has &amp;lt;i&amp;gt;evidence of inconsistent behavior&amp;lt;/i&amp;gt; by &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; in this round.&lt;br /&gt;
Such evidence consists of either (1) two different block proposals&lt;br /&gt;
by &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; in this round, or (2) a &amp;lt;i&amp;gt;proof of inconsistent behavior&amp;lt;/i&amp;gt;&lt;br /&gt;
obtained from another replica.&lt;br /&gt;
Such a proof of inconsistent behavior is simply a message consisting&lt;br /&gt;
of two distinct block proposals from &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;.&lt;br /&gt;
In either case, &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; will mark &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt; as &amp;lt;i&amp;gt;disqualified&amp;lt;/i&amp;gt;&lt;br /&gt;
for the current round, and broadcast to all replicas a proof of inconsistent &lt;br /&gt;
behavior. &lt;br /&gt;
Note that since block proposals are signed, it is infeasible&lt;br /&gt;
to construct a proof of inconsistent behavior against an honest replica.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; does not disqualify &amp;lt;math&amp;gt;Q&amp;lt;/math&amp;gt;, and has not already&lt;br /&gt;
relayed the block &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt;, it will &amp;lt;b&amp;gt;relay&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt;, which&lt;br /&gt;
means it will broadcast &amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; to all replicas and mark &lt;br /&gt;
&amp;lt;math&amp;gt;B_Q&amp;lt;/math&amp;gt; as &amp;lt;i&amp;gt;relayed&amp;lt;/i&amp;gt;.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=244</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=244"/>
		<updated>2021-11-08T18:32:38Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; .&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
&lt;br /&gt;
When the network is timely, &lt;br /&gt;
the message complexity in a given round of the IC consensus protocol is &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
with overwhelming probability. &lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation via PoPs.&lt;br /&gt;
&lt;br /&gt;
==Random Beacon==&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Block making==&lt;br /&gt;
&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
==Notarization==&lt;br /&gt;
&lt;br /&gt;
A block is only added to the tree of blocks when it becomes &lt;br /&gt;
&amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, &lt;br /&gt;
&amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its notarization.&lt;br /&gt;
Given a proposed &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
a replica will verify a number of conditions,&lt;br /&gt;
and if these tests pass, the replica will support the notarization of the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity of the supporting replica, and&lt;br /&gt;
* the notarizing replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &lt;br /&gt;
&amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the set of identities of the &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; supporting replicas,&lt;br /&gt;
* an aggregation of the &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; signatures on the message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Each replica will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
as soon as it obtains a notarized block of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and will not subsequently notarize any other blocks at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Finalization==&lt;br /&gt;
&lt;br /&gt;
There may be more than one &lt;br /&gt;
notarized block at a given height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
However, if a block is &amp;lt;b&amp;gt;finalized&amp;lt;/b&amp;gt;, then we can be sure that there&lt;br /&gt;
is no other notarized block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;finalization invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a block to become finalized, &lt;br /&gt;
&amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its finalization.&lt;br /&gt;
Recall that round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; ends for a replica when &lt;br /&gt;
it obtains a notarized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At that point in time, such a replica will &lt;br /&gt;
check if it supported the notarization of any block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
other than block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
If not, the replica will support the finalization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
by broadcasting a &lt;br /&gt;
&amp;lt;b&amp;gt;finalization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A finalization share has exactly  the same format as a notarization share&lt;br /&gt;
(but is tagged in such a way notarization shares&lt;br /&gt;
and finalization shares cannot be confused with one another).&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; finalization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;finalization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
which has exactly the same format as a notarization.&lt;br /&gt;
&lt;br /&gt;
One can easily see that the logic for finalizing blocks&lt;br /&gt;
implies that the finalization invariant must hold.&lt;br /&gt;
Here is a proof:&lt;br /&gt;
# Suppose that the number of corrupt parties is exactly &amp;lt;math&amp;gt;f^* \le f &amp;lt; n/3&amp;lt;/math&amp;gt;.&lt;br /&gt;
# If a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is finalized, then its finalization must have been supported by a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (by the security property for aggregate signatures). &lt;br /&gt;
# If another block &amp;lt;math&amp;gt;B&#039; \ne B&amp;lt;/math&amp;gt; were notarized, then its notarization must have been supported by a set &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (again, by the security property for aggregate signatures).&lt;br /&gt;
# The sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; are disjoint (by the finalization logic).&lt;br /&gt;
# Therefore, &amp;lt;math&amp;gt;n-f^* \ge |S| + |S&#039;| \ge 2 (n-f-f^*)&amp;lt;/math&amp;gt;, which implies &amp;lt;math&amp;gt;n \le 3f&amp;lt;/math&amp;gt;, a contradiction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One consequence of the finalization invariant is the following.&lt;br /&gt;
Suppose one replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
and that another replica sees a finalized block &lt;br /&gt;
&amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&#039; \le h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the finalization invariant implies that the path in the tree of notarized blocks&lt;br /&gt;
ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; is a prefix of the path ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
(if not, then there would be two notarized blocks at height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt;,&lt;br /&gt;
contradicting the finalization invariant).   &lt;br /&gt;
Thus, whenever replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
it may view all ancestors of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; as being &lt;br /&gt;
&amp;lt;b&amp;gt;implicitly finalized&amp;lt;/b&amp;gt;, and because of the&lt;br /&gt;
finalization invariant, the &amp;lt;b&amp;gt;safety property&amp;lt;/b&amp;gt; is&lt;br /&gt;
guaranteed to hold for these (explicitly and implicitly) finalized blocks.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=232</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=232"/>
		<updated>2021-11-05T21:59:21Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; .&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
&lt;br /&gt;
When the network is timely, &lt;br /&gt;
the message complexity in a given round of the IC consensus protocol is &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
with overwhelming probability. &lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation via PoPs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Block making.&amp;lt;/b&amp;gt;&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Notarization.&amp;lt;/b&amp;gt;&lt;br /&gt;
A block is only added to the tree of blocks when it becomes &lt;br /&gt;
&amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, &lt;br /&gt;
&amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its notarization.&lt;br /&gt;
Given a proposed &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
a replica will verify a number of conditions,&lt;br /&gt;
and if these tests pass, the replica will support the notarization of the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity of the supporting replica, and&lt;br /&gt;
* the notarizing replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &lt;br /&gt;
&amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the set of identities of the &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; supporting replicas,&lt;br /&gt;
* an aggregation of the &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; signatures on the message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Each replica will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
as soon as it obtains a notarized block of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and will not subsequently notarize any other blocks at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Finalization.&amp;lt;/b&amp;gt;&lt;br /&gt;
There may be more than one &lt;br /&gt;
notarized block at a given height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
However, if a block is &amp;lt;b&amp;gt;finalized&amp;lt;/b&amp;gt;, then we can be sure that there&lt;br /&gt;
is no other notarized block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;finalization invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a block to become finalized, &lt;br /&gt;
&amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas must support its finalization.&lt;br /&gt;
Recall that round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; ends for a replica when &lt;br /&gt;
it obtains a notarized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At that point in time, such a replica will &lt;br /&gt;
check if it supported the notarization of any block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
other than block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
If not, the replica will support the finalization of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
by broadcasting a &lt;br /&gt;
&amp;lt;b&amp;gt;finalization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A finalization share has exactly  the same format as a notarization share&lt;br /&gt;
(but is tagged in such a way notarization shares&lt;br /&gt;
and finalization shares cannot be confused with one another).&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; finalization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;finalization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
which has exactly the same format as a notarization.&lt;br /&gt;
&lt;br /&gt;
One can easily see that the logic for finalizing blocks&lt;br /&gt;
implies that the finalization invariant must hold.&lt;br /&gt;
Here is a proof:&lt;br /&gt;
# Suppose that the number of corrupt parties is exactly &amp;lt;math&amp;gt;f^* \le f &amp;lt; n/3&amp;lt;/math&amp;gt;.&lt;br /&gt;
# If a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is finalized, then its finalization must have been supported by a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (by the security property for aggregate signatures). &lt;br /&gt;
# If another block &amp;lt;math&amp;gt;B&#039; \ne B&amp;lt;/math&amp;gt; were notarized, then its notarization must have been supported by a set &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (again, by the security property for aggregate signatures).&lt;br /&gt;
# The sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; are disjoint (by the finalization logic).&lt;br /&gt;
# Therefore, &amp;lt;math&amp;gt;n-f^* \ge |S| + |S&#039;| \ge 2 (n-f-f^*)&amp;lt;/math&amp;gt;, which implies &amp;lt;math&amp;gt;n \le 3f&amp;lt;/math&amp;gt;, a contradiction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One consequence of the finalization invariant is the following.&lt;br /&gt;
Suppose one replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
and that another replica sees a finalized block &lt;br /&gt;
&amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&#039; \le h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the finalization invariant implies that the path in the tree of notarized blocks&lt;br /&gt;
ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; is a prefix of the path ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
(if not, then there would be two notarized blocks at height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt;,&lt;br /&gt;
contradicting the finalization invariant).   &lt;br /&gt;
Thus, whenever replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
it may view all ancestors of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; as being &lt;br /&gt;
&amp;lt;b&amp;gt;implicitly finalized&amp;lt;/b&amp;gt;, and because of the&lt;br /&gt;
finalization invariant, the &amp;lt;b&amp;gt;safety property&amp;lt;/b&amp;gt; is&lt;br /&gt;
guaranteed to hold for these (explicitly and implicitly) finalized blocks.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=231</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=231"/>
		<updated>2021-11-05T20:13:32Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; .&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
&lt;br /&gt;
When the network is timely, &lt;br /&gt;
the message complexity in a given round of the IC consensus protocol is &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
with overwhelming probability. &lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation via PoPs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Block making.&amp;lt;/b&amp;gt;&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity &amp;lt;math&amp;gt;\textit{BMID}&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Notarization.&amp;lt;/b&amp;gt;&lt;br /&gt;
A block is only added to the tree of blocks when it becomes &amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, it must be notarized by &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas.&lt;br /&gt;
To notarize a proposed block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
a replica will verify a number of conditions,&lt;br /&gt;
and if these tests pass, the replica will notarize the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity &amp;lt;math&amp;gt;\textit{NID}&amp;lt;/math&amp;gt; of the notarizing replica, and&lt;br /&gt;
* the notarizing replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* a set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; distinct identities &amp;lt;math&amp;gt;NIDSet&amp;lt;/math&amp;gt; of the notarizing replicas, and&lt;br /&gt;
* an aggregate signature of the notarizing replicas in &amp;lt;math&amp;gt;NIDSet&amp;lt;/math&amp;gt; on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Each replica will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
as soon as it obtains a notarized block of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and will not subsequently issue any notarization shares at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Finalization.&amp;lt;/b&amp;gt;&lt;br /&gt;
There may be more than one notarized block at a given height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
However, if a block is &amp;lt;b&amp;gt;finalized&amp;lt;/b&amp;gt;, then we can be sure that there&lt;br /&gt;
is no other notarized block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;finalization invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a block to become finalized, it must be finalized by &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas.&lt;br /&gt;
Recall that round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; ends for a replica when &lt;br /&gt;
it obtains a notarized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At that point in time, such a replica will finalize &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
by broadcasting a &lt;br /&gt;
&amp;lt;b&amp;gt;finalization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; if it has not previously&lt;br /&gt;
notarized any block other than &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;. &lt;br /&gt;
A finalization share has exactly  the same format as a notarization&lt;br /&gt;
(but are tagged in such a way notarization shares&lt;br /&gt;
and finalization shares cannot be confused with one another).&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; finalization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;finalization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
which has exactly  the same format as a notarization.&lt;br /&gt;
&lt;br /&gt;
One can easily see that the logic for finalizing blocks&lt;br /&gt;
implies that the finalization invariant must hold.&lt;br /&gt;
Here is a proof:&lt;br /&gt;
# Suppose that the number of corrupt parties is exactly &amp;lt;math&amp;gt;f^* \le f &amp;lt; n/3&amp;lt;/math&amp;gt;.&lt;br /&gt;
# If a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is finalized, then it has been finalized by a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (by the security property for aggregate signatures). &lt;br /&gt;
# If another block &amp;lt;math&amp;gt;B&#039; \ne B&amp;lt;/math&amp;gt; were notarized, then it has been notarized by a set &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (again, by the security property for aggregate signatures).&lt;br /&gt;
# The sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; are disjoint (by the finalization logic).&lt;br /&gt;
# Therefore, &amp;lt;math&amp;gt;n-f^* \ge |S| + |S&#039;| \ge 2 (n-f-f^*)&amp;lt;/math&amp;gt;, which implies &amp;lt;math&amp;gt;n \le 3f&amp;lt;/math&amp;gt;, a contradiction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One consequence of the finalization invariant is the following.&lt;br /&gt;
Suppose one replica sees a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
along with a corresponding finalization for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
and that another replica sees a block &lt;br /&gt;
&amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&#039; \le h&amp;lt;/math&amp;gt;&lt;br /&gt;
along with a corresponding finalization for &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the finalization invariant implies that the path in the tree of notarized blocks&lt;br /&gt;
ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; is a prefix of the path ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
(if not, then there would be two notarized blocks at height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt;,&lt;br /&gt;
contradicting the finalization invariant).   &lt;br /&gt;
Thus, whenever replica sees a finalization for a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
it may view all ancestors of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; as being &lt;br /&gt;
&amp;lt;b&amp;gt;implicitly finalized&amp;lt;/b&amp;gt;, and because of the&lt;br /&gt;
finalization invariant, the &amp;lt;b&amp;gt;safety property&amp;lt;/b&amp;gt; is&lt;br /&gt;
guaranteed to hold for these (explicitly and implicitly) finalized blocks.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=230</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=230"/>
		<updated>2021-11-05T20:11:41Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; .&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
&lt;br /&gt;
When the network is timely, &lt;br /&gt;
the message complexity in a given round of the IC consensus protocol is &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
with overwhelming probability. &lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation via PoPs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Block making.&amp;lt;/b&amp;gt;&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity &amp;lt;math&amp;gt;\textit{BMID}&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Notarization.&amp;lt;/b&amp;gt;&lt;br /&gt;
A block is only added to the tree of blocks when it becomes &amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, it must be notarized by &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas.&lt;br /&gt;
To notarize a proposed block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
a replica will verify a number of conditions,&lt;br /&gt;
and if these tests pass, the replica will notarize the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity &amp;lt;math&amp;gt;\textit{NID}&amp;lt;/math&amp;gt; of the notarizing replica, and&lt;br /&gt;
* the notarizing replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* a set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; distinct identities &amp;lt;math&amp;gt;NIDSet&amp;lt;/math&amp;gt; of the notarizing replicas, and&lt;br /&gt;
* an aggregate signature of the notarizing replicas in &amp;lt;math&amp;gt;NIDSet&amp;lt;/math&amp;gt; on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Each replica will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
as soon as it obtains a notarized block of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and will not subsequently issue any notarization shares at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Finalization.&amp;lt;/b&amp;gt;&lt;br /&gt;
There may be more than one notarized block at a given height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
However, if a block is &amp;lt;b&amp;gt;finalized&amp;lt;/b&amp;gt;, then we can be sure that there&lt;br /&gt;
is no other notarized block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;finalization invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For a block to become finalized, it must be finalized by &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas.&lt;br /&gt;
Recall that round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; ends for a replica when &lt;br /&gt;
it obtains a notarized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At that point in time, such a replica will finalize &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
by broadcasting a &lt;br /&gt;
&amp;lt;b&amp;gt;finalization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; if it has not previously&lt;br /&gt;
issued notarized any block other than &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;. &lt;br /&gt;
A finalization share has exactly  the same format as a notarization&lt;br /&gt;
(but are tagged in such a way notarization shares&lt;br /&gt;
and finalization shares cannot be confused with one another).&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; finalization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;finalization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
which has exactly  the same format as a notarization.&lt;br /&gt;
&lt;br /&gt;
One can easily see that the logic for finalizing blocks&lt;br /&gt;
implies that the finalization invariant must hold.&lt;br /&gt;
Here is a proof:&lt;br /&gt;
# Suppose that the number of corrupt parties is exactly &amp;lt;math&amp;gt;f^* \le f &amp;lt; n/3&amp;lt;/math&amp;gt;.&lt;br /&gt;
# If a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is finalized, then it has been finalized by a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (by the security property for aggregate signatures). &lt;br /&gt;
# If another block &amp;lt;math&amp;gt;B&#039; \ne B&amp;lt;/math&amp;gt; were notarized, then it has been notarized by a set &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; of at least &amp;lt;math&amp;gt;n-f-f^*&amp;lt;/math&amp;gt; honest replicas (again, by the security property for aggregate signatures).&lt;br /&gt;
# The sets &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;S&#039;&amp;lt;/math&amp;gt; are disjoint (by the finalization logic).&lt;br /&gt;
# Therefore, &amp;lt;math&amp;gt;n-f^* \ge |S| + |S&#039;| \ge 2 (n-f-f^*)&amp;lt;/math&amp;gt;, which implies &amp;lt;math&amp;gt;n \le 3f&amp;lt;/math&amp;gt;, a contradiction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One consequence of the finalization invariant is the following.&lt;br /&gt;
Suppose one replica sees a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
along with a corresponding finalization for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
and that another replica sees a block &lt;br /&gt;
&amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&#039; \le h&amp;lt;/math&amp;gt;&lt;br /&gt;
along with a corresponding finalization for &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the finalization invariant implies that the path in the tree of notarized blocks&lt;br /&gt;
ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; is a prefix of the path ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
(if not, then there would be two notarized blocks at height &amp;lt;math&amp;gt;h&#039;&amp;lt;/math&amp;gt;,&lt;br /&gt;
contradicting the finalization invariant).   &lt;br /&gt;
Thus, whenever replica sees a finalization for a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
it may view all ancestors of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; as being &lt;br /&gt;
&amp;lt;b&amp;gt;implicitly finalized&amp;lt;/b&amp;gt;, and because of the&lt;br /&gt;
finalization invariant, the &amp;lt;b&amp;gt;safety property&amp;lt;/b&amp;gt; is&lt;br /&gt;
guaranteed to hold for these (explicitly and implicitly) finalized blocks.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=180</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=180"/>
		<updated>2021-11-04T22:14:55Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; .&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
&lt;br /&gt;
When the network is timely, &lt;br /&gt;
the message complexity in a given round of the IC consensus protocol is &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
with overwhelming probability. &lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation via PoPs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Block making.&amp;lt;/b&amp;gt;&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity &amp;lt;math&amp;gt;\textit{BMID}&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Notarization.&amp;lt;/b&amp;gt;&lt;br /&gt;
A block is only added to the tree of blocks when it becomes &amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, it must be notarized by &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas.&lt;br /&gt;
To notarize a proposed block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
a replica will verify a number of conditions,&lt;br /&gt;
and if these tests pass, the replica will notarize the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity &amp;lt;math&amp;gt;\textit{NID}&amp;lt;/math&amp;gt; of the notarizing replica, and&lt;br /&gt;
* the notarizing replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* a set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; distinct identities &amp;lt;math&amp;gt;NIDSet&amp;lt;/math&amp;gt; of the notarizing replicas, and&lt;br /&gt;
* an aggregate signature of the notarizing replicas in &amp;lt;math&amp;gt;NIDSet&amp;lt;/math&amp;gt; on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Each replica will finish round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&lt;br /&gt;
as soon as it obtains a notarized block of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and will not subsequently issue any notarization shares at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Finalization.&amp;lt;/b&amp;gt;&lt;br /&gt;
There may be more than one notarized block at a given height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
However, if a block is &amp;lt;b&amp;gt;finalized&amp;lt;/b&amp;gt;, then we can be sure that there&lt;br /&gt;
is no other notarized block at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
Let us call this the &amp;lt;b&amp;gt;finalization invariant&amp;lt;/b&amp;gt;.&lt;br /&gt;
One consequence of the finalization invariant is the following.&lt;br /&gt;
Suppose one replica sees a finalized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
and that another replica sees a finalized block &lt;br /&gt;
&amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&#039; \ge h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Then the finalization invariant implies that the path in the tree of notarized blocks&lt;br /&gt;
ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is a prefix of the path ending at &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
(if not, then there would be two notarized blocks at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;,&lt;br /&gt;
contradicting the finalization invariant).   &lt;br /&gt;
&lt;br /&gt;
For a block to become finalized, it must be finalized by &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas.&lt;br /&gt;
Recall that round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; ends for a replica when &lt;br /&gt;
it obtains a notarized block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
At that point in time, such a replica will broadcast a &lt;br /&gt;
&amp;lt;b&amp;gt;finalization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; if it has not previously&lt;br /&gt;
issued a notarization share for any block other than &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;. &lt;br /&gt;
A finalization share has exactly  the same format as a notarization&lt;br /&gt;
(but are tagged in such a way notarization shares&lt;br /&gt;
and finalization shares cannot be confused with one another).&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; finalization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;finalization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
which has exactly  the same format as a notarization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
One can easily see that the logic for generating finalization shares&lt;br /&gt;
implies that the above finalization invariant must hold.&lt;br /&gt;
Here is a proof:&lt;br /&gt;
# Suppose that block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; is finalized but another block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; is also notarized.&lt;br /&gt;
# Suppose that the number of corrupt parties is exactly &amp;lt;math&amp;gt;f&#039; \le f&amp;lt;/math&amp;gt;.&lt;br /&gt;
# Let &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; be the set of honest replicas that notarized &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and let &amp;lt;math&amp;gt;N&#039;&amp;lt;/math&amp;gt; be the set of honest replicas that notarized &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;.&lt;br /&gt;
# By the security properties of aggregate signatures, each of the sets &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;N&#039;&amp;lt;/math&amp;gt; must have size at least at least &amp;lt;math&amp;gt;(2f+1)-f&#039;&amp;lt;/math&amp;gt;.&lt;br /&gt;
# A finalization on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; means a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;(2f+1)-f=f+1&amp;lt;/math&amp;gt; honest replicas issued a finalization share on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; (by the security properties of BLS signature aggregation).&lt;br /&gt;
# Each replica in &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; issued a notarization share on no other block besides &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=156</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=156"/>
		<updated>2021-11-03T22:05:57Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; .&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
&lt;br /&gt;
When the network is timely, &lt;br /&gt;
the message complexity in a given round of the IC consensus protocol is &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
with overwhelming probability. &lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation via PoPs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Block making.&amp;lt;/b&amp;gt;&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity &amp;lt;math&amp;gt;\textit{BMID}&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;.&lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Notarization.&amp;lt;/b&amp;gt;&lt;br /&gt;
A block is only added to the tree of blocks when it becomes &amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
For a block to become notarized, it must be notarized by &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; &lt;br /&gt;
distinct replicas.&lt;br /&gt;
To notarize a proposed block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
a replica will verify a number of conditions,&lt;br /&gt;
and if these tests pass, the replica will notarize the block&lt;br /&gt;
by broadcasting a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity &amp;lt;math&amp;gt;\textit{NID}&amp;lt;/math&amp;gt; of the notarizing replica, and&lt;br /&gt;
* the notarizing replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;br /&gt;
Any set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; notarization shares on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;&lt;br /&gt;
may be aggregated together to form a &amp;lt;b&amp;gt;notarization&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of&lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* a set of &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; distinct identities &amp;lt;math&amp;gt;NIDSet&amp;lt;/math&amp;gt; of the notarizing replicas, and&lt;br /&gt;
* an aggregate signature of the notarizing replicas in &amp;lt;math&amp;gt;NIDSet&amp;lt;/math&amp;gt; on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=153</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=153"/>
		<updated>2021-11-02T00:27:34Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job of the consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
such requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be periodically &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; .&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance &lt;br /&gt;
(the protocol is initialized with a bound, but will dynamically &lt;br /&gt;
adapt and increase this bound if it is too small).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or a partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,h-1&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
in this round and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block&lt;br /&gt;
and &amp;lt;i&amp;gt;some&amp;lt;/i&amp;gt; block or blocks will be added to this tree in this round.&lt;br /&gt;
&lt;br /&gt;
When the network is timely, &lt;br /&gt;
the message complexity in a given round of the IC consensus protocol is &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;&lt;br /&gt;
with overwhelming probability. &lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation via PoPs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Block making.&amp;lt;/b&amp;gt;&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, &lt;br /&gt;
* the rank of the block maker,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the block.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity &amp;lt;math&amp;gt;\textit{ID}&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the block maker&#039;s signature on a message comprising &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\textit{ID}&amp;lt;/math&amp;gt; (and  the [[registry version]] associated with height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;). &lt;br /&gt;
A block maker will broadcast its block proposal to all other replicas.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Notarization.&amp;lt;/b&amp;gt;&lt;br /&gt;
A block is only added to the tree of blocks when it becomes &amp;lt;b&amp;gt;notarized&amp;lt;/b&amp;gt;.&lt;br /&gt;
To become notarized, a block must be approved by &amp;lt;math&amp;gt;2f+1&amp;lt;/math&amp;gt; replicas.&lt;br /&gt;
To approve a proposed block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
each replica will verify a number of conditions,&lt;br /&gt;
and if these tests pass, the replica will approve the block&lt;br /&gt;
and broadcase a &amp;lt;b&amp;gt;notarization share&amp;lt;/b&amp;gt; for &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
consisting of &lt;br /&gt;
* the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the identity &amp;lt;math&amp;gt;\textit{ID}&amp;lt;/math&amp;gt; of the approving replica, and&lt;br /&gt;
* the approving replica&#039;s signature on a message comprising the hash of &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\textit{ID}&amp;lt;/math&amp;gt; (and  the [[registry version]] associated with height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;).&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=84</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=84"/>
		<updated>2021-10-14T16:48:28Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, &lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Block maker.&amp;lt;/b&amp;gt;&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the rank of the block maker.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity &amp;lt;math&amp;gt;\textit{ID}&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\textit{ID}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
XXX&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=79</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=79"/>
		<updated>2021-10-11T18:36:49Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, &lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Block maker.&amp;lt;/b&amp;gt;&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
As a block maker in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;, &lt;br /&gt;
the replica proposes a block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; &lt;br /&gt;
that to be child of a block &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt; of height &amp;lt;math&amp;gt;h-1&amp;lt;/math&amp;gt;&lt;br /&gt;
in the tree of blocks.&lt;br /&gt;
To do this, the block maker first gathers together a &amp;lt;b&amp;gt;payload&amp;lt;/b&amp;gt;&lt;br /&gt;
consisting of all transaction requests it knows about&lt;br /&gt;
(but not including those already included in payloads in blocks in the&lt;br /&gt;
path through the tree ending at &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;).&lt;br /&gt;
The block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; consists of&lt;br /&gt;
* the payload,&lt;br /&gt;
* the hash of  &amp;lt;math&amp;gt;B&#039;&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the rank of the block maker.&lt;br /&gt;
After forming the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;, the block maker forms&lt;br /&gt;
a &amp;lt;b&amp;gt;block proposal&amp;lt;/b&amp;gt;, consisting of&lt;br /&gt;
* the block &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt;,&lt;br /&gt;
* the block maker&#039;s identity &amp;lt;math&amp;gt;\textit{ID}&amp;lt;/math&amp;gt;, and&lt;br /&gt;
* the block maker&#039;s signature on &amp;lt;math&amp;gt;B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\textit{ID}&amp;lt;/math&amp;gt;.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=78</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=78"/>
		<updated>2021-10-11T13:43:26Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, &lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Block maker.&amp;lt;/b&amp;gt;&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
YYYYY&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=77</id>
		<title>The Internet Computer for Computer Scientists</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=77"/>
		<updated>2021-10-08T21:08:40Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To a first approximation, the IC (Internet Computer) is a network of  &lt;br /&gt;
[[wikipedia:state machine replication|replicated state machines]].&lt;br /&gt;
&lt;br /&gt;
Each replicated state machine comprises a &amp;lt;b&amp;gt;subnet&amp;lt;/b&amp;gt; of &amp;lt;b&amp;gt;replicas&amp;lt;/b&amp;gt;.&lt;br /&gt;
Subnets may communicate with one another,&lt;br /&gt;
but otherwise they operate (for the most part) independently of each other.&lt;br /&gt;
&lt;br /&gt;
As in any replicated state machine, a series of &amp;lt;b&amp;gt;transaction requests&amp;lt;/b&amp;gt; is processed.&lt;br /&gt;
A transaction request may come from either an external client&lt;br /&gt;
or from another state machine in the IC.&lt;br /&gt;
The replicas in a subnet must run a &amp;lt;b&amp;gt;[[wikipedia:Consensus_(computer_science)|consensus protocol]]&amp;lt;/b&amp;gt; to order the&lt;br /&gt;
incoming transaction requests, so that each replica processes the transaction requests in the same order.&lt;br /&gt;
Each replica processes the transaction requests in the agreed-upon order.&lt;br /&gt;
In processing a transaction request, each replica will update its internal &amp;lt;b&amp;gt;state&amp;lt;/b&amp;gt; &lt;br /&gt;
according to a deterministic function that maps the pair  (current state, transaction request) to a new state.&lt;br /&gt;
Because all replicas in a subnet process transaction requests in the same order, &lt;br /&gt;
their internal states will evolve over time in exactly the same way.&lt;br /&gt;
In response to processing a transaction, a subnet may also generate an outgoing message,&lt;br /&gt;
which can be sent to either an external client or to another state machine in the IC.&lt;br /&gt;
&lt;br /&gt;
The reason for using a replicated state machine, rather than just a single state machine,&lt;br /&gt;
is to achieve [[wikipedia:fault tolerance|fault tolerance]]: a subnet should continue &lt;br /&gt;
to function &amp;amp;mdash; and to function &amp;lt;i&amp;gt;correctly&amp;lt;/i&amp;gt; &amp;amp;mdash; even if some replicas are &amp;lt;b&amp;gt;faulty&amp;lt;/b&amp;gt;.&lt;br /&gt;
Generally in this area, one considers two types of replica failures: &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; and &lt;br /&gt;
&amp;lt;b&amp;gt;[[wikipedia:Byzantine_fault|Byzantine failures]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
A &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; occurs when a replica abruptly stops and does not resume. &amp;lt;b&amp;gt;Byzantine failures&amp;lt;/b&amp;gt; are failures in which a replica may deviate in an arbitrary way from its prescribed protocol. Moreover, with Byzantine failures, one or possibly several replicas may be directly under the control of a malicious adversary.&lt;br /&gt;
Of the two types of failures, Byzantine failures are potentially far more disruptive.&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines typically make assumptions&lt;br /&gt;
about &amp;lt;b&amp;gt;how many&amp;lt;/b&amp;gt; replicas may be faulty and to &amp;lt;b&amp;gt;to what degree&amp;lt;/b&amp;gt; (crash or Byzantine) they may be faulty.&lt;br /&gt;
In the IC, the assumption is that if a given subnet has &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, then less than &amp;lt;math&amp;gt;n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
of these replicas are faulty and these faults may be Byzantine.&lt;br /&gt;
(Note that the different subnets in the IC may have different sizes.)&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines also typically make&lt;br /&gt;
assumptions about the &amp;lt;b&amp;gt;communication model&amp;lt;/b&amp;gt;, which characterizes the ability of an adversary &lt;br /&gt;
to delay the delivery of messages between replicas.&lt;br /&gt;
At opposite ends of the spectrum, we have the following models:&lt;br /&gt;
* In the &amp;lt;b&amp;gt;synchronous model&amp;lt;/b&amp;gt;, there exists some known finite time bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;, such that for any message sent, the adversary can delay its delivery by at most &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
* In the &amp;lt;b&amp;gt;asynchronous model&amp;lt;/b&amp;gt;, for any message sent, the adversary can delay its delivery by any finite amount of time, so that there is no bound on the time to deliver a message; however, each message must &amp;lt;b&amp;gt;eventually&amp;lt;/b&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the replicas in an IC-subnet are typically distributed around the globe, a synchronous communication model would be highly unrealistic.&lt;br /&gt;
In this setting, the most robust model is the asynchronous model.&lt;br /&gt;
Unfortunately, there are no known consensus protocols in this model that are truly practical.&lt;br /&gt;
So like most other practical Byzantine fault tolerant systems that cannot rely on synchronous communication,&lt;br /&gt;
the IC opts for a compromise: a  &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt; communication model.&lt;br /&gt;
Such partial synchrony models can be formulated in various ways.&lt;br /&gt;
The partial synchrony assumption used by the IC says, roughly speaking,&lt;br /&gt;
that for each subnet, communication among replicas in that subnet is synchronous for short periods of time&lt;br /&gt;
every now and then;&lt;br /&gt;
moreover, the synchrony bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not need to be known in advance.&lt;br /&gt;
This partial synchrony assumption is only needed to ensure that the consensus protocol makes progress&lt;br /&gt;
(the so-called liveness property) &amp;amp;mdash; it is not needed to ensure correct behavior of consensus&lt;br /&gt;
(the so-called safety property), nor is it needed anywhere else in the IC protocol stack.&lt;br /&gt;
&lt;br /&gt;
Under the assumption of partial synchrony and Byzantine faults, it is known that our bound of &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
on the number of faults is optimal.&lt;br /&gt;
&lt;br /&gt;
Related topics:&lt;br /&gt;
* [[IC architecture overview]]&lt;br /&gt;
* [[IC canisters]]&lt;br /&gt;
* [[IC network nervous system (NNS)]]&lt;br /&gt;
* [[IC threshold signatures and distributed key generation]]&lt;br /&gt;
* [[IC crossnet communication]]&lt;br /&gt;
* [[IC catchup packages]]&lt;br /&gt;
* [[IC fault model]]&lt;br /&gt;
* [[IC tokens]]&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=76</id>
		<title>The Internet Computer for Computer Scientists</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=The_Internet_Computer_for_Computer_Scientists&amp;diff=76"/>
		<updated>2021-10-08T21:08:25Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To a first approximation, the IC (Internet Computer) is a network of  &lt;br /&gt;
[[wikipedia:state machine replication|replicated state machines]].&lt;br /&gt;
&lt;br /&gt;
Each replicated state machine comprises a &amp;lt;b&amp;gt;subnet&amp;lt;/b&amp;gt; of &amp;lt;b&amp;gt;replicas&amp;lt;/b&amp;gt;.&lt;br /&gt;
Subnets may communicate with one another,&lt;br /&gt;
but otherwise they operate (for the most part) independently of each other.&lt;br /&gt;
&lt;br /&gt;
As in any replicated state machine, a series of &amp;lt;b&amp;gt;transaction requests&amp;lt;/b&amp;gt; is processed.&lt;br /&gt;
A transaction request may come from either an external client&lt;br /&gt;
or from another state machine in the IC.&lt;br /&gt;
The replicas in a subnet must run a &amp;lt;b&amp;gt;[[wikipedia:Consensus_(computer_science)|consensus protocol]]&amp;lt;/b&amp;gt; to order the&lt;br /&gt;
incoming transaction requests, so that each replica processes the transaction requests in the same order.&lt;br /&gt;
Each replica processes the transaction requests in the agreed-upon order.&lt;br /&gt;
In processing a transaction request, each replica will update its internal &amp;lt;b&amp;gt;state&amp;lt;/b&amp;gt; &lt;br /&gt;
according to a deterministic function that maps the pair  (current state, transaction request) to a new state.&lt;br /&gt;
Because all replicas in a subnet process transaction requests in the same order, &lt;br /&gt;
their internal states will evolve over time in exactly the same way.&lt;br /&gt;
In response to processing a transaction, a subnet may also generate an outgoing message,&lt;br /&gt;
which can be sent to either an external client or to another state machine in the IC.&lt;br /&gt;
&lt;br /&gt;
The reason for using a replicated state machine, rather than just a single state machine,&lt;br /&gt;
is to achieve [[wikipedia:fault tolerance|fault tolerance]]: a subnet should continue &lt;br /&gt;
to function &amp;amp;mdash; and to function &amp;lt;i&amp;gt;correctly&amp;lt;/i&amp;gt; &amp;amp;mdash; even if some replicas are &amp;lt;b&amp;gt;faulty&amp;lt;/b&amp;gt;.&lt;br /&gt;
Generally in this area, one considers two types of replica failures: &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; and &lt;br /&gt;
&amp;lt;b&amp;gt;[[wikipedia:Byzantine_fault|Byzantine failures]]&amp;lt;/b&amp;gt;.&lt;br /&gt;
A &amp;lt;b&amp;gt;crash failure&amp;lt;/b&amp;gt; occurs when a replica abruptly stops and does not resume. &amp;lt;b&amp;gt;Byzantine failures&amp;lt;/b&amp;gt; are failures in which a replica may deviate in an arbitrary way from its prescribed protocol. Moreover, with Byzantine failures, one or possibly several replicas may be directly under the control of a malicious adversary.&lt;br /&gt;
Of the two types of failures, Byzantine failures are potentially far more disruptive.&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines typically make assumptions&lt;br /&gt;
about &amp;lt;b&amp;gt;how many&amp;lt;/b&amp;gt; replicas may be faulty and to &amp;lt;b&amp;gt;to what degree&amp;lt;/b&amp;gt; (crash or Byzantine) they may be faulty.&lt;br /&gt;
In the IC, the assumption is that if a given subnet has &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, then less than &amp;lt;math&amp;gt;n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
of these replicas are faulty and these faults may be Byzantine.&lt;br /&gt;
(Note that the different subnets in the IC may have different sizes.)&lt;br /&gt;
&lt;br /&gt;
Protocols for consensus and for implementing replicated state machines also typically make&lt;br /&gt;
assumptions about the &amp;lt;b&amp;gt;communication model&amp;lt;/b&amp;gt;, which characterizes the ability of an adversary &lt;br /&gt;
to delay the delivery of messages between replicas.&lt;br /&gt;
At opposite ends of the spectrum, we have the following models:&lt;br /&gt;
* In the &amp;lt;b&amp;gt;synchronous model&amp;lt;/b&amp;gt;, there exists some known finite time bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;, such that for any message sent, the adversary can delay its delivery by at most &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
* In the &amp;lt;b&amp;gt;asynchronous model&amp;lt;/b&amp;gt;, for any message sent, the adversary can delay its delivery by any finite amount of time, so that there is no bound on the time to deliver a message; however, each message must &amp;lt;b&amp;gt;eventually&amp;lt;/b&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since the replicas in an IC-subnet are typically distributed around the globe, a synchronous communication model would be highly unrealistic.&lt;br /&gt;
In this setting, the most robust model is the asynchronous model.&lt;br /&gt;
Unfortunately, there are no known consensus protocols in this model that are truly practical.&lt;br /&gt;
So like most other practical Byzantine fault tolerant systems that cannot rely on synchronous communication,&lt;br /&gt;
the IC opts for a compromise: a  &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt; communication model.&lt;br /&gt;
Such partial synchrony models can be formulated in various ways.&lt;br /&gt;
The partial synchrony assumption used by the IC says, roughly speaking,&lt;br /&gt;
that for each subnet, communication among replicas in that subnet is synchronous for short periods of time&lt;br /&gt;
every now and then;&lt;br /&gt;
moreover, the synchrony bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not need to be known in advance.&lt;br /&gt;
This partial synchrony assumption is only needed to ensure that the consensus protocol makes progress&lt;br /&gt;
(the so-called liveness property) &amp;amp;mdash; it is not needed to ensure correct behavior of consensus&lt;br /&gt;
(the so-called safety property), nor is it needed anywhere else in the IC protocol stack.&lt;br /&gt;
&lt;br /&gt;
Under the assumption of partial synchrony and Byzantine faults, it is known that our bound of &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt;&lt;br /&gt;
on the number of faults is optimal.&lt;br /&gt;
&lt;br /&gt;
Related topics:&lt;br /&gt;
* [[IC architecture overview]]&lt;br /&gt;
* [[IC canisters]]&lt;br /&gt;
* [[IC network nervous system (NNS)]]&lt;br /&gt;
* [[IC threshold signatures and distributed key generation]]&lt;br /&gt;
* [[IC crossnet communication]]&lt;br /&gt;
* [[IC catchup packages]]&lt;br /&gt;
* [[IC fault model]]&lt;br /&gt;
* [[IC tokens]]&lt;br /&gt;
&lt;br /&gt;
XXX&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=75</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=75"/>
		<updated>2021-10-08T21:01:36Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, &lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Block maker.&amp;lt;/b&amp;gt;&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;br /&gt;
XXX&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=74</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=74"/>
		<updated>2021-10-08T20:36:47Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, &lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Block maker.&amp;lt;/b&amp;gt;&lt;br /&gt;
Each replica may at different points in time play the role of a &amp;lt;b&amp;gt;block maker&amp;lt;/b&amp;gt;.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=73</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=73"/>
		<updated>2021-10-08T20:31:22Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, &lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
XXX&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=72</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=72"/>
		<updated>2021-10-08T20:30:50Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, &lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Random beacon.&amp;lt;/b&amp;gt;&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=71</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=71"/>
		<updated>2021-10-08T20:11:17Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, &lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
Because of the security properties of the threshold signature,&lt;br /&gt;
an adversary will not be able to predict the ranking of the replicas more than one round in advance,&lt;br /&gt;
and these rankings will effectively be as good as random.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=70</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=70"/>
		<updated>2021-10-08T20:05:52Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, &lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
The random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to derive a pseudo-random permutation on the replicas.&lt;br /&gt;
This permutation effectively assigns to each&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=69</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=69"/>
		<updated>2021-10-08T20:05:01Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, &lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies both of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
To simplify the presentation, we assume here that &amp;lt;math&amp;gt;n=3f+1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a pseudo-random process is used to assign&lt;br /&gt;
each replica a unique &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;, which is an&lt;br /&gt;
integer in the range &amp;lt;math&amp;gt;0,\ldots,&amp;lt;/math&amp;gt;.&lt;br /&gt;
This is pseudo-random process is implemented using a &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt; (see below).&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block, which will be added to the tree;&lt;br /&gt;
moreover, this will be the &amp;lt;i&amp;gt;only&amp;lt;/i&amp;gt; block added to the tree&lt;br /&gt;
and it will extend the finalized path.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned &amp;lt;b&amp;gt;random beacon&amp;lt;/b&amp;gt;.&lt;br /&gt;
The random beacon for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is a &amp;lt;math&amp;gt;(f+1)&amp;lt;/math&amp;gt;-threshold signature&lt;br /&gt;
on a message unique to height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;. &lt;br /&gt;
In each round of the protocol, each replica broadcasts its share of the beacon for&lt;br /&gt;
the next round, so that when the next round begins, all replicas should have enough shares&lt;br /&gt;
to reconstruct the beacon for that round.&lt;br /&gt;
As discussed above, the random beacon at &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to &lt;br /&gt;
assign a pseudo-random rank to each replica that will be used in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol.&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
The random beacon at height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; is used to derive a pseudo-random permutation on the replicas.&lt;br /&gt;
This permutation effectively assigns to each&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=68</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=68"/>
		<updated>2021-10-08T13:29:25Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee three properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests,&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, and&lt;br /&gt;
* &amp;lt;b&amp;gt;validity&amp;lt;/b&amp;gt;: all transaction requests satisfy some (application specific) validity condition.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies all of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
Initialization:&lt;br /&gt;
* broadcast a share of the height 1 beacon&lt;br /&gt;
* &amp;lt;math&amp;gt;D \gets \emptyset&amp;lt;/math&amp;gt; &amp;amp;mdash; &#039;&#039;the set of disqualified parties&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each height &amp;lt;math&amp;gt;h=1, 2, 3, \ldots&amp;lt;/math&amp;gt;&lt;br /&gt;
* wait for &amp;lt;math&amp;gt;f+1&amp;lt;/math&amp;gt; shares of the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
* combine these shares to obtain the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
**  &#039;&#039;this defines the rank of each replica for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TBD: finish writing high-level summary of protocol.&lt;br /&gt;
Maybe it is better to write it out more in words than dense pseudocode.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=67</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=67"/>
		<updated>2021-10-08T13:25:06Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper [https://eprint.iacr.org/2021/1330] (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee three properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests,&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, and&lt;br /&gt;
* &amp;lt;b&amp;gt;validity&amp;lt;/b&amp;gt;: all transaction requests satisfy some (application specific) validity condition.&lt;br /&gt;
The paper [https://eprint.iacr.org/2021/1330] proves that the IC consensus protocol satisfies all of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
Initialization:&lt;br /&gt;
* broadcast a share of the height 1 beacon&lt;br /&gt;
* &amp;lt;math&amp;gt;D \gets \emptyset&amp;lt;/math&amp;gt; &amp;amp;mdash; &#039;&#039;the set of disqualified parties&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each height &amp;lt;math&amp;gt;h=1, 2, 3, \ldots&amp;lt;/math&amp;gt;&lt;br /&gt;
* wait for &amp;lt;math&amp;gt;f+1&amp;lt;/math&amp;gt; shares of the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
* combine these shares to obtain the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
**  &#039;&#039;this defines the rank of each replica for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TBD: finish writing high-level summary of protocol.&lt;br /&gt;
Maybe it is better to write it out more in words than dense pseudocode.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=66</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=66"/>
		<updated>2021-10-08T13:24:37Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee three properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests,&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress, and&lt;br /&gt;
* &amp;lt;b&amp;gt;validity&amp;lt;/b&amp;gt;: all transaction requests satisfy some (application specific) validity condition.&lt;br /&gt;
The paper https://eprint.iacr.org/2021/1330 proves that the IC consensus protocol satisfies all of these properties&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
Initialization:&lt;br /&gt;
* broadcast a share of the height 1 beacon&lt;br /&gt;
* &amp;lt;math&amp;gt;D \gets \emptyset&amp;lt;/math&amp;gt; &amp;amp;mdash; &#039;&#039;the set of disqualified parties&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each height &amp;lt;math&amp;gt;h=1, 2, 3, \ldots&amp;lt;/math&amp;gt;&lt;br /&gt;
* wait for &amp;lt;math&amp;gt;f+1&amp;lt;/math&amp;gt; shares of the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
* combine these shares to obtain the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
**  &#039;&#039;this defines the rank of each replica for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TBD: finish writing high-level summary of protocol.&lt;br /&gt;
Maybe it is better to write it out more in words than dense pseudocode.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=65</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=65"/>
		<updated>2021-10-07T21:03:19Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
Initialization:&lt;br /&gt;
* broadcast a share of the height 1 beacon&lt;br /&gt;
* &amp;lt;math&amp;gt;D \gets \emptyset&amp;lt;/math&amp;gt; &amp;amp;mdash; &#039;&#039;the set of disqualified parties&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each height &amp;lt;math&amp;gt;h=1, 2, 3, \ldots&amp;lt;/math&amp;gt;&lt;br /&gt;
* wait for &amp;lt;math&amp;gt;f+1&amp;lt;/math&amp;gt; shares of the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
* combine these shares to obtain the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
**  &#039;&#039;this defines the rank of each replica for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TBD: finish writing high-level summary of protocol.&lt;br /&gt;
Maybe it is better to write it out more in words than dense pseudocode.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=64</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=64"/>
		<updated>2021-10-07T21:01:04Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
Initialization:&lt;br /&gt;
* broadcast a share of the height 1 beacon&lt;br /&gt;
* &amp;lt;math&amp;gt;D \gets \emptyset&amp;lt;/math&amp;gt; &amp;amp;mdash; &#039;&#039;the set of disqualified parties&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each height &amp;lt;math&amp;gt;h=1, 2, 3, \ldots&amp;lt;/math&amp;gt;&lt;br /&gt;
* wait for &amp;lt;math&amp;gt;f+1&amp;lt;/math&amp;gt; shares of the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
* combine these shares to obtain the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
**  &#039;&#039;this defines the rank of each replica for height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TBD: finish writing high-level summary of protocol&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=63</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=63"/>
		<updated>2021-10-07T20:44:31Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
Initialization:&lt;br /&gt;
* broadcast a share of the height 1 beacon&lt;br /&gt;
* &amp;lt;math&amp;gt;D \gets \emptyset&amp;lt;/math&amp;gt; &amp;amp;mdash; &#039;&#039;the set of disqualified parties&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each height &amp;lt;math&amp;gt;h=1, 2, 3, \ldots&amp;lt;/math&amp;gt;&lt;br /&gt;
* wait for &amp;lt;math&amp;gt;f+1&amp;lt;/math&amp;gt; shares of the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
* combine these shares to obtain the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
**  &#039;&#039;this defines the rank of each replica&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TBD: finish writing high-level summary of protocol&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=62</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=62"/>
		<updated>2021-10-07T20:43:44Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
Initialization:&lt;br /&gt;
* broadcast a share of the height 1 beacon&lt;br /&gt;
* &amp;lt;math&amp;gt;D \gets \emptyset&amp;lt;/math&amp;gt; &amp;amp;mdash; &#039;&#039;the set of disqualified parties&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each height &amp;lt;math&amp;gt;h=1, 2, 3, \ldots&amp;lt;/math&amp;gt;&lt;br /&gt;
* wait for &amp;lt;math&amp;gt;f+1&amp;lt;/math&amp;gt; shares of the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
* combine these shares to obtain the height-&amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; random beacon&lt;br /&gt;
**  &#039;&#039;this defines the rank of each replica&#039;&#039;&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=61</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=61"/>
		<updated>2021-10-07T20:39:32Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
Initialization:&lt;br /&gt;
* broadcast a share of the height 1 beacon&lt;br /&gt;
* &amp;lt;math&amp;gt;D \gets \emptyset&amp;lt;/math&amp;gt; &amp;amp;mdash; the set of disqualified parties&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each height &amp;lt;math&amp;gt;h=1, 2, 3, \ldots&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=60</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=60"/>
		<updated>2021-10-07T20:37:28Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
Initialization:&lt;br /&gt;
* broadcast a share of the height 1 beacon&lt;br /&gt;
* initialize the set of disqualified parties to &amp;lt;math&amp;gt;\emptyset&amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=59</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=59"/>
		<updated>2021-10-07T20:34:46Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; step&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=58</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=58"/>
		<updated>2021-10-07T20:25:50Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
The message complexity per round of the IC consensus protocol is typically &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt;.&lt;br /&gt;
The protocol also enjoys the property known as &amp;lt;b&amp;gt;optimistic responsiveness&amp;lt;/b&amp;gt;,&lt;br /&gt;
which means that &lt;br /&gt;
so long as the leader is honest, the protocol will proceed at the pace&lt;br /&gt;
of the actual network delay, rather than some upper bound on&lt;br /&gt;
the network delay.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=57</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=57"/>
		<updated>2021-10-07T20:06:24Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multi-signature.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multi-signatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=56</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=56"/>
		<updated>2021-10-07T20:02:30Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multisignatire.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multisignatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;br /&gt;
There are many DKG protocols in the literature.&lt;br /&gt;
The Internet Computer implements a new [[non-interactive DKG (NiDKG) protocol]].&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=55</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=55"/>
		<updated>2021-10-07T20:00:40Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multisignatire.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multisignatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS [[wikipedia:Threshold_cryptosystem|threshold signature scheme]] to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;br /&gt;
To set up such a threshold signature scheme, the Internet Computer runs a&lt;br /&gt;
[[wikipedia:Distributed_key_generation|distributed key generation (DKG)]] protocol.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=54</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=54"/>
		<updated>2021-10-07T19:57:17Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multisignatire.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;br /&gt;
&lt;br /&gt;
In addition to BLS signatures and multisignatures as discussed above,&lt;br /&gt;
the protocol makes use of a BLS threshold signature scheme to implement the &lt;br /&gt;
above-mentioned [[random beacon]].&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=53</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=53"/>
		<updated>2021-10-07T19:49:06Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;br /&gt;
These BLS signatures will be used to authenticate messages, also called &amp;lt;b&amp;gt;artifacts&amp;lt;/b&amp;gt;,&lt;br /&gt;
sent by replicas.&lt;br /&gt;
The protocol also uses the &amp;lt;b&amp;gt;signature aggregation&amp;lt;/b&amp;gt; feature of BLS signatures,&lt;br /&gt;
which allows many signatures on the same message to be aggregated into&lt;br /&gt;
a compact multisignatire.&lt;br /&gt;
FIXME: citation, discussion of rogue key attack mitigation.&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=52</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=52"/>
		<updated>2021-10-07T19:42:39Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that the network will be &amp;lt;b&amp;gt;timely&amp;lt;/b&amp;gt; periodically.&lt;br /&gt;
Somewhat more precisely, there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; such that&lt;br /&gt;
periodically all undelivered     &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=51</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=51"/>
		<updated>2021-10-07T19:35:21Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;&lt;br /&gt;
such that from time to time, &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;b&amp;gt;rounds&amp;lt;/b&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of &amp;lt;b&amp;gt;height&amp;lt;/b&amp;gt; &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;b&amp;gt;rank&amp;lt;/b&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;b&amp;gt;leader&amp;lt;/b&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=50</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=50"/>
		<updated>2021-10-07T19:34:17Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;&lt;br /&gt;
such that from time to time, &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;i&amp;gt;rounds&amp;lt;/i&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;i&amp;gt;rank&amp;lt;/i&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;i&amp;gt;leader&amp;lt;/i&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the [[wikipedia:BLS_digital_signature|BLS signature scheme]], and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
	<entry>
		<id>https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=49</id>
		<title>IC consensus layer</title>
		<link rel="alternate" type="text/html" href="https://icstaging.mywikis.net/w/index.php?title=IC_consensus_layer&amp;diff=49"/>
		<updated>2021-10-07T19:32:59Z</updated>

		<summary type="html">&lt;p&gt;VictorShoup: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process &lt;br /&gt;
transaction requests in the same order.&lt;br /&gt;
There are many protocols in the literature for this problem.&lt;br /&gt;
The IC uses a new consensus protocol, which is described here at a high level. &lt;br /&gt;
For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).&lt;br /&gt;
&lt;br /&gt;
Any secure consensus protocol should guarantee two properties, which (roughly stated) are:&lt;br /&gt;
* &amp;lt;b&amp;gt;safety&amp;lt;/b&amp;gt;: all replicas in fact agree on the same ordering of transaction requests, and&lt;br /&gt;
* &amp;lt;b&amp;gt;liveness&amp;lt;/b&amp;gt;: all replicas should make steady progress.&lt;br /&gt;
&lt;br /&gt;
The IC consensus protocol is design to be&lt;br /&gt;
* extremely simple, and&lt;br /&gt;
* robust (performance degrades gracefully when some replicas are malicious).&lt;br /&gt;
&lt;br /&gt;
As discussed [[The Internet Computer for Computer Scientists|in the introduction]], we assume&lt;br /&gt;
* a subnet of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; replicas, and&lt;br /&gt;
* at most &amp;lt;math&amp;gt;f &amp;lt; n/3&amp;lt;/math&amp;gt; of the replicas are faulty.&lt;br /&gt;
Faulty replicas may exhibit  arbitrary, malicious (i.e., Byzantine) behavior.&lt;br /&gt;
&lt;br /&gt;
We assume that communication is &amp;lt;b&amp;gt;asynchronous&amp;lt;/b&amp;gt;, with no &amp;lt;i&amp;gt;a priori&amp;lt;/i&amp;gt;&lt;br /&gt;
bound on the delay of messages sent between replicas.&lt;br /&gt;
In fact, the scheduling of message delivery may be completely under adversarial control.&lt;br /&gt;
The IC consensus protocol guarantees safety under this very weak communication assumption.&lt;br /&gt;
However, to guarantee liveness, we need to assume a form of &amp;lt;b&amp;gt;partial synchrony&amp;lt;/b&amp;gt;,&lt;br /&gt;
which (roughly stated) says that there exists a bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;&lt;br /&gt;
such that from time to time, &lt;br /&gt;
messages will be delivered within time &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt;.&lt;br /&gt;
The bound &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; does not have to be known in advance (the protocol can &lt;br /&gt;
adapt itself to an unknown &amp;lt;math&amp;gt;\Delta&amp;lt;/math&amp;gt; value).&lt;br /&gt;
Regardless of whether we are assuming an asynchronous&lt;br /&gt;
or partially synchronous network,&lt;br /&gt;
we assume that every message sent from one honest&lt;br /&gt;
party to another will &amp;lt;i&amp;gt;eventually&amp;lt;/i&amp;gt; be delivered.&lt;br /&gt;
&lt;br /&gt;
Like a number of consensus protocols,&lt;br /&gt;
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].&lt;br /&gt;
As the protocol progresses, a tree of blocks is grown,&lt;br /&gt;
starting from a special &amp;lt;i&amp;gt;genesis block&amp;lt;/i&amp;gt; that is the root of the tree.&lt;br /&gt;
Each non-genesis block in the tree contains (among other things)&lt;br /&gt;
a &amp;lt;i&amp;gt;payload&amp;lt;/i&amp;gt;, consisting of a sequence of transaction requests,&lt;br /&gt;
and a hash of the block&#039;s parent in the tree. &lt;br /&gt;
The honest replicas have a consistent view of this tree:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this tree, all the replicas have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; tree.&lt;br /&gt;
In addition, as the protocol progresses,&lt;br /&gt;
there is always a path of &amp;lt;i&amp;gt;finalized&amp;lt;/i&amp;gt; blocks in this tree.&lt;br /&gt;
Again, the honest replicas have a consistent view of this path:&lt;br /&gt;
while each replica may have a different, partial view&lt;br /&gt;
of this path, all the parties have a view of the &amp;lt;i&amp;gt;same&amp;lt;/i&amp;gt; path.&lt;br /&gt;
The transaction requests in the payloads of the blocks along this&lt;br /&gt;
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]&lt;br /&gt;
of the Internet Computer.&lt;br /&gt;
&lt;br /&gt;
The protocol proceeds in &amp;lt;i&amp;gt;rounds&amp;lt;/i&amp;gt;.&lt;br /&gt;
In round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; of the protocol,&lt;br /&gt;
one or more blocks of height &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are added to the tree.&lt;br /&gt;
That is, the blocks added in round &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; are always at a distance&lt;br /&gt;
of exactly &amp;lt;math&amp;gt;h&amp;lt;/math&amp;gt; from the root.&lt;br /&gt;
In each round, a [[random beacon]] is used to&lt;br /&gt;
generate a random permutation of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; parties,&lt;br /&gt;
so as to assign to each party a &amp;lt;i&amp;gt;rank&amp;lt;/i&amp;gt;.&lt;br /&gt;
The party of lowest rank is the &amp;lt;i&amp;gt;leader&amp;lt;/i&amp;gt; of that round.&lt;br /&gt;
When the leader is honest and the network is timely,&lt;br /&gt;
the leader will propose a block which will be added to the tree.&lt;br /&gt;
If the leader is not honest or the network is not timely,&lt;br /&gt;
some other parties of higher rank may also propose blocks,&lt;br /&gt;
and also have their blocks added to the tree.&lt;br /&gt;
In any case, the logic of the protocol gives highest priority &lt;br /&gt;
to the leader&#039;s proposed block.&lt;br /&gt;
&lt;br /&gt;
To implement the protocol, each replica is associated with a &lt;br /&gt;
public key for the BLS signature scheme, and each replica also holds&lt;br /&gt;
the corresponding secret signing key.&lt;br /&gt;
The association of replicas to public keys is maintained by the&lt;br /&gt;
[[IC network nervous system (NNS)|network nervous system (NNS) of the Internet Computer]].&lt;/div&gt;</summary>
		<author><name>VictorShoup</name></author>
	</entry>
</feed>