NEAR ホワイトペーパー

Nightshade: Near Protocol Sharding Design

Oleh Alex Skidanov and Illia Polosukhin · 2019

Sharding Basics

Sharding Basics

Let’s start with the simplest approach to sharding. In this approach instead of running one blockchain, we will run multiple, and call each such blockchain a “shard”. Each shard will have its own set of validators. Here and below we use a generic term “validator” to refer to participants that verify transactions and produce blocks, either by mining, such as in Proof of Work, or via a voting-based 1This section was previously published at https://near.ai/shard1. If you read it before, skip to the next section.

mechanism. For now let’s assume that the shards never communicate with each other. This design, though simple, is sufficient to outline some initial major challenges in sharding. 1.1 Validator partitioning and Beacon chains Say that the system comprises 10 shards. The first challenge is that with each shard having its own validators, each shard is now 10 times less secure than the entire chain. So if a non-sharded chain with X validators decides to hard-fork into a sharded chain, and splits X validators across 10 shards, each shard now only has X/10 validators, and corrupting one shard only requires corrupting 5.1% (51% / 10) of the total number of validators (see figure 1), Figure 1: Splitting the validators across shards which brings us to the second point: who chooses validators for each shard? Controlling 5.1% of validators is only damaging if all those 5.1% of validators are in the same shard. If validators can’t choose which shard they get to validate in, a participant controlling 5.1% of the validators is highly unlikely to get all their validators in the same shard, heavily reducing their ability to compromise the system. Almost all sharding designs today rely on some source of randomness to assign validators to shards. Randomness on blockchain on itself is a very challenging topic and is out of scope for this document. For now let’s assume there’s some source of randomness we can use. We will cover validators assignment in more detail in section 2.1. Both randomness and validator assignment require computation that is not specific to any particular shard. For that computation, practically all existing designs have a separate blockchain that is tasked with performing operations necessary for the maintenance of the entire network. Besides generating random

numbers and assigning validators to the shards, these operations often also include receiving updates from shards and taking snapshots of them, processing stakes and slashing in Proof-of-Stake systems, and rebalancing shards when that feature is supported. Such chain is called a Beacon chain in Ethereum, a Relay chain in PolkaDot, and the Cosmos Hub in Cosmos. Throughout this document we will refer to such chain as a Beacon chain. The existence of the Beacon chain brings us to the next interesting topic, the quadratic sharding. 1.2 Quadratic sharding Sharding is often advertised as a solution that scales infinitely with the number of nodes participating in the network operation. While it is in theory possible to design such a sharding solution, any solution that has the concept of a Beacon chain doesn’t have infinite scalability. To understand why, note that the Beacon chain has to do some bookkeeping computation, such as assigning validators to shards, or snapshotting shard chain blocks, that is proportional to the number of shards in the system. Since the Beacon chain is itself a single blockchain, with computation bounded by the computational capabilities of nodes operating it, the number of shards is naturally limited. However, the structure of a sharded network does bestow a multiplicative effect on any improvements to its nodes. Consider the case in which an arbitrary improvement is made to the efficiency of nodes in the network which will allow them faster transaction processing times. If the nodes operating the network, including the nodes in the Beacon chain, become four times faster, then each shard will be able to process four times more transactions, and the Beacon chain will be able to maintain 4 times more shards. The throughput across the system will increase by the factor of 4 × 4 = 16 — thus the name quadratic sharding. It is hard to provide an accurate measurement for how many shards are viable today, but it is unlikely that in any foreseeable future the throughput needs of blockchain users will outgrow the limitations of quadratic sharding. The sheer number of nodes necessary to operate such a volume of shards securely is likely orders of magnitude higher than the number of nodes operating all the blockchains combined today. 1.3 State sharding Up until now we haven’t defined very well what exactly is and is not separated when a network is divided into shards. Specifically, nodes in the blockchain perform three important tasks: not only do they 1) process transactions, they also 2) relay validated transactions and completed blocks to other nodes and 3) store the state and the history of the entire network ledger. Each of these three tasks imposes a growing requirement on the nodes operating the network:

  1. The necessity to process transactions requires more compute power with the increased number of transactions being processed;
  2. The necessity to relay transactions and blocks requires more network bandwidth with the increased number of transactions being relayed;
  3. The necessity to store data requires more storage as the state grows. Importantly, unlike the processing power and network, the storage requirement grows even if the transaction rate (number of transactions processed per second) remains constant. From the above list it might appear that the storage requirement would be the most pressing, since it is the only one that is being increased over time even if the number of transactions per second doesn’t change, but in practice the most pressing requirement today is the compute power. The entire state of Ethereum as of this writing is 100GB, easily manageable by most of the nodes. But the number of transactions Ethereum can process is around 20, orders of magnitude less than what is needed for many practical use cases. Zilliqa is the most well-known project that shards processing but not storage. Sharding of processing is an easier problem because each node has the entire state, meaning that contracts can freely invoke other contracts and read any data from the blockchain. Some careful engineering is needed to make sure updates from multiple shards updating the same parts of the state do not conflict. In those regards Zilliqa is taking a relatively simplistic approach2. While sharding of storage without sharding of processing was proposed, it is extremely uncommon. Thus in practice sharding of storage, or State Sharding, almost always implies sharding of processing and sharding of network. Practically, under State Sharding the nodes in each shard are building their own blockchain that contains transactions that affect only the local part of the global state that is assigned to that shard. Therefore, the validators in the shard only need to store their local part of the global state and only execute, and as such only relay, transactions that affect their part of the state. This partition linearly reduces the requirement on all compute power, storage, and network bandwidth, but introduces new problems, such as data availability and cross-shard transactions, both of which we will cover below. 1.4 Cross-shard transactions The sharding model we described so far is not a very useful, because if individual shards cannot communicate with each other, they are no better than multiple independent blockchains. Even today, when sharding is not available, there’s a huge demand for interoperability between various blockchains. Let’s for now only consider simple payment transactions, where each participant has account on exactly one shard. If one wishes to transfer money from 2Our analysis of their approach can be found here: https://medium.com/nearprotocol/ 8f9efae0ce3b

one account to another within the same shard, the transaction can be processed entirely by the validators in that shard. If, however, Alice that resides on shard

1 wants to send money to Bob who resides on shard #2, neither validators

on shard #1(they won’t be able to credit Bob’s account) nor the validators on shard #2 (they won’t be able to debit Alice’s account) can process the entire transaction. There are two families of approaches to cross-shard transactions: • Synchronous: whenever a cross-shard transaction needs to be executed, the blocks in multiple shards that contain state transition related to the transaction get all produced at the same time, and the validators of multiple shards collaborate on executing such transactions.3 • Asynchronous: a cross-shard transaction that affects multiple shards is executed in those shards asynchronously, the “Credit” shard executing its half once it has sufficient evidence that the “Debit” shard has executed its portion. This approach tends to be more prevalent due to its simplicity and ease of coordination. This system is today proposed in Cosmos, Ethereum Serenity, Near, Kadena, and others. A problem with this approach lies in that if blocks are produced independently, there’s a nonzero chance that one of the multiple blocks will be orphaned, thus making the transaction only partially applied. Consider figure 2 that depicts two shards both of which encountered a fork, and a cross-shard transaction that was recorded in blocks A and X’ correspondingly. If the chains A-B and V’-X’-Y’-Z’ end up being canonical in the corresponding shards, the transaction is fully finalized. If A’-B’-C’-D’ and V-X become canonical, then the transaction is fully abandoned, which is acceptable. But if, for example, A-B and V-X become canonical, then one part of the transaction is finalized and one is abandoned, creating an atomicity failure. We will cover how this problem is addressed in proposed protocols in the second part, when covering changes to the fork-choice rules and consensus algorithms proposed for sharded protocols. Note that communication between chains is useful outside of sharded blockchains too. Interoperability between chains is a complex problem that many projects are trying to solve. In sharded blockchains the problem is somewhat easier since the block structure and consensus are the same across shards, and there’s a beacon chain that can be used for coordination. In a sharded blockchain, however, all the shard chains are the same, while in the global blockchains ecosystem there are lots of different blockchains, with different target use cases, decentralization and privacy guarantees. Building a system in which a set of chains have different properties but use sufficiently similar consensus and block structure and have a common beacon chain could enable an ecosystem of heterogeneous blockchains that have a 3The most detailed proposal known to the authors of this document is Merge Blocks, described here: https://ethresear.ch/t/ merge-blocks-and-synchronous-cross-shard-state-execution/1240

Figure 2: Asynchronous cross-shard transactions working interoperability subsystem. Such system is unlikely to feature validator rotation, so some extra measures need to be taken to ensure security. Both Cosmos and PolkaDot are effectively such systems4 1.5 Malicious behavior In this section we will review what adversarial behavior can malicious validators exercise if they manage to corrupt a shard. We will review classic approaches to avoiding corrupting shards in section 2.1. 1.5.1 Malicious forks A set of malicious validators might attempt to create a fork. Note that it doesn’t matter if the underlying consensus is BFT or not, corrupting sufficient number of validators will always make it possible to create a fork. It is significantly more likely for more that 50% of a single shard to be corrupted, than for more than 50% of the entire network to be corrupted (we will dive deeper into these probabilities in section 2.1). As discussed in section 1.4, cross-shard transactions involve certain state changes in multiple shards, and the corresponding blocks in such shards that apply such state changes must either be all finalized (i.e. appear in the selected chains on their corresponding shards), or all be orphaned (i.e. not appear in the selected chains on their corresponding shards). Since generally the probability of shards being corrupted 4Refer to this writeup by Zaki Manian from Cosmos: https://forum.cosmos.network/ t/polkadot-vs-cosmos/1397/2 and this tweet-storm by the first author of this document: https://twitter.com/AlexSkidanov/status/1129511266660126720 for a detailed comparison of the two

is not negligible, we can’t assume that the forks won’t happen even if a byzantine consensus was reached among the shard validators, or many blocks were produced on top of the block with the state change. This problem has multiple solutions, the most common one being occasional cross-linking of the latest shard chain block to the beacon chain. The fork choice rule in the shard chains is then changed to always prefer the chain that is cross-linked, and only apply shard-specific fork-choice rule for blocks that were published since the last cross-link. 1.5.2 Approving invalid blocks A set of validators might attempt to create a block that applies the state transition function incorrectly. For example, starting with a state in which Alice has 10 tokens and Bob has 0 tokens, the block might contain a transaction that sends 10 tokens from Alice to Bob, but ends up with a state in which Alice has 0 tokens and Bob has 1000 tokens, as shown on figure 3. Figure 3: An example of an invalid block In a classic non-sharded blockchain such an attack is not possible, since all the participant in the network validate all the blocks, and the block with such an invalid state transition will be rejected by both other block producers, and the participants of the network that do not create blocks. Even if the malicious validators continue creating blocks on top of such an invalid block faster than honest validators build the correct chain, thus having the chain with the invalid block being longer, it doesn’t matter, since every participant that is using the blockchain for any purpose validates all the blocks, and discards all the blocks built on top of the invalid block. On the figure 4 there are five validators, three of whom are malicious. They created an invalid block A’, and then continued building new blocks on top of it. Two honest validators discarded A’ as invalid and were building on top

Figure 4: Attempt to create an invalid block in a non-sharded blockchain of the last valid block known to them, creating a fork. Since there are fewer validators in the honest fork, their chain is shorter. However, in classic nonsharded blockchain every participant that uses blockchain for any purpose is responsible for validating all the blocks they receive and recomputing the state. Thus any person who has any interest in the blockchain would observe that A’ is invalid, and thus also immediately discard B’, C’ and D’, as such taking the chain A-B as the current longest valid chain. In a sharded blockchain, however, no participant can validate all the transactions on all the shards, so they need to have some way to confirm that at no point in history of any shard of the blockchain no invalid block was included. Note that unlike with forks, cross-linking to the Beacon chain is not a sufficient solution, since the Beacon chain doesn’t have the capacity to validate the blocks. It can only validate that a sufficient number of validators in that shard signed the block (and as such attested to its correctness). We will discuss solutions to this problem in section 2.2 below.

シャーディングの基本

シャーディングへの最も単純なアプローチから始めましょう。このアプローチでは、代わりに 1 つの blockchain を実行する場合は、複数を実行し、そのようなそれぞれを blockchain と呼びます。 「シャード」。各シャードには独自の validator のセットがあります。ここと以下で使用します 一般用語「validator」は、トランザクションを検証する参加者を指し、 Proof of Work などのマイニング、または投票ベースのいずれかによってブロックを生成します。 1このセクションは以前 https://near.ai/shard1. で公開されたものです。以前に読んだことがある方は、 次のセクションに進んでください。

機構。ここでは、シャードがそれぞれのシャードと通信しないと仮定します。 その他。 この設計は単純ではありますが、シャーディングにおける最初の主要な課題の概要を説明するには十分です。 1.1 バリデーターのパーティショニングとビーコンチェーン システムが 10 個のシャードで構成されているとします。最初の課題は、それぞれの シャードには独自の validator があり、各シャードの安全性は 10 倍低くなります。 チェーン全体。したがって、X validators の非シャード チェーンがハードフォークすることを決定した場合 シャード チェーンに分割し、X validator を 10 個のシャードに分割します。各シャードは現在 X/10 validator しかなく、1 つのシャードを破損する場合は破損するだけで済みます。 validator の総数の 5.1% (51% / 10) (図 1 を参照)、 図1: validator をシャード間で分割する ここで 2 番目の点がわかります。各シャードの validator を選択するのは誰ですか? validator の 5.1% を制御しても、validator の 5.1% がすべて制御されている場合にのみ有害です。 同じシャード内にあります。 validator が検証するシャードを選択できない場合 では、validator の 5.1% を管理する参加者がすべてを取得できる可能性は非常に低いです。 validator が同じシャード内にあるため、侵害する能力が大幅に低下します。 システム。 今日のほぼすべてのシャーディング設計は、何らかのランダム性のソースに依存しています。 validator をシャードに割り当てます。 blockchain のランダム性自体は非常に難しいトピックであり、このドキュメントの範囲外です。今のところ、あると仮定しましょう 使用できるランダム性のソース。 validator の課題については、 詳細についてはセクション 2.1 を参照してください。 ランダム性と validator 割り当ての両方で、次のような計算が必要です。 特定のシャードに固有です。その計算では、事実上すべての既存の 設計には、操作の実行を担当する別の blockchain があります。 ネットワーク全体のメンテナンスに必要です。ランダムに生成するだけでなく、番号を付けてシャードに validator を割り当てると、これらの操作は多くの場合、 シャードからの更新の受信とそれらのスナップショットの取得、処理が含まれます。 Proof-of-Stake システムでのステークとスラッシュ、およびその際のシャードのリバランス 機能がサポートされています。このようなチェーンは、Ethereum ではビーコン チェーン、リレーと呼ばれます。 PolkaDot のチェーンと Cosmos の Cosmos ハブ。 このドキュメントでは、このようなチェーンをビーコン チェーンと呼びます。 ビーコン チェーンの存在は、次の興味深いトピックにつながります。 二次シャーディング。 1.2 二次シャーディング シャーディングは、数に応じて無限に拡張できるソリューションとして宣伝されることがよくあります。 ネットワーク操作に参加しているノードの数。理論的には可能ですが、 このようなシャーディング ソリューション、ビーコンの概念を持つソリューションを設計する チェーンには無限の拡張性はありません。その理由を理解するには、ビーコンが チェーンは、validators を割り当てるなど、何らかの簿記計算を行う必要があります。 シャード、またはシャード チェーン ブロックのスナップショット。これは数に比例します。 システム内のシャードの数。ビーコン チェーン自体は単一の blockchain であるため、 計算は、それを操作するノードの計算能力によって制限されます。 シャードの数は当然限られています。 ただし、シャード化されたネットワークの構造により、乗算的な効果が得られます。 ノードの改善に影響します。任意の ネットワーク内のノードの効率が向上し、 トランザクション処理時間が短縮されます。 ビーコン チェーン内のノードを含め、ネットワークを運用しているノードが、 4 倍高速になると、各シャードは 4 倍多く処理できるようになります トランザクションが増加すると、ビーコン チェーンは 4 倍のシャードを維持できるようになります。 システム全体のスループットは 4 × 4 = 16 倍に増加します — したがって、二次シャーディングという名前が付けられます。 シャードの数を正確に測定することは困難です 現在は実行可能ですが、予見可能な将来にスループットが向上する可能性は低いです。 blockchain ユーザーのニーズは二次シャーディングの制限を超えるでしょう。 このような大量のシャードを安全に運用するには膨大な数のノードが必要です これは、すべてのノードを実行しているノードの数よりも桁違いに多い可能性があります。 今日はblockchainが結合されました。 1.3 状態シャーディング これまで、正確に何が分離され、何が分離されないのかをあまり明確に定義できませんでした ネットワークがシャードに分割されるとき。具体的には、blockchain 内のノード 3 つの重要なタスクを実行します。1) トランザクションを処理するだけでなく、 また、2) 検証されたトランザクションと完了したブロックを他のノードに中継する、および 3) ネットワーク台帳全体の状態と履歴を保存します。この3つそれぞれが タスクにより、ネットワークを運用するノードに対する要件が増大します。1. トランザクションを処理する必要があるため、より多くの計算能力が必要になります。 処理されるトランザクション数の増加。 2. トランザクションとブロックを中継する必要があるため、中継されるトランザクション数の増加に伴い、より多くのネットワーク帯域幅が必要になります。 3. データを保存する必要があるため、状態が大きくなるにつれて、より多くのストレージが必要になります。重要なのは、処理能力やネットワークとは異なり、ストレージ要件はトランザクション レート (処理されるトランザクションの数) に関係なく増加することです。 1 秒あたり) は一定のままです。 上記のリストから、ストレージ要件は次のように見えるかもしれません。 時間の経過とともに増加する唯一のものであるため、最も差し迫ったもの たとえ 1 秒あたりのトランザクション数が変わらなかったとしても、実際には 今日最も差し迫った要件は計算能力です。全体の状態 この記事の執筆時点では Ethereum は 100 GB で、ほとんどのノードで簡単に管理できます。 ただし、Ethereum が処理できるトランザクションの数は約 20、つまり注文数です。 多くの実際の使用例に必要な大きさよりも小さい。 Zilliqa は、処理をシャード化しますが、ストレージはシャード化しない最もよく知られたプロジェクトです。 処理のシャーディングは、各ノードが全体を持っているため、より簡単な問題です。 状態。コントラクトが自由に他のコントラクトを呼び出し、任意のデータを読み取ることができることを意味します。 blockchain から。確実に更新するには慎重なエンジニアリングが必要です 複数のシャードから状態の同じ部分を更新しても競合しません。で これらに関して、Zilliqa は比較的単純なアプローチを採用しています2。 処理をシャーディングせずにストレージをシャーディングすることが提案されましたが、 極めて珍しい。したがって、実際にはストレージのシャーディング、つまり状態シャーディングでは、 ほとんどの場合、処理のシャーディングとネットワークのシャーディングを意味します。 実際には、状態シャーディングの下で、各シャード内のノードがそれぞれのノードを構築します。 のローカル部分のみに影響を与えるトランザクションを含む独自の blockchain そのシャードに割り当てられているグローバル状態。 したがって、validator は シャードはグローバル状態のローカル部分を保存し、実行するだけで済みます。 したがって、中継されるのは、州の一部に影響を与えるトランザクションのみです。これ パーティションは、すべての計算能力、ストレージ、およびストレージの要件を直線的に削減します。 ネットワーク帯域幅は増加しますが、データの可用性やデータの可用性などの新たな問題が生じます。 クロスシャード トランザクションについては、以下で説明します。 1.4 クロスシャードトランザクション これまで説明したシャーディング モデルはあまり役に立ちません。 シャードは相互に通信できません。複数のシャードと同等です。 独立したblockchain。シャーディングが利用できない現在でも、 さまざまな blockchain 間の相互運用性に対する大きな需要があります。 ここでは、各参加者が 1 つのシャードにのみアカウントを持っている単純な支払いトランザクションのみを考えてみましょう。から送金したい場合は、 2彼らのアプローチに関する当社の分析はここでご覧いただけます: https://medium.com/nearprotocol/ 8f9efae0ce3b同じシャード内のアカウント間でトランザクションを処理できます。 完全にそのシャード内の validator によって行われます。ただし、シャードに存在するアリスの場合は、

1 は、validators ではなく、シャード #2 に存在するボブに送金したいと考えています。

シャード #1 (ボブのアカウントに入金することはできません) または validator シャード #2 (アリスの口座から引き落とすことはできません) は、全体を処理できます。 取引。 クロスシャード トランザクションには 2 つのアプローチがあります。 • 同期: クロスシャードトランザクションを実行する必要があるときは常に、 に関連する状態遷移を含む複数のシャード内のブロック トランザクションはすべて同時に生成され、複数のシャードの validator が連携してそのようなトランザクションを実行します。3 • 非同期: 複数のシャードに影響を与えるクロスシャードトランザクション これらのシャード内で非同期に実行され、「Credit」シャードが実行されます。 「デビット」シャードがその部分を実行したという十分な証拠が得られたら、その半分を返します。このアプローチは、次の理由によりより普及する傾向があります。 シンプルさとコーディネートのしやすさ。このシステムは現在、Cosmos、Ethereum セレニティ、ニア、嘉手納などで提案されています。これに関する問題 このアプローチは、ブロックが独立して生成される場合、複数のブロックのうちの 1 つが孤立する可能性がゼロではないため、 トランザクションは部分的にのみ適用されます。 2 つの要素を描いた図 2 を考えてみましょう。 両方でフォークが発生したシャードとシャード間のトランザクション それはブロックAとX’に対応して記録されました。チェーンA-Bの場合 および V'-X'-Y'-Z' は、対応するシャード内で正規になります。 取引は完全に完了しました。 A'-B'-C'-D' と V-X が正規になった場合、 その後、トランザクションは完全に放棄されますが、これは許容されます。しかし、もし、 たとえば、A-B と V-X が正規になり、トランザクションの一部が終了し、もう 1 つは破棄され、アトミック性の障害が発生します。私たち 第 2 部では、フォーク選択ルールとコンセンサスの変更について説明する際に、提案されたプロトコルでこの問題がどのように対処されるかを説明します。 シャード化プロトコル用に提案されたアルゴリズム。 チェーン間の通信は、シャード化された blockchain の外部でも役立つことに注意してください。 も。チェーン間の相互運用性は、多くのプロジェクトが抱える複雑な問題です。 解決しようとしています。シャード化された blockchains では、問題は多少簡単になります。 ブロック構造とコンセンサスはシャード間で同じであり、調整に使用できるビーコン チェーンがあります。ただし、シャード化された blockchain では、 すべてのシャード チェーンは同じですが、グローバル blockchains エコシステムでは さまざまなターゲット ユースケース、分散化を伴うさまざまな blockchain が多数あります そしてプライバシーの保証。 一連のチェーンが異なるプロパティを持つシステムを構築しますが、 十分に類似したコンセンサスとブロック構造を使用し、共通のビーコン チェーンを使用すると、異種の blockchain のエコシステムが可能になります。 3 ほとんどの 詳しい 提案 知られている に の 著者 の これ 文書 です マージ ブロック、 説明した ここで: https://ethresear.ch/t/ マージブロックと同期クロスシャード状態実行/1240図2: 非同期クロスシャードトランザクション 動作中の相互運用性サブシステム。このようなシステムには validator 回転機能が搭載されていない可能性が高いため、セキュリティを確保するために追加の対策を講じる必要があります。両方 Cosmos と PolkaDot は実質的にそのようなシステムです4 1.5 悪意のある行為 このセクションでは、validator に悪意を与える可能性がある敵対的な動作を確認します。 シャードを破壊できた場合は、実行してください。古典的なアプローチを確認します セクション 2.1 でシャードの破損を避けるため。 1.5.1 悪意のあるフォーク 一連の悪意のある validator がフォークの作成を試みる可能性があります。そうではないことに注意してください 基礎となるコンセンサスがBFTであるかどうかは関係なく、十分な数が破損します validators を使用すると、常にフォークを作成できるようになります。 ネットワーク全体の 50% 以上が破損するよりも、単一のシャードの 50% 以上が破損する可能性が大幅に高くなります (後で説明します)。 これらの確率については、セクション 2.1 で詳しく説明します)。セクション 1.4 で説明したように、 クロスシャードトランザクションには、複数のシャードにおける特定の状態変化が含まれます。 このような状態変更を適用するシャード内の対応するブロックは、 すべて完了している(つまり、対応する選択されたチェーンに表示されている) シャード)、またはすべてが孤立する(つまり、対応するシャードの選択されたチェーンに表示されない)。一般的にシャードが破損する可能性が高いため、 4Zaki Manian によるCosmos の記事を参照してください: https://forum.cosmos.network/ t/polkadot-vs-cosmos/1397/2 と、この文書の最初の著者によるツイートの嵐: 詳細な比較については、https://twitter.com/AlexSkidanov/status/1129511266660126720 二人のうち

無視できるものではありません。シャード validator 間でビザンチン的な合意に達した場合、または多くのブロックが合意に達した場合でも、フォークが発生しないと想定することはできません。 状態の変化とともにブロックの上に生成されます。 この問題には複数の解決策がありますが、最も一般的な解決策は時折発生するものです。 最新のシャード チェーン ブロックをビーコン チェーンに架橋します。 フォーク シャード チェーンの選択ルールは、常に次のチェーンを優先するように変更されます。 クロスリンクされ、シャード固有のフォーク選択ルールのみをブロックに適用します。 最後の相互リンク以降に公開されました。 1.5.2 無効なブロックの承認 validator のセットは、状態遷移関数を誤って適用するブロックを作成しようとする可能性があります。たとえば、アリスがいる状態から始めます。 には token が 10 個あり、ボブには token が 0 個ある場合、ブロックには次のようなトランザクションが含まれる可能性があります。 アリスからボブに 10 token を送信しますが、最終的にはアリスが次の状態になります。 図 3 に示すように、0 token 個で、ボブの token 個は 1000 個です。 図3: 無効なブロックの例 従来の非シャード blockchain では、そのような攻撃は不可能です。 ネットワークの参加者はすべてのブロックを検証し、そのようなブロックは 無効な状態遷移は他のブロックプロデューサーの両方によって拒否されます。 ブロックを作成しないネットワークの参加者。たとえ悪意があったとしても、 validators は、そのような無効なブロックの上に、次の速度よりも速くブロックを作成し続けます。 正直な validator は正しいチェーンを構築するため、無効なチェーンが含まれます。 ブロックが長くても、すべての参加者が blockchain は、いかなる目的であっても、すべてのブロックを検証し、すべてのブロックを破棄します 無効なブロックの上に構築されます。 図 4 には 5 つの validator があり、そのうち 3 つは悪意のあるものです。彼らは 無効なブロック A’ を作成し、その上に新しいブロックを構築し続けました それの。 2 つの正直な validator は A' を無効として破棄し、その上に構築していました図4: 非シャード blockchain で無効なブロックを作成しようとしました 既知の最後の有効なブロックを抽出し、フォークを作成します。数が少ないので 正直フォークの validator のチェーンは短くなります。ただし、クラシックな非シャード blockchain では、目的を問わず blockchain を使用するすべての参加者は、 受信したすべてのブロックを検証し、状態を再計算する責任があります。 したがって、blockchain に興味がある人は誰でも、A’ に気づくでしょう。 は無効であるため、B'、C'、および D' もすぐに破棄されます。 チェーン A-B を現在最長の有効なチェーンとして指定します。 ただし、シャード化された blockchain では、すべてのシャード上のすべてのトランザクションを検証できる参加者はいないため、それを確認する何らかの方法が必要です。 blockchain のシャードの履歴のポイントに無効なブロックは含まれていませんでした。 フォークとは異なり、ビーコン チェーンには検証する能力がないため、ビーコン チェーンへのクロスリンクは十分な解決策ではないことに注意してください。 ブロック。そのシャード内に十分な数の validator が存在することのみを検証できます。 ブロックに署名しました (したがって、その正確性が証明されました)。 この問題の解決策については、以下のセクション 2.2 で説明します。

State Validity and Data Availability

State Validity and Data Availability

The core idea in sharded blockchains is that most participants operating or using the network cannot validate blocks in all the shards. As such, whenever any participant needs to interact with a particular shard they generally cannot download and validate the entire history of the shard. The partitioning aspect of sharding, however, raises a significant potential problem: without downloading and validating the entire history of a particular shard the participant cannot necessarily be certain that the state with which 5This section, except for subsection 2.5.3, was previously published at https://near.ai/ shard2. If you read it before, skip to the next section.

they interact is the result of some valid sequence of blocks and that such sequence of blocks is indeed the canonical chain in the shard. A problem that doesn’t exist in a non-sharded blockchain. We will first present a simple solution to this problem that has been proposed by many protocols and then analyze how this solution can break and what attempts have been made to address it. 2.1 Validators rotation The naive solution to state validity is shown on figure 5: let’s say we assume that the entire system has on the order of thousands validators, out of which no more than 20% are malicious or will otherwise fail (such as by failing to be online to produce a block). Then if we sample 200 validators, the probability of more than 1 3 failing for practical purposes can be assumed to be zero. Figure 5: Sampling validators 1 3 is an important threshold. There’s a family of consensus protocols, called BFT consensus protocols, that guarantees that for as long as fewer than 1 3 of participants fail, either by crashing or by acting in some way that violates the protocol, the consensus will be reached. With this assumption of honest validator percentage, if the current set of validators in a shard provides us with some block, the naive solution assumes that the block is valid and that it is built on what the validators believed to be the canonical chain for that shard when they started validating. The validators learned the canonical chain from the previous set of validators, who by the same assumption built on top of the block which was the head of the canonical chain before that. By induction the entire chain is valid, and since no set of validators at any point produced forks, the naive solution is also certain that the current chain is the only chain in the shard. See figure 6 for a visualization.

Figure 6: A blockchain with each block finalized via BFT consensus This simple solution doesn’t work if we assume that the validators can be corrupted adaptively, which is not an unreasonable assumption6. Adaptively corrupting a single shard in a system with 1000 shards is significantly cheaper than corrupting the entire system. Therefore, the security of the protocol decreases linearly with the number of shards. To have certainty in the validity of a block, we must know that at any point in history no shard in the system has a majority of validators colluding; with adaptive adversaries, we no longer have such certainty. As we discussed in section 1.5, colluding validators can exercise two basic malicious behaviors: create forks, and produce invalid blocks. Malicious forks can be addressed by blocks being cross-linked to the Beacon chain that is generally designed to have significantly higher security than the shard chains. Producing invalid blocks, however, is a significantly more challenging problem to tackle. 2.2 State Validity Consider figure 7 on which Shard #1 is corrupted and a malicious actor produces invalid block B. Suppose in this block B 1000 tokens were minted out of thin air on Alice’s account. The malicious actor then produces valid block C (in a sense that the transactions in C are applied correctly) on top of B, obfuscating the invalid block B, and initiates a cross-shard transaction to Shard #2 that transfers those 1000 tokens to Bob’s account. From this moment the improperly created tokens reside on an otherwise completely valid blockchain in Shard #2. Some simple approaches to tackle this problem are: 6Read this article for details on how adaptive corruption can be carried out: https://medium.com/nearprotocol/d859adb464c8. For more details on adaptive corruption, read https://github.com/ethereum/wiki/wiki/Sharding-FAQ# what-are-the-security-models-that-we-are-operating-under

Figure 7: A cross-shard transaction from a chain that has an invalid block 1. For validators of Shard #2 to validate the block from which the transaction is initiated. This won’t work even in the example above, since block C appears to be completely valid. 2. For validators in Shard #2 to validate some large number of blocks preceding the block from which the transaction is initiated. Naturally, for any number of blocks N validated by the receiving shard the malicious validators can create N+1 valid blocks on top of the invalid block they produced. A promising idea to resolve this issue would be to arrange shards into an undirected graph in which each shard is connected to several other shards, and only allow cross-shard transactions between neighboring shards (e.g. this is how Vlad Zamfir’s sharding essentially works7, and similar idea is used in Kadena’s Chainweb [1]). If a cross-shard transaction is needed between shards that are not neighbors, such transaction is routed through multiple shards. In this design a validator in each shard is expected to validate both all the blocks in their shard as well as all the blocks in all the neighboring shards. Consider a figure below with 10 shards, each having four neighbors, and no two shards requiring more than two hops for a cross-shard communication shown on figure 8. Shard #2 is not only validating its own blockchain, but also blockchains of all the neighbors, including Shard #1. So if a malicious actor on Shard #1 is attempting to create an invalid block B, then build block C on top of it and initiate a cross-shard transaction, such cross-shard transaction will not go through since Shard #2 will have validated the entire history of Shard #1 which will cause it to identify invalid block B. 7Read more about the design here: https://medium.com/nearprotocol/37e538177ed9

Figure 8: An invalid cross-shard transaction in chainweb-like system that will get detected While corrupting a single shard is no longer a viable attack, corrupting a few shards remains a problem. On figure 9 an adversary corrupting both Shard

1 and Shard #2 successfully executes a cross-shard transaction to Shard #3

with funds from an invalid block B: Figure 9: An invalid cross-shard transaction in chainweb-like system that will not get detected Shard #3 validates all the blocks in Shard #2, but not in Shard #1, and has no way to detect the malicious block. There are two major directions of properly solving state validity: fishermen

and cryptographic proofs of computation. 2.3 Fisherman The idea behind the first approach is the following: whenever a block header is communicated between chains for any purpose (such as cross-linking to the beacon chain, or a cross-shard transaction), there’s a period of time during which any honest validator can provide a proof that the block is invalid. There are various constructions that enable very succinct proofs that the blocks are invalid, so the communication overhead for the receiving nodes is way smaller than that of receiving a full block. With this approach for as long as there’s at least one honest validator in the shard, the system is secure. Figure 10: Fisherman This is the dominant approach (besides pretending the problem doesn’t exist) among the proposed protocols today. This approach, however, has two major disadvantages: 1. The challenge period needs to be sufficiently long for the honest validator to recognize a block was produced, download it, fully verify it, and prepare the challenge if the block is invalid. Introducing such a period would significantly slow down the cross-shard transactions. 2. The existence of the challenge protocol creates a new vector of attacks when malicious nodes spam with invalid challenges. An obvious solution to this problem is to make challengers deposit some amount of tokens that are returned if the challenge is valid. This is only a partial solution, as it might still be beneficial for the adversary to spam the system (and burn the deposits) with invalid challenges, for example to prevent the valid

challenge from a honest validator from going through. These attacks are called Grieving Attacks. See section 3.7.2 for a way to get around the latter point. 2.4 Succinct Non-interactive Arguments of Knowledge The second solution to multiple-shard corruption is to use some sort of cryptographic constructions that allow one to prove that a certain computation (such as computing a block from a set of transactions) was carried out correctly. Such constructions do exist, e.g. zk-SNARKs, zk-STARKs and a few others, and some are actively used in blockchain protocols today for private payments, most notably ZCash. The primary problem with such primitives is that they are notoriously slow to compute. E.g. Coda Protocol, that uses zk-SNARKs specifically to prove that all the blocks in the blockchain are valid, said in one of the interviews that it can take 30 seconds per transaction to create a proof (this number is probably smaller by now). Interestingly, a proof doesn’t need to be computed by a trusted party, since the proof not only attests to the validity of the computation it is built for, but to the validity of the proof itself. Thus, the computation of such proofs can be split among a set of participants with significantly less redundancy than would be necessary to perform some trustless computation. It also allows for participants who compute zk-SNARKs to run on special hardware without reducing the decentralization of the system. The challenges of zk-SNARKs, besides performance, are: 1. Dependency on less-researched and less-time-tested cryptographic primitives; 2. ”Toxic waste” — zk-SNARKs depend on a trusted setup in which a group of people performs some computation and then discards the intermediate values of that computation. If all the participants of the procedure collude and keep the intermediate values, fake proofs can be created; 3. Extra complexity introduced into the system design; 4. zk-SNARKs only work for a subset of possible computations, so a protocol with a Turing-complete smart contract language wouldn’t be able to use SNARKs to prove the validity of the chain. 2.5 Data Availability The second problem we will touch upon is data availability. Generally nodes operating a particular blockchain are separated into two groups: Full Nodes, those that download every full block and validate every transaction, and Light Nodes, those that only download block headers, and use Merkle proofs for parts of the state and transactions they are interested in, as shown on figure 11.

Figure 11: Merkle Tree Now if a majority of full nodes collude, they can produce a block, valid or invalid, and send its hash to the light nodes, but never disclose the full content of the block. There are various ways they can benefit from it. For example, consider figure 12: Figure 12: Data Availability problem There are three blocks: the previous, A, is produced by honest validators; the current, B, has validators colluding; and the next, C, will be also produced by honest validators (the blockchain is depicted in the bottom right corner). You are a merchant. The validators of the current block (B) received block A from the previous validators, computed a block in which you receive money,

and sent you a header of that block with a Merkle proof of the state in which you have money (or a Merkle proof of a valid transaction that sends the money to you). Confident the transaction is finalized, you provide the service. However, the validators never distribute the full content of the block B to anyone. As such, the honest validators of block C can’t retrieve the block, and are either forced to stall the system or to build on top of A, depriving you as a merchant of money. When we apply the same scenario to sharding, the definitions of full and light node generally apply per shard: validators in each shard download every block in that shard and validate every transaction in that shard, but other nodes in the system, including those that snapshot shard chains state into the beacon chain, only download the headers. Thus the validators in the shard are effectively full nodes for that shard, while other participants in the system, including the beacon chain, operate as light nodes. For the fisherman approach we discussed above to work, honest validators need to be able to download blocks that are cross-linked to the beacon chain. If malicious validators cross-linked a header of an invalid block (or used it to initiate a cross-shard transaction), but never distributed the block, the honest validators have no way to craft a challenge. We will cover three approaches to address this problem that complement each other. 2.5.1 Proofs of Custody The most immediate problem to be solved is whether a block is available once it is published. One proposed idea is to have so-called Notaries that rotate between shards more often than validators whose only job is to download a block and attest to the fact that they were able to download it. They can be rotated more frequently because they don’t need to download the entire state of the shard, unlike the validators who cannot be rotated frequently since they must download the state of the shard each time they rotate, as shown on figure 13. The problem with this naive approach is that it is impossible to prove later whether the Notary was or was not able to download the block, so a Notary can choose to always attest that they were able to download the block without even attempting to retrieve it. One solution to this is for Notaries to provide some evidence or to stake some amount of tokens attesting that the block was downloaded. One such solution is discussed here: https://ethresear.ch/t/ 1-bit-aggregation-friendly-custody-bonds/2236. 2.5.2 Erasure Codes When a particular light node receives a hash of a block, to increase the node’s confidence that the block is available it can attempt to download a few random pieces of the block. This is not a complete solution, since unless the light nodes collectively download the entire block the malicious block producers can choose

Figure 13: Validators need to download state and thus cannot be rotated frequently to withhold the parts of the block that were not downloaded by any light node, thus still making the block unavailable. One solution is to use a construction called Erasure Codes to make it possible to recover the full block even if only some part of the block is available, as shown on figure 14. Figure 14: Merkle tree built on top of erasure coded data Both Polkadot and Ethereum Serenity have designs around this idea that provide a way for light nodes to be reasonably confident the blocks are available. The Ethereum Serenity approach has a detailed description in [2].

2.5.3 Polkadot’s approach to data availability In Polkadot, like in most sharded solutions, each shard (called parachain) snapshots its blocks to the beacon chain (called relay chain). Say there are 2f + 1 validators on the relay chain. The block producers of the parachain blocks, called collators, once the parachain block is produced compute an erasure coded version of the block that consists of 2f +1 parts such that any f parts are sufficient to reconstruct the block. They then distribute one part to each validator on the relay chain. A particular relay chain validator would only sign on a relay chain block if they have their part for each parachain block that is snapshotted to such relay chain block. Thus, if a relay chain block has signatures from 2f + 1 validators, and for as long as no more than f of them violated the protocol, each parachain block can be reconstructed by fetching the parts from the validators that follow the protocol. See figure 15. Figure 15: Polkadot’s data availability 2.5.4 Long term data availability Note that all the approaches discussed above only attest to the fact that a block was published at all, and is available now. Blocks can later become unavailable for a variety of reasons: nodes going offline, nodes intentionally erasing historical data, and others. A whitepaper worth mentioning that addresses this issue is Polyshard [3], which uses erasure codes to make blocks available across shards even if several shards completely lose their data. Unfortunately their specific approach requires all the shards to download blocks from all other shards, which is prohibitively expensive. The long term availability is not as pressing of an issue: since no participant in the system is expected to be capable of validating all the chains in all the

shards, the security of the sharded protocol needs to be designed in such a way that the system is secure even if some old blocks in some shards become completely unavailable.

状態の有効性とデータの可用性

シャード化された blockchains の中心的な考え方は、ほとんどの参加者が操作または ネットワークを使用すると、すべてのシャード内のブロックを検証できません。このように、いつでも 参加者は通常はできない特定のシャードと対話する必要があります シャードの履歴全体をダウンロードして検証します。 ただし、シャーディングのパーティショニングの側面により、大きな可能性が高まります。 問題: 特定の履歴全体をダウンロードして検証しないと 参加者は、シャードの状態がどのような状態であるかを必ずしも確信できるわけではありません。 5このセクションは、サブセクション 2.5.3 を除き、https://near.ai/ で以前に公開されました。 シャード2。すでに読んでいる場合は、次のセクションに進んでください。

それらの相互作用は、ブロックの有効なシーケンスの結果であり、そのシーケンスは of block は確かにシャード内の正規チェーンです。そうならない問題 シャード化されていない blockchain に存在します。 まず、この問題に対して提案されている簡単な解決策を紹介します。 多くのプロトコルで解析し、このソリューションがどのように壊れるか、何が壊れるかを分析します。 それに対処する試みがなされてきました。 2.1 バリデーターのローテーション 状態の妥当性に対する素朴な解決策を図 5 に示します。 システム全体には数千個の validator があり、そのうち 悪意のあるもの、またはそうでなければ失敗するものは 20% 未満です (たとえば、 オンラインでブロックを生成します)。次に、200 validator をサンプリングすると、確率は 1つ以上の 実用的な目的での 3 つの失敗はゼロであると想定できます。 図5: validators をサンプリングしています 1 3 は重要なしきい値です。と呼ばれるコンセンサスプロトコルのファミリーがあります。 BFT コンセンサス プロトコル。1 未満である限りそれを保証します。 3の 参加者は、クラッシュするか、何らかの方法でルールに違反する動作をすることによって失敗します。 議定書では合意が得られます。 この正直な validator パーセンテージを仮定すると、現在のセットが シャード内の validators はいくつかのブロックを提供します。素朴な解決策では次のように仮定します。 ブロックが有効であり、validator が信じているものに基づいて構築されていること 検証を開始したときのそのシャードの正規チェーン。 validator さん 以前の validator セットから正規チェーンを学習しました。 正規チェーンの先頭であるブロックの上に構築された仮定 その前に。帰納法により、チェーン全体が有効になり、validator のセットがないため、 フォークが生成されたどの時点でも、単純な解決策では、現在の チェーンはシャード内の唯一のチェーンです。視覚化については、図 6 を参照してください。

図6: BFT コンセンサスを介して最終化された各ブロックを含む blockchain validator が次の可能性があると仮定すると、この単純な解決策は機能しません。 適応的に破損しますが、これは不合理な仮定ではありません6。適応的に 1,000 個のシャードがあるシステム内の 1 つのシャードを破損する方が大幅にコストが安くなります システム全体を破壊するよりも。したがって、プロトコルのセキュリティはシャードの数に応じて直線的に低下します。有効性について確実性を持たせるためには、 ブロックである場合、歴史のどの時点においても、システム内のシャードにはブロックが存在しないことを知っておく必要があります。 validator の大多数が共謀している。適応的な敵対者にとって、私たちはもはや そのような確実性。セクション 1.5 で説明したように、共謀した validator は、行使できる可能性があります。 2 つの基本的な悪意のある動作: フォークの作成と無効なブロックの生成。 悪意のあるフォークは、ブロックがビーコン チェーンにクロスリンクされることで対処できます。ビーコン チェーンは一般に、ビーコン チェーンよりも大幅に高いセキュリティを持つように設計されています。 シャードチェーン。 ただし、無効なブロックの生成はさらに重要です。 取り組むべき困難な問題。 2.2 状態の有効性 図 7 では、シャード #1 が破損し、悪意のある攻撃者によって生成されたものを考えてみましょう。 無効なブロック B。このブロック B で 1000 個の token が薄いブロックから鋳造されたとします。 アリスのアカウントで放送します。次に、悪意のある攻撃者は有効なブロック C を生成します ( C のトランザクションが正しく適用されていることを意味します)B の上に重ねて難読化します 無効なブロック B を削除し、シャード #2 へのクロスシャード トランザクションを開始します。 これら 1000 token をボブのアカウントに転送します。この瞬間から、不適切な 作成された token は、シャード #2 の完全に有効な blockchain に存在します。 この問題に対処する簡単なアプローチは次のとおりです。 6読む これ 記事 のために 詳細 に どうやって 適応的な 汚職 できる なる 運ばれた アウト: https://medium.com/nearprotocol/d859adb464c8. のために もっと見る 詳細 に 適応的な 汚職、 読む https://github.com/ethereum/wiki/wiki/Sharding-FAQ# 私たちが運用しているセキュリティモデルとは何ですか図 7: 無効なブロックを持つチェーンからのクロスシャード トランザクション 1. シャード #2 の validator について、トランザクションの送信元のブロックを検証します。 が開始されます。ブロック C があるため、上記の例でもこれは機能しません。 完全に有効であると思われます。 2. シャード #2 の validator については、トランザクションが開始されるブロックに先行する多数のブロックを検証します。当然のことながら、 受信シャードによって検証された任意の数のブロック N validators は、無効なブロックの上に N+1 個の有効なブロックを作成できます。 生産された。 この問題を解決する有望なアイデアは、シャードを配置して 各シャードが他のいくつかのシャードに接続されている無向グラフ、および 隣接するシャード間のクロスシャードトランザクションのみを許可します(例:これが方法です) Vlad Zamfir のシャーディングは基本的に機能し7、同様のアイデアが嘉手納のシャーディングでも使用されています。 チェーンウェブ [1])。シャード間でシャード間トランザクションが必要な場合は、 隣接するシャードではないため、そのようなトランザクションは複数のシャードを介してルーティングされます。このデザインでは 各シャードの validator は、シャード内のすべてのブロックの両方を検証することが期待されます 隣接するすべてのシャード内のすべてのブロックも同様です。以下の図を考えてみましょう 10 個のシャードがあり、それぞれに 4 つの隣接シャードがあり、それ以上を必要とする 2 つのシャードはありません 図 8 に示すシャード間通信の場合は 2 ホップよりも短くなります。 シャード #2 は、自身の blockchain だけでなく、次の blockchain も検証しています。 シャード #1 を含むすべての近隣者。したがって、悪意のある攻撃者がシャード #1 にいた場合、 無効なブロック B を作成し、その上にブロック C を構築しようとしています。 クロスシャードトランザクションを開始すると、そのようなクロスシャードトランザクションは実行されません シャード #2 がシャード #1 の履歴全体を検証しているため、 これにより、無効なブロック B が識別されます。 7デザインの詳細については、こちらをご覧ください: https://medium.com/nearprotocol/37e538177ed9

図 8: チェーンウェブのようなシステムにおける無効なクロスシャード トランザクションにより、 検出される 単一のシャードを破損することは実行可能な攻撃ではなくなりましたが、 シャードがほとんどないという問題が残っています。図 9 では、敵が両方のシャードを破損しています

1 とシャード #2 はシャード #3 へのクロスシャード トランザクションを正常に実行します

無効なブロック B からの資金を使用: 図9: チェーンウェブのようなシステムにおける無効なクロスシャード トランザクションにより、 検出されない シャード #3 はシャード #2 のすべてのブロックを検証しますが、シャード #1 のブロックは検証しません。 悪意のあるブロックを検出する方法はありません。 状態の妥当性を適切に解決するには、主に 2 つの方向があります。

そして暗号による計算の証明。 2.3 漁師 最初のアプローチの背後にある考え方は次のとおりです。 あらゆる目的(チェーンへのクロスリンクなど)でチェーン間で通信されます。 ビーコン チェーン、またはクロスシャード トランザクション)、次の期間があります。 正直な validator であれば、ブロックが無効であるという証拠を提供できます。そこに ブロックが存在するという非常に簡潔な証明を可能にするさまざまな構造です。 無効であるため、受信ノードの通信オーバーヘッドははるかに小さくなります。 フルブロックを受信するよりも。 このアプローチは、少なくとも 1 つの正直な validator が存在する限り、 シャード、システムは安全です。 図 10: 漁師 これは、現在提案されているプロトコルの中で (問題が存在しないふりをすることを除けば) 主流のアプローチです。 ただし、このアプローチには次の 2 つの点があります。 主な欠点: 1. 正直な validator にとって、チャレンジ期間は十分に長い必要があります ブロックが生成されたことを認識し、ダウンロードし、完全に検証し、準備する ブロックが無効な場合のチャレンジ。 このような期間を導入すると、 シャード間のトランザクションが大幅に遅くなります。 2. チャレンジプロトコルの存在が新たな攻撃ベクトルを生み出す 悪意のあるノードが無効なチャレンジでスパムを送信した場合。明らかな解決策 この問題には、挑戦者にある程度の token を預けさせる必要があります。 チャレンジが有効な場合は返されます。これは部分的な解決策にすぎません。 敵対者がシステムにスパムを送信する(そして焼き付ける)ことが依然として有益である可能性があります。 デポジット) に無効なチャレンジが含まれる場合 (たとえば、有効なチャレンジを防ぐため)正直な validator からの挑戦です。これらの攻撃は、 グリービングアタックと呼ばれます。 後者の点を回避する方法については、セクション 3.7.2 を参照してください。 2.4 知識に関する簡潔な非対話型議論 複数のシャードの破損に対する 2 番目の解決策は、特定の計算 (たとえば、 トランザクションのセットからブロックを計算するなど) は正しく実行されました。 このような構造は実際に存在します。 zk-SNARK、zk-STARK、その他いくつか、 一部は今日、プライベートな支払いのためにblockchainプロトコルで積極的に使用されています。 最も注目すべきはZCashです。このようなプリミティブの主な問題は、 計算が遅いことで有名です。例えば。 zk-SNARK を使用する Coda プロトコル 特に、blockchain 内のすべてのブロックが有効であることを証明するためであると、ある論文では述べられています。 証拠を作成するのに 1 件の取引につき 30 秒かかる可能性があるというインタビューの結果 (この数字はおそらく今ではもっと小さくなっているでしょう)。 興味深いことに、証明は信頼できる当事者によって計算される必要はありません。 この証明は、その目的で構築された計算の正当性を証明するだけでなく、 証明そのものの有効性。したがって、そのような証明の計算は分割できます。 冗長性が従来よりも大幅に低い参加者のセットの間で行われます。 トラストレス計算を実行するために必要です。参加者も可能です zk-SNARK を計算して、特殊なハードウェア上で実行するために、 システムの分散化。 zk-SNARK には、パフォーマンス以外にも次のような課題があります。 1. 研究が少なく、テストもあまり行われていない暗号プリミティブへの依存。 2. 「有毒廃棄物」 — zk-SNARK は、グループが連携する信頼できるセットアップに依存しています。 の人々が何らかの計算を実行し、中間計算を破棄します。 その計算の値。手続き参加者全員が共謀した場合 中間値を保持すると、偽の証明を作成できます。 3. システム設計に余分な複雑さが導入される。 4. zk-SNARK は可能な計算のサブセットに対してのみ機能するため、プロトコル チューリング完全な smart contract 言語では使用できません チェーンの正当性を証明するためのSNARK。 2.5 データの可用性 2 番目の問題については、データの可用性について触れます。一般にノード 特定の blockchain を操作するノードは、フル ノード、 すべての完全なブロックをダウンロードし、すべてのトランザクションを検証するものと、ライト ブロックヘッダーのみをダウンロードし、パーツにマークル証明を使用するノード 図 11 に示すように、関心のある状態とトランザクションを確認します。

図 11: マークルツリー フルノードの大多数が結託した場合、有効または無効のブロックを生成できるようになりました。 無効であり、その hash をライト ノードに送信しますが、完全な内容は決して公開しないでください ブロックの。そこから利益を得ることができるさまざまな方法があります。たとえば、 図 12 を考えてみましょう。 図 12: データの可用性の問題 3 つのブロックがあります。前の A は、正直な validators によって生成されます。 現在の B には validator が共謀しています。そして次のCも生産されます 正直なvalidatorsによるものです(blockchainは右下隅に描かれています)。 あなたは商人です。現在のブロック (B) の validator がブロックを受信しました 以前の validator から、お金を受け取るブロックを計算しました。そして、そのブロックのヘッダーを状態のマークル証明とともに送信しました。 お金を持っていること(またはお金を送金する有効な取引のマークル証明) あなたへ)。取引が完了したと確信してサービスを提供してください。 ただし、validator はブロック B の完全なコンテンツを配布することはありません。 誰でも。そのため、ブロック C の正直な validator はブロックを取得できません。 システムを停止させるか、A の上に構築することを強いられ、 お金の商人。 同じシナリオをシャーディングに適用すると、フルとシャーディングの定義は次のようになります。 ライト ノードは通常、シャードごとに適用されます: 各シャードの validators のダウンロード間隔 そのシャード内でブロックし、そのシャード内のすべてのトランザクションを検証しますが、その他の システム内のノード (スナップショット シャード チェーンの状態を含むノードも含む) ビーコン チェーンでは、ヘッダーのみをダウンロードします。したがって、シャード内の validator は次のようになります。 そのシャードのノードが効率的にフルになる一方で、システム内の他の参加者は、 ビーコンチェーンを含め、ライトノードとして動作します。 上で説明した漁師のアプローチが機能するには、正直なvalidators ビーコンチェーンにクロスリンクされたブロックをダウンロードできる必要があります。 悪意のある validator が無効なブロックのヘッダーをクロスリンクした場合 (またはそれを使用した場合) クロスシャードトランザクションを開始します)が、ブロックを配布することはありませんでした。 validator には課題を作成する方法がありません。 この問題に対処するための 3 つのアプローチを説明します。 お互いに。 2.5.1 保管証明 解決すべき最も差し迫った問題は、ブロックが一度利用できるかどうかです。 それは出版されています。 提案されたアイデアの 1 つは、いわゆる公証人を交代で配置することです。 シャード間での使用頻度は、 ブロックして、ダウンロードできたという事実を証明します。それらは可能です 状態全体をダウンロードする必要がないため、より頻繁にローテーションされます 頻繁にローテーションできない validator とは異なり、シャードの 図に示すように、シャードが回転するたびにシャードの状態をダウンロードする必要があります 13. この素朴なアプローチの問題は、後で証明することが不可能であることです。 公証人がブロックをダウンロードできたかどうかにかかわらず、公証人は ブロックをダウンロードすることなくブロックをダウンロードできたことを常に証明することを選択できます。 それを取り戻そうとしたとしても。これに対する解決策の 1 つは、公証人が提供するものです。 ブロックがあったことを証明する何らかの証拠、またはある程度の token を賭ける ダウンロードされました。そのようなソリューションの 1 つがここで説明されています: https://ethresear.ch/t/ 1 ビット アグリゲーションに優しいカストディ ボンド/2236。 2.5.2 消去コード 特定のライト ノードがブロックの hash を受信すると、ノードの ブロックが利用可能であるという確信があれば、いくつかのランダムなダウンロードを試みることができます ブロックの破片。これは完全な解決策ではありません。 悪意のあるブロック作成者が選択できるブロック全体をまとめてダウンロードする

図 13: バリデーターは状態をダウンロードする必要があるため、ローテーションできません 頻繁に ライトノードによってダウンロードされなかったブロックの部分を差し控えるため、 したがって、ブロックは引き続き使用できなくなります。 1 つの解決策は、イレイジャー コードと呼ばれる構造を使用して、それを可能にすることです。 図に示すように、ブロックの一部しか利用できない場合でも、ブロック全体を復元するには 図 14 に示します。 図 14: Merkle tree イレイジャーコーディングされたデータの上に構築 Polkadot と Ethereum Serenity は両方とも、このアイデアに基づいた設計を行っています。 ライトノードがブロックが利用可能であることを十分に確信できる方法を提供します。 Ethereum Serenity アプローチについては、[2] で詳しく説明されています。2.5.3 Polkadot のデータ可用性に対するアプローチ Polkadot では、ほとんどのシャード ソリューションと同様に、各シャード (パラチェーンと呼ばれます) がそのブロックのスナップショットをビーコン チェーン (リレー チェーンと呼ばれます) に作成します。 2f + 1があるとします。 リレーチェーン上のvalidator。パラチェーンブロックのブロックプロデューサーは、と呼ばれます コレーターは、パラチェーン ブロックが生成されると、任意の f 部分が十分になるように、2f +1 個の部分で構成されるブロックの消失符号化バージョンを計算します。 ブロックを再構築します。次に、各 validator に 1 つのパートを配布します。 リレーチェーン。特定のリレー チェーン validator はリレー チェーンにのみ署名します スナップショットが作成される各パラチェーン ブロックのパートがある場合は、ブロックします。 そんなリレーチェーンブロック。したがって、リレー チェーン ブロックに 2f + 1 からの署名がある場合、 validator 件、そのうち f 件以下がプロトコルに違反しない限り、それぞれ パラチェーン ブロックは、validators からパーツをフェッチすることで再構築できます。 プロトコルに従うもの。図 15 を参照してください。 図 15: Polkadot のデータの可用性 2.5.4 長期的なデータの可用性 上で説明したすべてのアプローチは、ブロックが すでに出版されており、現在も入手可能です。ブロックは後で使用できなくなる可能性があります さまざまな理由で: ノードがオフラインになる、ノードが意図的に履歴を消去する データ、その他。 この問題に対処する注目に値するホワイトペーパーは、Polyshard [3] です。 これは消去コードを使用して、複数のシャードが存在する場合でもブロックをまたがって利用できるようにします。 シャードはデータを完全に失います。残念ながら、彼らの具体的なアプローチには次のことが必要です すべてのシャードが他のすべてのシャードからブロックをダウンロードすることは法外です 高価な。 長期的な可用性は、参加者がいないため、それほど差し迫った問題ではありません。 システムでは、すべてのチェーンのすべてを検証できることが期待されます。

シャードの場合、シャード プロトコルのセキュリティは次のように設計する必要があります。 たとえ一部のシャード内の古いブロックが壊れたとしてもシステムが安全である方法 完全に利用不可。

Nightshade

Nightshade

3.1 From shard chains to shard chunks The sharding model with shard chains and a beacon chain is very powerful but has certain complexities. In particular, the fork choice rule needs to be executed in each chain separately, the fork choice rule in the shard chains and the beacon chain must be built differently and tested separately. In Nightshade we model the system as a single blockchain, in which each block logically contains all the transactions for all the shards, and changes the whole state of all the shards. Physically, however, no participant downloads the full state or the full logical block. Instead, each participant of the network only maintains the state that corresponds to the shards that they validate transactions for, and the list of all the transactions in the block is split into physical chunks, one chunks per shard. Under ideal conditions each block contains exactly one chunk per shard per block, which roughly corresponds to the model with shard chains in which the shard chains produce blocks with the same speed as the beacon chain. However, due to network delays some chunks might be missing, so in practice each block contains either one or zero chunks per shard. See section 3.3 for details on how blocks are produced. Figure 16: A model with shard chains on the left and with one chain having blocks split into chunks on the right

3.2 Consensus The two dominant approaches to the consensus in the blockchains today are the longest (or heaviest) chain, in which the chain that has the most work or stake used to build it is considered canonical, and BFT, in which for each block some set of validators reach a BFT consensus. In the protocols proposed recently the latter is a more dominant approach, since it provides immediate finality, while in the longest chain more blocks need to be built on top of the block to ensure the finality. Often for a meaningful security the time it takes for sufficient number of blocks to be built takes on the order of hours. Using BFT consensus on each block also has disadvantages, such as: 1. BFT consensus involves considerable amount of communication. While recent advances allow the consensus to be reached in linear time in number of participants (see e.g. [4]), it is still noticeable overhead per block; 2. It is unfeasible for all the network participants to participate in the BFT consensus per block, thus usually only a randomly sampled subset of participants reach the consensus. A randomly sampled set can be, in principle, adaptively corrupted, and a fork in theory can be created. The system either needs to be modelled to be ready for such an event, and thus still have a fork-choice rule besides the BFT consensus, or be designed to shut down in such an event. It is worth mentioning that some designs, such as Algorand [5], significantly reduce the probability of adaptive corruption. 3. Most importantly, the system stalls if 1 3 or more of all the participants are offline. Thus, any temporary network glitch or a network split can completely stall the system. Ideally the system must be able to continue to operate for as long as at least half of the participants are online (heaviest chain-based protocols continue operating even if less than half of the participants are online, but the desirability of this property is more debatable within the community). A hybrid model in which the consensus used is some sort of the heaviest chain, but some blocks are periodically finalized using a BFT finality gadget maintain the advantages of both models. Such BFT finality gadgets are Casper FFG [6] used in Ethereum 2.0 8, Casper CBC (see https://vitalik. ca/general/2018/12/05/cbc_casper.html) and GRANDPA (see https:// medium.com/polkadot-network/d08a24a021b5) used in Polkadot. Nightshade uses the heaviest chain consensus. Specifically when a block producer produces a block (see section 3.3), they can collect signatures from other block producers and validators attesting to the previous block. See section 3.8 for details how such large number of signatures is aggregated. The weight 8Also see the whiteboard session with Justin Drake for an indepth overview of Casper FFG, and how it is integrated with the GHOST heaviest chain consensus here: https://www. youtube.com/watch?v=S262StTwkmo

of a block is then the cumulative stake of all the signers whose signatures are included in the block. The weight of a chain is the sum of the block weights. On top of the heaviest chain consensus we use a finality gadget that uses the attestations to finalize the blocks. To reduce the complexity of the system, we use a finality gadget that doesn’t influence the fork choice rule in any way, and instead only introduces extra slashing conditions, such that once a block is finalized by the finality gadget, a fork is impossible unless a very large percentage of the total stake is slashed. Casper CBC is such a finality gadget, and we presently model with Casper CBC in mind. We also work on a separate BFT protocol called TxFlow. At the time of writing this document it is unclear if TxFlow will be used instead of Casper CBC. We note, however, that the choice of the finality gadget is largely orthogonal to the rest of the design. 3.3 Block production In Nightshade there are two roles: block producers and validators. At any point the system contains w block producers, w = 100 in our models, and wv validators, in our model v = 100, wv = 10, 000. The system is Proof-of-Stake, meaning that both block producers and validators have some number of internal currency (referred to as ”tokens”) locked for a duration of time far exceeding the time they spend performing their duties of building and validating the chain. As with all the Proof of Stake systems, not all the w block producers and not all the wv validators are different entities, since that cannot be enforced. Each of the w block producers and the wv validators, however, do have a separate stake. The system contains n shards, n = 1000 in our model. As mentioned in section 3.1, in Nightshade there are no shard chains, instead all the block producers and validators are building a single blockchain, that we refer to as the main chain. The state of the main chain is split into n shards, and each block producer and validator at any moment only have downloaded locally a subset of the state that corresponds to some subset of the shards, and only process and validate transactions that affect those parts of the state. To become a block producer, a participant of the network locks some large amount of tokens (a stake). The maintenance of the network is done in epochs, where an epoch is a period of time on the order of days. The participants with the w largest stakes at the beginning of a particular epoch are the block producers for that epoch. Each block producer is assigned to sw shards, (say sw = 40, which would make sww/n = 4 block producers per shard). The block producer downloads the state of the shard they are assigned to before the epoch starts, and throughout the epoch collects transactions that affect that shard, and applies them to the state. For each block b on the main chain, and for every shards s, there’s one of the assigned block producers to s who is responsible to produce the part of b related to the shard. The part of b related to shard s is called a chunk, and contains the list of the transactions for the shard to be included in b, as well as the merkle

root of the resulting state. b will ultimately only contain a very small header of the chunk, namely the merkle root of all the applied transactions (see section 3.7.1 for exact details), and the merkle root of the final state. Throughout the rest of the document we often refer to the block producer that is responsible to produce a chunk at a particular time for a particular shard as a chunk producer. Chunk producer is always one of the block producers. The block producers and the chunk producers rotate each block according to a fixed schedule. The block producers have an order and repeatedly produce blocks in that order. E.g. if there are 100 block producers, the first block producers is responsible for producing blocks 1, 101, 201 etc, the second is responsible for producing 2, 102, 202 etc). Since chunk production, unlike the block production, requires maintaining the state, and for each shard only sww/n block producers maintain the state per shard, correspondingly only those sww/n block producers rotate to create chunks. E.g. with the constants above with four block producers assigned to each shard, each block producer will be creating chunks once every four blocks. 3.4 Ensuring data availability To ensure the data availability we use an approach similar to that of Polkadot described in section 2.5.3. Once a block producer produces a chunk, they create an erasure coded version of it with an optimal (w, ⌊w/6 + 1⌋) block code of the chunk. They then send one piece of the erasure coded chunk (we call such pieces chunk parts, or just parts) to each block producer. We compute a merkle tree that contains all the parts as the leaves, and the header of each chunk contains the merkle root of such tree. The parts are sent to the validators via onepart messages. Each such message contains the chunk header, the ordinal of the part and the part contents. The message also contains the signature of the block producer who produced the chunk and the merkle path to prove that the part corresponds to the header and is produced by the proper block producer. Once a block producer receives a main chain block, they first check if they have onepart messages for each chunk included in the block. If not, the block is not processed until the missing onepart messages are retrieved. Once all the onepart messages are received, the block producer fetches the remaining parts from the peers and reconstructs the chunks for which they hold the state. The block producer doesn’t process a main chain block if for at least one chunk included in the block they don’t have the corresponding onepart message, or if for at least one shard for which they maintain the state they cannot reconstruct the entire chunk. For a particular chunk to be available it is enough that ⌊w/6⌋+1 of the block producers have their parts and serve them. Thus, for as long as the number of malicious actors doesn’t exceed ⌊w/3⌋no chain that has more than half block producers building it can have unavailable chunks.

Figure 17: Each block contains one or zero chunks per shard, and each chunk is erasure coded. Each part of the erasure coded chunk is sent to a designated block producer via a special onepart message 3.4.1 Dealing with lazy block producers If a block producer has a block for which a onepart message is missing, they might choose to still sign on it, because if the block ends up being on chain it will maximize the reward for the block producer. There’s no risk for the block producer since it is impossible to prove later that the block producer didn’t have the onepart message. To address it we make each chunk producer when creating the chunk to choose a color (red or blue) for each part of the future encoded chunk, and store the bitmask of assigned color in the chunk before it is encoded. Each onepart message then contains the color assigned to the part, and the color is used when computing the merkle root of the encoded parts. If the chunk producer deviates from the protocol, it can be easily proven, since either the merkle root will not correspond to onepart messages, or the colors in the onepart messages that correspond to the merkle root will not match the mask in the chunk. When a block producer signs on a block, they include a bitmask of all the red parts they received for the chunks included in the block. Publishing an incorrect bitmask is a slashable behavior. If a block producer hasn’t received a onepart message, they have no way of knowing the color of the message, and thus have a 50% chance of being slashed if they attempt to blidnly sign the block. 3.5 State transition application The chunk producers only choose which transactions to include in the chunk but do not apply the state transition when they produce a chunk. Correspondingly,

the chunk header contains the merkle root of the merkelized state as of before the transactions in the chunk are applied. The transactions are only applied when a full block that includes the chunk is processed. A participant only processes a block if 1. The previous block was received and processed; 2. For each chunk the participant doesn’t maintain the state for they have seen the onepart message; 3. For each chunk the participant does maintain the state for they have the full chunk. Once the block is being processed, for each shard for which the participant maintains the state for, they apply the transactions and compute the new state as of after the transactions are applied, after which they are ready to produce the chunks for the next block, if they are assigned to any shard, since they have the merkle root of the new merkelized state. 3.6 Cross-shard transactions and receipts If a transaction needs to affect more than one shard, it needs to be consecutively executed in each shard separately. The full transaction is sent to the first shard affected, and once the transaction is included in the chunk for such shard, and is applied after the chunk is included in a block, it generates a so called receipt transaction, that is routed to the next shard in which the transaction need to be executed. If more steps are required, the execution of the receipt transaction generates a new receipt transaction and so on. 3.6.1 Receipt transaction lifetime It is desirable that the receipt transaction is applied in the block that immediately follows the block in which it was generated. The receipt transaction is only generated after the previous block was received and applied by block producers that maintain the originating shard, and needs to be known by the time the chunk for the next block is produced by the block producers of the destination shard. Thus, the receipt must be communicated from the source shard to the destination shard in the short time frame between those two events. Let A be the last produced block which contains a transaction t that generates a receipt r. Let B be the next produced block (i.e. a block that has A as its previous block) that we want to contain r. Let t be in the shard a and r be in the shard b. The lifetime of the receipt, also depicted on figure 18, is the following: Producing and storing the receipts. The chunk producer cpa for shard a receives the block A, applies the transaction t and generates the receipt r. cpa then stores all such produced receipts in its internal persistent storage indexed by the source shard id.

Distributing the receipts. Once cpa is ready to produce the chunk for shard a for block B, they fetch all the receipts generated by applying the transactions from block A for shard a, and included them into the chunk for shrad a in block B. Once such chunk is generated, cpa produces its erasure coded version and all the corresponding onepart messages. cpa knows what block producers maintain the full state for which shards. For a particular block producer bp cpa includes the receipts that resulted from applying transactions in block A for shard a that have any of the shards that bp cares about as their destination in the onepart message when they distributed the chunk for shard a in block B (see figure 17, that shows receipts included in the onepart message). Receiving the receipts. Remember that the participants (both block producers and validators) do not process blocks until they have onepart messages for each chunk included in the block. Thus, by the time any particular particpiant applies the block B, they have all the onepart messages that correspond to chunks in B, and thus they have all the incoming receipts that have the shards the participant maintains state for as their destination. When applying the state transition for a particular shard, the participant apply both the receipts that they have collected for the shard in the onepart messages, as well as all the transactions included in the chunk itself. Figure 18: The lifetime of a receipt transaction 3.6.2 Handling too many receipts It is possible that the number of receipts that target a particular shard in a particular block is too large to be processed. For example, consider figure 19, in which each transaction in each shard generates a receipt that targets shard 1. By the next block the number of receipts that shard 1 needs to process is comparable to the load that all the shards combined processed while handling the previous block.

Figure 19: If all the receipts target the same shard, the shard might not have the capacity to process them To address it we use a technique similar to that used in QuarkChain 9. Specifically, for each shard the last block B and the last shard s within that block from which the receipts were applied is recorded. When the new shard is created, the receipt are applied in order first from the remaining shards in B, and then in blocks that follow B, until the new chunk is full. Under normal circumstances with a balanced load it will generally result in all the receipts being applied (and thus the last shard of the last block will be recorded for each chunk), but during times when the load is not balanced, and a particular shard receives disproportionately many receipts, this technique allows them to be processed while respecting the limits on the number of transactions included. Note that if such unbalanced load remains for a long time, the delay from the receipt creation until application can continue growing indefinitely. One way to address it is to drop any transaction that creates a receipt targeting a shard that has a processing delay that exceeds some constant (e.g. one epoch). Consider figure 20. By block B the shard 4 cannot process all the receipts, so it only processes receipts origination from up to shard 3 in block A, and records it. In block C the receipts up to shard 5 in block B are included, and then by block D the shard catches up, processing all the remaining receipts in block B and all the receipts from block C. 3.7 Chunks validation A chunk produced for a particular shard (or a shard block produced for a particular shard chain in the model with shard chains) can only be validated by the 9See the whiteboard episode with QuarkChain here: https://www.youtube.com/watch? v=opEtG6NM4x4, in which the approach to cross-shard transactions is discussed, among other things

Figure 20: Delayed receipts processing participants that maintain the state. They can be block producers, validators, or just external witnesses that downloaded the state and validate the shard in which they store assets. In this document we assume that majority of the participants cannot store the state for a large fraction of the shards. It is worth mentioning, however, that there are sharded blockchains that are designed with the assumption that most participants do have capacity to store the state for and validate most of the shards, such as QuarkChain. Since only a fraction of the participants have the state to validate the shard chunks, it is possible to adaptive corrupt just the participants that have the state, and apply an invalid state transition. Multiple sharding designs were proposed that sample validators every few days, and within a day any block in the shard chain that has more than 2/3 of signatures of the validators assigned to such shard is immediately considered final. With such approach an adaptive adversary only needs to corrupt 2n/3+1 of the validators in a shard chain to apply an invalid state transition, which, while is likely hard to pull off, is not a level of security sufficient for a public blockchain. As discussed in section 2.3, the common approach is to allow a certain window of time after a block is created for any participant that has state (whether it’s a block producer, a validator, or an external observer) to challenge its validity. Such participants are called Fishermen. For a fisherman to be able to challenge an invalid block, it must be ensured that such a block is available to them. The data availability in Nightshade is discussed in section 3.4. In Nightshade once a block is produced, the chunks were not validated by anyone but the actual chunk producer. In particular, the block producer that suggested the block naturally didn’t have the state for most of the shards, and

was not able to validate the chunks. When the next block is produced, it contains attestations (see section 3.2) of multiple block producers and validators, but since the majority of block producers and validators do not maintain state for most shards as well, a block with just one invalid chunk will collect significantly more than half of the attestations and will continue being on the heaviest chain. To address this issue, we allow any participant that maintains the state of a shard to submit a challenge on-chain for any invalid chunk produced in that shard. 3.7.1 State validity challenge Once a participant detects that a particular chunk is invalid, they need to provide a proof that the chunk is invalid. Since the majority of the network participants do not maintain the state for the shard in which the invalid chunk is produced, the proof needs to have sufficient information to confirm the block is invalid without having the state. We set a limit Ls of the amount of state (in bytes) that a single transaction can cumulatively read or write. Any transaction that touches more than Ls state is considered to be invalid. Remember from the section 3.5 that the chunk in a particular block B only contains the transactions to be applied, but not the new state root. The state root included in the chunk in block B is the state root before applying such transactions, but after applying the transactions from the last chunk in the same shard before the block B. A malicious actor that wishes to apply an invalid state transition would include an incorrect state root in block B that doesn’t correspond to the state root that results from applying the transactions in the preceding chunk. We extend the information that a chunk producer includes in the chunk. Instead of just including the state after applying all the transactions, it instead includes a state root after applying each contiguous set of transactions that collectively read and write Ls bytes of state. With this information for the fisherman to create a challenge that a state transition is applied incorrectly it is sufficient to find the first such invalid state root, and include just Ls bytes of state that are affected by the transactions between the last state root (which was valid) and the current state root with the merkle proofs. Then any participant can validate the transactions in the segment and confirm that the chunk is invalid. Similarly, if the chunk producer attempted to include transactions that read and write more than Ls bytes of state, for the challenge it is enough to include the first Ls bytes it touches with the merkle proofs, which will be enough to apply the transactions and confirm that there’s a moment when an attempt to read or write content beyond Ls bytes is made.

3.7.2 Fishermen and fast cross-shard transactions As discussed in section 2.3, once we assume that the shard chunks (or shard blocks in the model with shard chains) can be invalid and introduce a challenge period, it negatively affects the finality, and thus cross-shard communication. In particular, the destination shard of any cross-shard transction cannot be certain the originating shard chunk or block is final until the challenge period is over (see figure 21). Figure 21: Waiting for the challenge period before applying a receipt The way to address it in a way that makes the cross-shard transactions instantenious is for the destination shard to not wait for the challenge period after the source shard transaction is published, and apply the receipt transaction immediately, but then roll back the destination shard together with the source shard if later the originating chunk or block was found to be invalid (see figure 22). This applies very naturally to the Nightshade design in which the shard chains are not independent, but instead the shard chunks are all published together in the same main chain block. If any chunk is found to be invalid, the entire block with that chunk is considered invalid, and all the blocks built on top of it. See figure 23. Both of the above approaches provide atomicity assuming that the challenge period is sufficiently long. We use the latter approach since providing fast crossshard transactions under normal circumstances outweights the inconvenience of the destination shard rolling back due to an invalid state transition in one of the source shards, which is an extremely rare event. 3.7.3 Hiding validators The existence of the challenges already significantly reduces the probability of adaptive corruption, since to finalize a chunk with an invalid state transition post

Figure 22: Applying receipts immediately and rolling back the destination chain if the source chain had an invalid block Figure 23: Fisherman challenge in Nightshade the challenge period the adaptive adversary needs to corrupt all the participants that maintain the state of the shard, including all the validators. Estimating the likelihood of such an event is extremely complex, since no sharded blockchain has been live sufficiently long for any such attack to be attempted. We argue that the probability, while extremely low, is still sufficiently large for a system that is expected to execute multi-million transactions and run a world-wide financial operations. There are two main reasons for this belief: 1. Most of the validators of the Proof-of-Stake chains and miners of the

Proof-of-Work chains are primarily incentivized by the financial upside. If an adaptive adversary offers them more money then the expected return from operating honestly, it is reasonable to expect that many validators will accept the offer. 2. Many entities do validation of Proof-of-Stake chains professionally, and it is expected that a large percentage of the stake in any chain will be from such entities. The number of such entities is sufficiently small for an adaptive adversary to get to know most of them personally and have a good understanding of their inclanation to be corrupted. We take one step further in reducing the probability of the adaptive corruption by hiding which validators are assigned to which shard. The idea is remotely similar to the way Algorand [5] conceals validators. It is critical to note that even if the validators are concealed, as in Algorand or as described below, the adaptive corruption is still in theory possible. While the adaptive adversary doesn’t know the participants that will create or validate a block or a chunk, the participants themselves do know that they will perform such a task and have a cryptographic proof of it. Thus, the adversary can broadcast their intent to corrupt, and pay to any participant that will provide such a cryptographic proof. We note however, that since the adversary doesn’t know the validators that are assigned to the shard they want to corrupt, they have no other choice but to broadcast their intent to corrupt a particular shard to the entire community. At that point it is economically beneficial for any honest participant to spin up a full node that validates that shard, since there’s a high chance of an invalid block appearing in that shard, which is an opportunity to create a challenge and collect associated reward. To not reveal the validators that are assigned to a particular shard, we do the following (see figure 24): Using VRF to get the assignment. At the beginning of each epoch each validator uses a VRF to get a bitmask of the shards the validator is assigned to. The bitmask of each validator will have Sw bits (see section 3.3 for the definition of Sw). The validator then fetches the state of the corresponding shards, and during the epoch for each block received validates the chunks that correspond to the shards that the validator is assigned to. Sign on blocks instead of chunks. Since the shards assignment is concealed, the validator cannot sign on chunks. Instead it always signs on the entire block, thus not revealing what shards it validates. Specifically, when the validator receives a block and validates all the chunks, it either creates a message that attests that all the chunks in all the shards the validator is assigned to are valid (without indicating in any way what those shards are), or a message that contains a proof of an invalid state transition if any chunk is invalid. See the section 3.8 for the details on how such messages are aggregated, section 3.7.4 for the details on how to prevent validators from piggy-backing on messages from other validators, and section 3.7.5 for the details how to reward and punish validators should a successful invalid state transition challenge actually happen.

Figure 24: Concealing the validators in Nightshade 3.7.4 Commit-Reveal One of the common problems with validators is that a validator can skip downloading the state and actually validating the chunks and blocks, and instead observe the network, see what the other validators submit and repeat their messages. A validator that follows such a strategy doesn’t provide any extra security for the network, but collects rewards. A common solution for this problem is for each validator to provide a proof that they actually validated the block, for example by providing a unique trace of applying the state transition, but such proofs significantly increase the cost of validation. Figure 25: Commit-reveal

Instead we make the validators first commit to the validation result (either the message that attests to the validity of the chunks, or the proof of an invalid state transition), wait for a certain period, and only then reveal the actual validation result, as shown on figure 25. The commit period doesn’t intersect with the reveal period, and thus a lazy validator cannot copycat honest validators. Moreover, if a dishonest validator committed to a message that attests to the validity of the assigned chunks, and at least one chunk was invalid, once it is shown that the chunk is invalid the validator cannot avoid the slashing, since, as we show in section 3.7.5, the only way to not get slashed in such a situation is to present a message that contains a proof of the invalid state transition that matches the commit. 3.7.5 Handling challenges As discussed above, once a validator receives a block with an invalid chunk, they first prepare a proof of the invalid state transition (see section 3.7.1), then commit to such a proof (see 3.7.4), and after some period reveal the challenge. Once the revealed challenge is included in a block, the following happens: 1. All the state transitions that happened from the block containing the invalid chunk until the block in which the revealed challenge is included get nullyfied. The state before the block that includes the revealed challenge is considered to be the same as the state before the block that contained the invalid chunk. 2. Within a certain period of time each validator must reveal their bitmask of the shards they validate. Since the bitmask is created via a VRF, if they were assigned to the shard that had the invalid state transition, they cannot avoid revealing it. Any validator that fails to reveal the bitmask is assumed to be assigned to the shard. 3. Each validator that after such period is found to be assigned to the shard, that did commit to some validation result for the block containing the invalid chunk and that didn’t reveal the proof of invalid state transition that corresponds to their commit is slashed. 4. Each validator gets a new shards assignment, and a new epoch is scheduled to start after some time sufficient for all the validators to download the state, as shown on figure 26. Note that from the moment the validators reveal the shards they are assigned to until the new epoch starts the security of the system is reduced since the shards assignment is revealed. The participants of the network need to keep it in mind while using the network during such period. 3.8 Signature Aggregation For a system with hudreds of shards to operate securely, we want to have on the order of 10, 000 or more validators. As discussed in section 3.7, we want each

Figure 26: Handling the challenge validator to publish a commit to a certain message and a signature on average once per block. Even if the commit messages were the same, aggregating such a BLS-signature and validating it would have been prohibitively expensive. But naturally the commit and reveal messages are not the same across validators, and thus we need some way to aggregate such messages and the signatures in a way that allows for fast validation later. The specific approach we use is the following: Validators joining block producers. The block producers are known some time before the epoch starts, since they need some time to download the state before the epoch starts, and unlike the validators the block producers are not concealed. Each block producer has v validator slots. Validators submit off-chain proposals to the block producers to get included as one of their v validators. If a block producer wishes to include a validator, they submit a transaction that contains the initial off-chainrequest from the validator, and the block producer’s signature that makes the validator join the block producer. Note that the validators assigned to the block producers do not necessarily validate the same shards that the block producer produces chunks for. If a validator applied to join multiple block producers, only the transaction from the first block producer will succeed. Block producers collect commits. The block producer constantly collects the commit and reveal messages from the validators. Once a certain number of such messages are accumulated, the block producer computes a merkle tree of these messages, and sends to each validator the merkle root and the merkle path to their message. The validator validates the path and signs on the merkle root. The block producer then accumulates a BLS signature on the merkle root from the validators, and publishes only the merkle root and the accumulated signature. The block producer also signs on the validity of the multisignature using a cheap ECDSA signature. If the multisignature doesn’t match the merkle root submitted or the bitmask of the validators participating, it is a slashable behavior. When synchronizing the chain, a participant can choose to validate all the BLS signatures from the validators (which is extremely expensive since it involves aggregating validators public keys), or only

the ECDMA signatures from the block producers and rely on the fact that the block producer was not challenged and slashed. Using on-chain transactions and merkle proofs for challenges. It can be noted that there’s no value in revealing messages from validators if no invalid state transition was detected. Only the messages that contain the actual proofs of invalid state transition need to be revealed, and only for such messages it needs to be shown that they match the prior commit. The message needs to be revealed for two purposes: 1. To actually initiate the rollback of the chain to the moment before the invalid state transition (see section 3.7.5). 2. To prove that the validator didn’t attempt to attest to the validity of the invalid chunk. In either case we need to address two issues: 1. The actual commit was not included on chain, only the merkle root of the commit aggregated with other messages. The validator needs to use the merkle path provided by the block producer and their original commit to prove that they committed to the challenge. 2. It is possible that all the validators assigned to the shard with the invalid state transition happen to be assigned to corrupted block producers that are censoring them. To get around it we allow them to submit their reveals as a regular transaction on-chain and bypass the aggregation. The latter is only allowed for the proofs of invalid state transition, which are extremely rare, and thus should not result in spamming the blocks. The final issue that needs to be addressed is that the block producers can choose not to participate in messages aggregation or intentionally censor particular validators. We make it economically disadvantageous, by making the block producer reward proportional to the number of validators assigned to them. We also note that since the block producers between epochs largely intersect (since it’s always the top w participants with the highest stake), the validators can largely stick to working with the same block producers, and thus reduce the risk of getting assigned to a block producer that censored them in the past. 3.9 Snapshots Chain Since the blocks on the main chain are produced very frequently, downloading the full history might become expensive very quickly. Moreover, since every block contains a BLS signature of a large number of participants, just the aggregation of the public keys to check the signature might become prohibitively expensive as well. Finally, since in any foreseeable future Ethereum 1.0 will likely remain one of the most used blockchains, having a meaningful way to transfer assets from

Near to Ethereum is a requirement, and today verifying BLS signatures to ensure Near blocks validity on Ethereum’s side is not possible. Each block in the Nightshade main chain can optionally contain a Schnorr multisignature on the header of the last block that included such a Schnorr multisignature. We call such blocks snapshot blocks. The very first block of every epoch must be a snapshot block. While working on such a multisignature, the block producers must also accumulate the BLS signatures of the validators on the last snapshot block, and aggregate them the same way as described in section 3.8. Since the block producers set is constant throughout the epoch, validating only the first snapshot blocks in each epoch is sufficient assuming that at no point a large percentage of block producers and validators colluded and created a fork. The first block of the epoch must contain information sufficient to compute the block producers and validators for the epoch. We call the subchain of the main chain that only contains the snapshot blocks a snapshot chain. Creating a Schnorr multisignature is an interactive process, but since we only need to perform it infrequently, any, no matter how inefficient, process will suffice. The Schnorr multisignatures can be easily validated on Ethereum, thus providing crucial primitives for a secure way of performing cross-blockchain communication. To sync with the Near chain one only needs to download all the snapshot blocks and confirm that the Schnorr signatures are correct (optionally also verifying the individual BLS signatures of the validators), and then only syncing main chain blocks from the last snapshot block.

Nightshade

3.1 シャードチェーンからシャードチャンクへ シャード チェーンとビーコン チェーンを使用したシャーディング モデルは非常に強力ですが、 にはある種の複雑さがあります。特に、フォーク選択ルールを実行する必要があります。 各チェーンで個別に、シャード チェーンとビーコンでのフォーク選択ルール チェーンは別々に構築し、個別にテストする必要があります。 Nightshade では、システムを単一の blockchain としてモデル化します。 ブロックにはすべてのシャードのすべてのトランザクションが論理的に含まれており、 すべてのシャードの全体状態。ただし、物理的には、参加者は誰もダウンロードしません。 完全な状態または完全な論理ブロック。代わりに、ネットワークの各参加者のみが トランザクションを検証するシャードに対応する状態を維持し、ブロック内のすべてのトランザクションのリストが物理的なトランザクションに分割されます。 チャンク、シャードごとに 1 つのチャンク。 理想的な条件下では、各ブロックにはシャードごとに 1 つのチャンクが含まれます。 ブロック。これは、シャード チェーンを含むモデルにほぼ対応します。 シャード チェーンは、ビーコン チェーンと同じ速度でブロックを生成します。ただし、 ネットワークの遅延により、一部のチャンクが欠落している可能性があるため、実際には各ブロックが欠落している可能性があります。 シャードごとに 1 つまたはゼロのチャンクが含まれます。方法の詳細については、セクション 3.3 を参照してください。 ブロックが生成されます。 図 16: 左側にシャード チェーンがあり、1 つのチェーンが 右側のブロックに分割されたブロック

3.2 コンセンサス 今日のblockchainのコンセンサスへの主要なアプローチは 2 つあります。 最も長い (または最も重い) チェーン。その中で最も多くの作業またはステークを持つチェーン ビルドに使用されたものは正規とみなされ、BFT ではブロックごとにいくつかの validator のセットが BFT のコンセンサスに達しました。 最近提案されたプロトコルでは、後者のアプローチがより有力です。 これは即時的な最終性を提供しますが、最長のチェーンではより多くのブロックが必要となるためです。 ファイナリティを保証するためにブロックの上に構築されます。多くの場合、意味のあることを目的として セキュリティ上、十分な数のブロックが構築されるまでに時間がかかります。 時間の順序。 各ブロックで BFT コンセンサスを使用すると、次のような欠点もあります。 1. BFT コンセンサスにはかなりの量のコミュニケーションが必要です。その間 最近の進歩により、数の点で直線的な時間内に合意に達することが可能になりました 参加者の数 (例: [4] を参照) であっても、ブロックあたりのオーバーヘッドは依然として顕著です。 2. すべてのネットワーク参加者が BFT に参加することは不可能です。 したがって、通常はランダムに抽出された参加者のサブセットのみがコンセンサスに達します。ランダムにサンプリングされたセットは、原則として次のようになります。 適応的に破損し、理論上はフォークが作成される可能性があります。システム どちらもそのようなイベントに備えてモデル化する必要があるため、 BFT コンセンサス以外にフォーク選択ルールがある、またはシャットダウンするように設計されている このようなイベントでダウンします。いくつかのデザインについて言及する価値があります。 Algorand [5] により、適応型破損の可能性が大幅に減少します。 3. 最も重要なのは、次の場合にシステムが停止することです。 参加者全員のうち3名以上が オフライン。したがって、一時的なネットワーク障害やネットワークの分裂により、システムが完全に停止する可能性があります。理想的には、システムは継続的に動作できる必要があります。 参加者の少なくとも半数がオンラインである限り動作します (最も重い チェーンベースのプロトコルは、参加者の半分未満がオンラインであっても動作し続けますが、この特性が望ましいかどうかについては議論の余地があります。 コミュニティ内)。 使用されるコンセンサスが最も重いものであるハイブリッド モデル チェーンですが、一部のブロックはBFT フィナリティ ガジェットを使用して定期的にファイナライズされ、両方のモデルの利点が維持されます。このようなBFT フィナリティ ガジェットは、 Ethereum 2.0 8、Casper CBC で使用される Casper FFG [6] (https://vitalik. を参照) ca/general/2018/12/05/cbc_casper.html) および GRANDPA (https:// を参照) Medium.com/polkadot-network/d08a24a021b5) Polkadot で使用されます。 Nightshade は最も重いチェーンのコンセンサスを使用します。 特にブロックのとき プロデューサーはブロックを生成し (セクション 3.3 を参照)、ブロックから署名を収集できます。 他のブロックプロデューサーと前のブロックを証明するvalidator。セクションを参照 このような多数の署名がどのように集約されるかについては、3.8 を参照してください。重量 8Casper の詳細な概要については、Justin Drake とのホワイトボード セッションもご覧ください。 FFG、およびそれが GHOST の最も重いチェーンのコンセンサスとどのように統合されるかについては、こちらをご覧ください: https://www. youtube.com/watch?v=S262StTwkmoブロックの賭け金は、署名が行われたすべての署名者の累積賭け金となります。 ブロックに含まれています。チェーンの重みはブロックの重みの合計です。 最も重いチェーンのコンセンサスの上に、次のようなフィナリティ ガジェットを使用します。 ブロックを完成させるための証明書。システムの複雑さを軽減するには、 フォーク選択ルールにまったく影響を与えないフィナリティ ガジェットを使用します。 その代わりに、ブロックが一度ブロックされると、追加のスラッシュ条件が導入されるだけです。 フィナリティ ガジェットによってファイナライズされるため、よほど大きなパーセンテージが得られない限りフォークは不可能です 賭け金の合計が削減されます。 Casper CBC は非常にフィナリティの高いガジェットであり、 現在、Casper CBC を念頭に置いたモデルです。 また、TxFlow と呼ばれる別の BFT プロトコルにも取り組んでいます。当時 この文書を書いている時点では、Casper の代わりに TxFlow が使用されるかどうかは不明です CBC。ただし、フィナリティ ガジェットの選択は設計の残りの部分とほぼ直交していることに注意してください。 3.3 ブロック生産 Nightshade には、ブロック プロデューサーと validator という 2 つの役割があります。 いずれにしても システムには w ブロックプロデューサーが含まれている点、モデルでは w = 100、および wv validators、私たちのモデルでは v = 100、wv = 10,000。システムはプルーフ・オブ・ステークです。 つまり、ブロックプロデューサーとvalidatorの両方がいくつかの内部 通貨 (「tokens」と呼ばれます) は、 チェーンの構築と検証という職務の遂行に費やす時間。 すべての Proof of Stake システムと同様、すべての W ブロックプロデューサーがブロックするわけではありません。 それを強制することはできないため、すべての wv validator は異なるエンティティになります。それぞれ ただし、w ブロックプロデューサーと wv validator には別個の 賭け金。 システムには n 個のシャードが含まれており、このモデルでは n = 1000 です。で述べたように セクション 3.1 で説明したように、Nightshade にはシャード チェーンはなく、代わりにすべてのブロック プロデューサーと validator が単一の blockchain を構築しています。 メインチェーン。メインチェーンの状態は n 個のシャードに分割され、各ブロックは プロデューサーと validator は、現時点では、ローカルにダウンロードしたのは、 シャードの一部のサブセットに対応し、プロセスとのみに対応する状態 州のこれらの部分に影響を与えるトランザクションを検証します。 ブロックプロデューサーになるために、ネットワークの参加者はいくつかの大きなロックを行います。 token の金額 (ステーク)。ネットワークのメンテナンスはエポック単位で行われます。 ここで、エポックは数日程度の期間です。 参加者 特定のエポックの開始時に最大の賭け金が得られるブロックは、 その時代のプロデューサー。各ブロックプロデューサーは sw シャードに割り当てられます (たとえば、 sw = 40、これにより、sww/n = 4 シャードあたりのブロックプロデューサーになります)。ブロック プロデューサーは、エポック以前に割り当てられているシャードの状態をダウンロードします。 が開始され、エポック全体を通じてそのシャードに影響を与えるトランザクションを収集します。 そしてそれらを状態に適用します。 メインチェーン上の各ブロック b およびすべてのシャード s には、次のいずれかが存在します。 b に関連する部分を生成する責任がある s にブロック生成者を割り当てます。 シャードに。シャード s に関連する b の部分はチャンクと呼ばれ、 b に含まれるシャードのトランザクションのリストとマークル結果の状態のルート。 b には最終的には非常に小さなヘッダーのみが含まれます。 チャンク、つまり適用されたすべてのトランザクションのマークル ルート (セクションを参照) 正確な詳細については 3.7.1 を参照)、最終状態のマークル ルート。 ドキュメントの残りの部分では、ブロック プロデューサーについてよく言及します。 特定のシャードに対して特定の時間にチャンクを生成する役割を果たします。 チャンクプロデューサーとして。チャンクプロデューサーは常にブロックプロデューサーの 1 つです。 ブロックプロデューサーとチャンクプロデューサーは、次のように各ブロックをローテーションします。 固定スケジュールに。ブロックプロデューサーは命令を受けて繰り返し生産します。 この順序でブロックします。 例えば。 ブロックプロデューサーが 100 人いる場合、最初のブロック プロデューサーはブロック 1、101、201 などの生成を担当し、2 番目はブロックです。 2、102、202など)の制作を担当。 チャンク生成はブロック生成と異なりメンテナンスが必要となるため、 状態、および各シャードについてのみ sww/n ブロックプロデューサーが状態を維持します シャードごとに、それに対応して、それらの sww/n ブロックプロデューサーのみがローテーションして作成されます。 塊。例えば。上記の定数と 4 つのブロック プロデューサーが割り当てられたもの 各シャード、各ブロックプロデューサーは 4 ブロックごとにチャンクを作成します。 3.4 データの可用性を確保する データの可用性を確保するために、Polkadot と同様のアプローチを使用します。 セクション 2.5.3 で説明されています。ブロックプロデューサーがチャンクを生成すると、 の最適な (w, ⌊w/6 + 1⌋) ブロック コードを使用したその消失符号化バージョン チャンク。 次に、消去符号化されたチャンクの 1 つの部分を送信します (このような部分を チャンク部分、または部分のみ)を各ブロックプロデューサーに送信します。 すべての部分を葉として含むマークル ツリーを計算します。 各チャンクのヘッダーには、そのようなツリーのマークル ルートが含まれます。 パーツは onepart メッセージを介して validator に送信されます。そういったメッセージ一つ一つが チャンクヘッダー、パートの序数、およびパートの内容が含まれます。の メッセージには、ブロックを作成したブロックプロデューサーの署名も含まれています。 チャンクとその部分がヘッダーに対応することを証明するマークル パス 適切なブロックプロデューサーによって生成されます。 ブロックプロデューサーがメインチェーンブロックを受け取ると、まず、それらがメインチェーンブロックであるかどうかを確認します。 ブロックに含まれるチャンクごとに 1 つのパート メッセージが含まれます。そうでない場合はブロック 欠落している onepart メッセージが取得されるまで処理されません。 すべての onepart メッセージが受信されると、ブロックプロデューサーは 残りの部分をピアから取得し、ピアが保持するチャンクを再構築します。 状態。 少なくとも 1 つのメイン チェーン ブロックの場合、ブロック プロデューサーはメイン チェーン ブロックを処理しません。 ブロックに含まれるチャンクに対応する onepart メッセージがない場合、または状態を維持する少なくとも 1 つのシャードについては、 チャンク全体を再構築します。 特定のチャンクを利用可能にするには、ブロックの ⌊w/6⌋+1 だけで十分です 生産者は自分の役割を持ち、それを提供します。したがって、その数が続く限り、 悪意のあるアクターは ⌊w/3⌋ ブロックの半分を超えるチェーンを超えない それを構築するプロデューサーは、使用できないチャンクを持つ可能性があります。図 17: 各ブロックにはシャードごとに 1 つまたはゼロのチャンクが含まれており、各チャンクには 消去符号化されています。 Erasure Code チャンクの各部分は、指定されたアドレスに送信されます。 特別な onepart メッセージを介してプロデューサーをブロックする 3.4.1 遅延ブロックプロデューサーへの対処 ブロックプロデューサーに onepart メッセージが欠落しているブロックがある場合、 ブロックがチェーン上に存在することになった場合、まだ署名することを選択する可能性があります。 ブロックプロデューサーの報酬を最大化します。ブロックのリスクはありません ブロックプロデューサーが持っていなかったことを後で証明することは不可能であるため、プロデューサー ワンパートメッセージ。 これに対処するために、チャンクを作成するときに各チャンクをプロデューサーにします。 今後エンコードされるチャンクの各部分の色 (赤または青) を選択し、保存します エンコード前のチャンク内の割り当てられた色のビットマスク。それぞれのパート メッセージにはパーツに割り当てられた色が含まれており、その色は次の場合に使用されます。 エンコードされた部分のマークルルートを計算します。チャンクプロデューサーが外れると プロトコルから、マークルルートが存在しないため、それは簡単に証明できます。 onepart メッセージ、または onepart メッセージの色に対応します。 マークル ルートに対応するものは、チャンク内のマスクとは一致しません。 ブロックプロデューサーがブロックに署名するとき、すべてのブロックのビットマスクが含まれます。 ブロックに含まれるチャンクとして受け取った赤い部分。の出版 不正なビットマスクはスラッシュ可能な動作です。ブロックプロデューサーが 一部のメッセージでは、メッセージの色を知る方法がありません。 したがって、彼らが盲目的に署名しようとすると、切りつけられる可能性が50%あります。 ブロック。 3.5 状態遷移アプリケーション チャンクプロデューサーは、チャンクに含めるトランザクションを選択するだけですが、 チャンクを生成するときに状態遷移を適用しません。これに対応して、

チャンクヘッダーには、以前のメルケル化状態のマークルルートが含まれます チャンク内のトランザクションが適用されます。 トランザクションは、チャンクを含む完全なブロックが存在する場合にのみ適用されます。 処理されます。参加者は次の場合にのみブロックを処理します。 1. 前のブロックが受信され、処理されました。 2. 各チャンクについて、参加者はその状態を維持しません。 onepart メッセージを確認しました。 3. 各チャンクについて、参加者は状態を維持します。 完全なチャンク。 ブロックが処理されると、参加者が参加するシャードごとに 状態を維持し、トランザクションを適用して新しい状態を計算します トランザクションが適用された後の時点で、トランザクションを生成する準備が整います。 次のブロックのチャンク(シャードに割り当てられている場合)。 新しいメルケル化国家のマークルルート。 3.6 クロスシャードトランザクションと領収書 トランザクションが複数のシャードに影響を与える必要がある場合は、連続して影響を与える必要があります。 各シャードで個別に実行されます。トランザクション全体が最初のシャードに送信されます 影響を受け、トランザクションがそのようなシャードのチャンクに含まれると、 チャンクがブロックに含まれた後に適用され、いわゆるレシートが生成されます。 トランザクション。トランザクションが必要な次のシャードにルーティングされます。 処刑される。さらに多くの手順が必要な場合は、受領トランザクションの実行 新しい領収書トランザクションなどを生成します。 3.6.1 受信トランザクションの有効期間 レシートトランザクションは、それが生成されたブロックの直後のブロックで適用されることが望ましい。受け取り取引のみです 前のブロックがブロックプロデューサーによって受信および適用された後に生成されます 元のシャードを維持しており、 次のブロックのチャンクは宛先のブロックプロデューサーによって生成されます 破片。したがって、受領書はソースシャードからシャードに通信される必要があります。 これら 2 つのイベントの間の短い時間枠で宛先シャードを作成します。 A を、レシート r を生成するトランザクション t を含む、最後に生成されたブロックであるとします。 B を次に生成されるブロック (つまり、A を持つブロック) とします。 その前のブロック)、r を含めたいとします。 t をシャード a と r に含めます。 シャード内 b. 図 18 にも示されているレシートの有効期間は次のとおりです。 領収書の作成と保管。シャードのチャンクプロデューサーの CPA a はブロック A を受け取り、トランザクション t を適用し、レシート r を生成します。公認会計士 次に、作成されたすべてのレシートをインデックス付きの内部永続ストレージに保存します。 ソースシャードIDによって異なります。領収書を配布します。 CPA がチャンクを生成する準備ができたら、 ブロック B のシャード a、ブロック A からシャード a のトランザクションを適用することによって生成されたすべてのレシートをフェッチし、それらをシュラッドのチャンクに含めます。 ブロック B 内の a。そのようなチャンクが生成されると、cpa はその消去符号化を生成します。 バージョンと、対応するすべての onepart メッセージ。 cpa は、どのブロックプロデューサーがどのシャードの完全な状態を維持しているかを知っています。特定のブロックプロデューサーの場合 bp cpa には、ブロック A のトランザクションを適用した結果生じた入金が含まれます bp が宛先として気にしているシャードのいずれかを含むシャード a の場合 ブロック B のシャード a のチャンクを配布したときの onepart メッセージ内 (onepart メッセージに含まれるレシートを示す図 17 を参照)。 領収書の受け取り。参加者 (ブロック プロデューサーと validator の両方) は、onepart メッセージを取得するまでブロックを処理しないことに注意してください。 ブロックに含まれるチャンクごとに。したがって、特定の参加者がブロック B を適用するまでに、参加者は、以下に対応するすべての onepart メッセージを取得します。 B にチャンクがあるため、シャードを含むすべての受信レシートが存在します。 参加者は目的地としての状態を維持します。 適用するときは、 特定のシャードの状態遷移の場合、参加者は両方のレシートを適用します onepart メッセージ内のシャード用に収集したものと、すべての チャンク自体に含まれるトランザクション。 図 18: 領収書トランザクションの有効期間 3.6.2 多すぎる領収書の処理 特定のシャードをターゲットとする受信の数が、 特定のブロックが大きすぎて処理できません。たとえば、図 19 を考えてみましょう。 各シャードの各トランザクションは、シャード 1 を対象とするレシートを生成します。 次のブロックまでに、シャード 1 が処理する必要があるレシートの数は次のとおりです。 処理中にすべてのシャードが結合して処理された負荷に相当します 前のブロック。

図 19: すべてのレシートが同じシャードをターゲットにしている場合、シャードには それらを処理する能力 これに対処するために、QuarkChain 9 で使用されているのと同様の技術を使用します。 具体的には、各シャードの最後のブロック B とその中の最後のシャード s レシートが適用されたブロックが記録されます。新しいシャードが作成されるとき 作成されると、レシートは B の残りのシャードから順に適用されます。 次に、B に続くブロックで、新しいチャンクがいっぱいになるまで続けます。正常時 バランスのとれた負荷がある状況では、通常、すべての受信が発生します。 適用されます (したがって、最後のブロックの最後のシャードが記録されます) 各チャンク)、負荷のバランスが取れていない時間帯、および特定の シャードは不釣り合いに多くのレシートを受け取りますが、このテクニックにより、シャードは次のことが可能になります。 含まれるトランザクション数の制限を尊重しながら処理されます。 このような偏荷重が長時間続くと、 アプリケーションが無限に成長し続けるまで、レシートの作成は行われません。 1 つ これに対処する方法は、 ある定数 (1 エポックなど) を超える処理遅延があるシャード。 図 20 を考えてみましょう。ブロック B により、シャード 4 はすべてのレシートを処理できなくなります。 したがって、ブロック A のシャード 3 までの受信のみを処理します。 それを記録します。ブロック C には、ブロック B のシャード 5 までのレシートが含まれており、 その後、ブロック D までにシャードが追いつき、残りのすべてのレシートを処理します。 ブロック B とブロック C からのすべてのレシート。 3.7 チャンクの検証 特定のシャード用に生成されたチャンク (またはシャード チェーンを含むモデル内の特定のシャード チェーン用に生成されたシャード ブロック) は、 9QuarkChainを使用したホワイトボードのエピソードはこちらでご覧ください: https://www.youtube.com/watch? v=opEtG6NM4x4: クロスシャード トランザクションへのアプローチなどが説明されています。 物図 20: 領収書の処理が遅れている 状態を維持する参加者。これらはブロックプロデューサー、validators、 または、状態をダウンロードしてシャードを検証した外部の証人だけ 彼らは資産を保管します。 この文書では、参加者の大多数がデータを保存できないことを想定しています。 シャードの大部分の状態。ただし、言及する価値があります。 次のことを前提として設計されたシャード化された blockchain が存在すること ほとんどの参加者は、ほとんどの状態を保存し、検証する能力を持っています。 QuarkChain などのシャード。 参加者の一部だけがシャードを検証する状態を持っているため、 チャンクを持っている参加者だけを適応的に破損させることが可能です。 状態を変更し、無効な状態遷移を適用します。 数回ごとに validator をサンプリングする複数のシャーディング設計が提案されました 2/3 を超えるシャード チェーン内のブロックは 1 日以内に削除されます。 そのようなシャードに割り当てられた validator の署名が直ちに考慮されます 最後。このようなアプローチでは、適応型の敵対者は 2n/3+1 を破壊するだけで済みます。 シャード チェーン内の validator の無効な状態遷移を適用します。 実現するのは難しいと思われますが、一般の人々にとってセキュリティのレベルは十分ではありません blockchain。 セクション 2.3 で説明したように、一般的なアプローチは、状態 (状態に関係なく) を持つ参加者に対してブロックが作成された後、一定の時間枠を許可することです。 それはブロックプロデューサー、validator、または外部オブザーバーです) の正当性に異議を唱えます。このような参加者はフィッシャーマンと呼ばれます。漁師ができるようになるためには、 無効なブロックに異議を唱える場合は、そのようなブロックが利用可能であることを確認する必要があります。 彼ら。 Nightshade でのデータの可用性については、セクション 3.4 で説明します。 Nightshade では、ブロックが生成されると、チャンクは検証されませんでした。 実際のチャンクプロデューサー以外の誰でも。特に、ブロックプロデューサーは、 ブロックには自然にほとんどのシャードの状態が存在しないことを示唆し、チャンクを検証できませんでした。次のブロックが生成されると、そのブロックには複数のブロック生成者の証明書 (セクション 3.2 を参照) と validator が含まれます。 ただし、ブロックプロデューサーとvalidatorの大部分は状態を維持しないため ほとんどのシャードでも、無効なチャンクが 1 つだけあるブロックは、半分以上の認証を収集し、最も重いブロックに残り続けます。 チェーン。 この問題に対処するために、次の状態を維持する参加者を許可します。 シャードで生成された無効なチャンクに対してオンチェーンでチャレンジを送信するためのシャード 破片。 3.7.1 状態の有効性のチャレンジ 参加者が特定のチャンクが無効であることを検出したら、そのチャンクが無効であるという証拠を提供する必要があります。ネットワーク参加者の大多数は、無効なチャンクが含まれるシャードの状態を維持しないため、 証明には、ブロックが正しいことを確認するのに十分な情報が必要です。 状態がなければ無効です。 単一トランザクションが実行できる状態量 (バイト単位) の制限 Ls を設定します。 累積的に読み取りまたは書き込みができます。 Ls を超えるトランザクション 状態は無効とみなされます。セクション 3.5 で述べたチャンクを思い出してください。 特定のブロック B には、適用されるトランザクションのみが含まれますが、 新しい状態のルート。ブロック B のチャンクに含まれるステート ルートはステートです。 そのようなトランザクションを適用する前、ただしトランザクションを適用した後は root にアクセスします。 同じシャード内のブロックの前の最後のチャンク B. 悪意のある攻撃者 無効な状態遷移を適用しようとすると、不正な状態ルートが含まれる可能性があります 適用の結果生じるステートルートに対応しないブロック B 内 前のチャンク内のトランザクション。 チャンクプロデューサーがチャンクに含める情報を拡張します。 すべてのトランザクションを適用した後の状態を単に含めるのではなく、 連続する各トランザクション セットを適用した後の状態ルートが含まれます。 Ls バイトの状態をまとめて読み書きします。 この情報をもとに、 漁師は、状態遷移が誤って適用されるという課題を作成します。 最初の無効な状態ルートを見つけて、その Ls バイトだけを含めるには十分です。 最後のステート ルート (以前のステート ルート) 間のトランザクションによって影響を受けるステート 有効)とマークル証明付きの現在の状態ルート。その後、参加者全員が セグメント内のトランザクションを検証し、チャンクが有効であることを確認できます。 無効です。 同様に、チャンクプロデューサーが以下のトランザクションを含めようとした場合、 Ls バイトを超える状態を書き込みます。チャレンジには、以下を含めるだけで十分です。 マークル証明と接触する最初の Ls バイト。これで十分です。 トランザクションを適用し、次の処理が実行される瞬間があることを確認します。 Ls バイトを超えるコンテンツの読み取りまたは書き込みが行われます。

3.7.2 漁師と高速クロスシャードトランザクション セクション 2.3 で説明したように、シャード チャンク (またはシャード) が シャード チェーンを含むモデル内のブロック)が無効になり、問題が発生する可能性があります その間、それはフィナリティに悪影響を及ぼし、したがってシャード間の通信に悪影響を及ぼします。で 特に、シャード間トランザクションの宛先シャードは確実ではありません。 元のシャード チャンクまたはブロックは、チャレンジ期間が終了するまで最終的なものとなります (図 21 を参照)。 図 21: レシートを適用する前にチャレンジ期間を待っています クロスシャードトランザクションを行う方法でこれに対処する方法 瞬時とは、宛先シャードがチャレンジ期間を待たないことです。 ソースシャードトランザクションが公開された後、レシートトランザクションを適用します すぐにロールバックしますが、その後、ソースシャードとともに宛先シャードをロールバックします。 元のチャンクまたはブロックが後で無効であることが判明した場合のシャード (図を参照) 22)。これは、シャードが含まれる Nightshade のデザインにも非常に自然に当てはまります。 チェーンは独立していませんが、代わりにシャード チャンクがすべて公開されます 同じメインチェーンブロック内に一緒に。いずれかのチャンクが無効であることが判明した場合、 そのチャンクを含むブロック全体が無効とみなされ、その上に構築されたすべてのブロックが無効と見なされます。 その頂上。図 23 を参照してください。 上記のアプローチは両方とも、チャレンジを前提としてアトミック性を提供します。 期間が十分に長い。通常の状況下では高速なクロスシャード トランザクションを提供する方が不便さを上回るため、後者のアプローチを使用します。 いずれかの無効な状態遷移により、宛先シャードがロールバックします。 ソースシャード、これは非常にまれなイベントです。 3.7.3 validator を非表示にしています 課題の存在により、すでに次のような可能性が大幅に減少しています。 無効な状態遷移ポストでチャンクを終了するため、適応的な破損が発生します。図 22: 領収書をただちに適用し、宛先をロールバックする ソースチェーンに無効なブロックがあった場合はチェーン 図 23: ナイトシェイドでの漁師チャレンジ 適応的な敵対者がすべての参加者を堕落させるために必要なチャレンジ期間 すべての validator を含む、シャードの状態を維持するもの。 このようなイベントが発生する可能性を推定することは非常に複雑です。 シャード化された blockchain は、そのような攻撃が試行されるのに十分な期間存続しています。我々は、その可能性は極めて低いとはいえ、それでも十分にあると主張する。 数百万のトランザクションを実行することが予想されるシステムとしては大規模であり、 世界規模の金融業務を運営します。 この考えには主に 2 つの理由があります。 1. Proof-of-Stake チェーンおよびマイナーの validator のほとんど

Proof-of-Work チェーンは主に財務上の好転によって奨励されます。もし 適応的な敵対者は、期待される利益よりも多くの資金を提供します 正直に動作することから、多くの validator が発生することが予想されます。 申し出を受け入れるでしょう。 2. 多くの企業が Proof-of-Stake チェーンの検証を専門的に行っており、 どのチェーンでも株式の大部分が そのような実体から。そのようなエンティティの数は、 適応的な敵対者として、彼らのほとんどを個人的に知り、 彼らが腐敗する傾向があることをよく理解しています。 どの validator がどのシャードに割り当てられているかを非表示にすることで、適応型破損の可能性を減らすためにさらに一歩進んでいます。アイデアは Algorand [5] が validator を隠す方法とほぼ同じです。 Algorand のように、validator が隠蔽されている場合でも注意することが重要です。 あるいは、以下で説明するように、適応的な破損は理論的には依然として可能です。その間 適応型の敵対者は、作成または検証する参加者を知りません。 ブロックでもチャンクでも、参加者自身が自分が実行することを知っています。 そのようなタスクを実行し、その暗号による証明を持っています。 したがって、敵は、 腐敗させる意図をブロードキャストし、提供してくれる参加者に報酬を支払う そのような暗号証明。ただし、敵はそうではないため、 破損させたいシャードに割り当てられている validator を知っている場合、 特定のシャードを破壊する意図をブロードキャストする以外に選択肢はありません。 コミュニティ全体。その時点で、正直な人にとっては経済的に有益です。 参加者は、そのシャードを検証する完全なノードをスピンアップします。 そのシャードに無効なブロックが出現する可能性があり、これは チャレンジを作成し、関連する報酬を集めます。 特定のシャードに割り当てられている validator を公開しないようにするには、 以下のとおりです (図 24 を参照)。 VRF を使用して割り当てを取得します。各エポックの開始時にそれぞれ validator は VRF を使用して、validator が割り当てられているシャードのビットマスクを取得します。 各 validator のビットマスクには Sw ビットがあります (定義についてはセクション 3.3 を参照してください) スイス)。次に、validator は対応するシャードの状態をフェッチし、 エポック中に、受信したブロックごとに、対応するチャンクを検証します validator が割り当てられているシャードに。 チャンクではなくブロックにサインオンします。シャードの割り当ては隠蔽されているため、validator はチャンクに署名できません。代わりに、常に全体に署名します ブロックするため、どのシャードを検証するかは明らかにされません。具体的には、validator がブロックを受信してすべてのチャンクを検証すると、メッセージが作成されます。 これは、validator が割り当てられているすべてのシャード内のすべてのチャンクが 有効 (それらのシャードが何であるかをまったく示さずに)、または次のようなメッセージ いずれかのチャンクが無効な場合、無効な状態遷移の証明が含まれます。を参照してください。 このようなメッセージがどのように集約されるかについてはセクション 3.8、詳細についてはセクション 3.7.4 を参照してください。 validators が次からのメッセージに便乗するのを防ぐ方法の詳細 その他のvalidator、および報酬と罰の詳細についてはセクション 3.7.5 を参照してください。 validators は、無効な状態遷移チャレンジが実際に成功した場合に発生します。図 24: Nightshade で validator を隠す 3.7.4 コミットと公開 validators に関する一般的な問題の 1 つは、validator が状態のダウンロードと実際のチャンクとブロックの検証をスキップし、その代わりに ネットワークを観察し、他の validator が送信した内容を確認し、その内容を繰り返します。 メッセージ。このような戦略に従う validator は、追加の機能を提供しません。 ネットワークのセキュリティを確保しますが、報酬も収集します。 この問題の一般的な解決策は、validator ごとに証明を提供することです。 たとえば独自のトレースを提供するなどして、ブロックを実際に検証したこと 状態遷移を適用する必要がありますが、そのような証明はコストを大幅に増加させます 検証の。 図 25: コミットと公開

代わりに、validators を最初に検証結果にコミットします (どちらか チャンクの有効性を証明するメッセージ、または無効であることの証明 状態遷移)、図 25 に示すように、一定期間待機してから初めて実際の検証結果が表示されます。コミット期間は次の期間と交差しません。 公開期間があるため、怠惰な validator は正直な validator をコピーできません。 さらに、不正な validator が、 割り当てられたチャンクの有効性、および少なくとも 1 つのチャンクが無効になった場合 チャンクが無効であることが示されているため、validator はスラッシュを回避できません。 セクション 3.7.5 で示すように、そのような状況で斬られないようにする唯一の方法 無効な状態遷移の証拠を含むメッセージを提示することです。 コミットと一致します。 3.7.5 課題への対処 上で説明したように、validator が無効なチャンクを含むブロックを受信すると、 彼らはまず無効な状態遷移の証明を準備します (セクション 3.7.1 を参照)。 そのような証明に取り組み(3.7.4 を参照)、一定期間後に課題を明らかにします。 公開されたチャレンジがブロックに含まれると、次のことが起こります。 1. を含むブロックから発生したすべての状態遷移。 公開されたチャレンジが含まれるブロックが取得されるまで無効なチャンク 無効化された。公開されたチャレンジを含むブロック前の状態 を含むブロックの前の状態と同じとみなされます。 無効なチャンク。 2. 一定期間内に、各 validator はビットマスクを公開する必要があります 彼らが検証したシャード。ビットマスクは VRF 経由で作成されるため、 それらは無効な状態遷移のあるシャードに割り当てられていました。 それを明らかにすることは避けられない。ビットマスクを明らかにできないvalidator シャードに割り当てられていると想定されます。 3. この期間後にシャードに割り当てられていることが判明した各 validator、 を含むブロックの検証結果にコミットしました。 無効なチャンクであり、無効な状態遷移の証拠は明らかにされませんでした コミットに対応する部分はスラッシュされます。 4. 各 validator には新しいシャードが割り当てられ、新しいエポックがスケジュールされます すべての validator がダウンロードするのに十分な時間が経過した後に開始します。 図 26 に示す状態。 validator が割り当てられたシャードを明らかにした瞬間から注意してください。 新しいエポックが始まるまで、システムのセキュリティは低下します。 シャードの割り当てが明らかになります。ネットワークの参加者はそれを保管する必要があります その間ネットワークをご利用になる際はご注意ください。 3.8 署名の集約 数百のシャードを含むシステムが安全に動作するには、 10,000 validator 以上の注文。セクション 3.7 で説明したように、それぞれが必要です。図 26: 課題への対処 validator 特定のメッセージに対するコミットと署名を平均して公開します ブロックごとに 1 回。たとえコミットメッセージが同じであっても、そのようなメッセージを集約すると、 BLS 署名とその検証には法外な費用がかかるでしょう。でも 当然のことながら、コミット メッセージとリビール メッセージは validator 間で同じではありません。 したがって、そのようなメッセージと署名を 1 つのファイルに集約する何らかの方法が必要です。 これにより、後で迅速に検証できるようになります。 私たちが使用する具体的なアプローチは次のとおりです。 ブロックプロデューサーに参加するバリデーター。ブロックプロデューサーは既知です エポックが始まる少し前に、ダウンロードするのに時間がかかるため、 エポックが開始する前の状態であり、validator とは異なり、ブロックプロデューサーは 隠蔽されていない。各ブロックプロデューサーには v validator スロットがあります。バリデーターが送信する ブロックプロデューサーへのオフチェーンの提案で、ブロックプロデューサーの 1 つとして含めることができます。 validator秒。ブロックプロデューサーがvalidatorを含めたい場合は、 validator からの最初のオフチェーンリクエストを含むトランザクション、および validator をブロック プロデューサーに参加させるブロック プロデューサーの署名。 ブロックプロデューサーに割り当てられた validator は必ずしも ブロックプロデューサーがチャンクを生成するのと同じシャードを検証します。 もし validator は複数のブロックプロデューサーの結合に適用されます。ブロックプロデューサーからのトランザクションのみです。 最初のブロックプロデューサーが成功します。 ブロックプロデューサーはコミットを収集します。ブロック プロデューサーは、validator からコミット メッセージとリビール メッセージを常に収集します。このようなメッセージが一定数蓄積されると、ブロックプロデューサーはマークルを計算します。 これらのメッセージのツリーを作成し、各 validator にマークル ルートと 彼らのメッセージへのマークルパス。 validator はパスを検証し、サインオンします。 マークルルート。次に、ブロックプロデューサーは BLS 署名を validators からマークル ルートを取得し、マークル ルートと 積み上げたサイン。ブロックプロデューサーは、ブロックの有効性にも署名します。 安価な ECDSA 署名を使用したマルチ署名。マルチ署名が機能しない場合 送信されたマークル ルート、または参加している validator のビットマスクと一致する場合、これはスラッシュ可能な動作です。チェーンを同期するとき、参加者は validators からのすべての BLS 署名を検証することを選択できます (validators の公開鍵の集約が必要なため、非常にコストがかかります)、またはのみを検証することもできます。ブロックプロデューサーからの ECDMA 署名を使用し、次の事実に依存します。 ブロックプロデューサーは異議を申し立てられず、切り捨てられました。 オンチェーントランザクションとマークルプルーフをチャレンジに使用します。それ そうでない場合、validators からのメッセージを公開しても意味がないことに注意してください。 無効な状態遷移が検出されました。実際の内容を含むメッセージのみ 無効な状態遷移の証拠は、そのようなメッセージに対してのみ明らかにされる必要があります。 それらが前のコミットと一致することを示す必要があります。メッセージには次のことが必要です 次の 2 つの目的で公開されます。 1. 実際にチェーンのロールバックを開始して、直前の時点に戻します。 無効な状態遷移 (セクション 3.7.5 を参照)。 2. validator が、 無効なチャンクです。 いずれの場合も、次の 2 つの問題に対処する必要があります。 1. 実際のコミットはチェーンに含まれておらず、マークルルートのみがチェーンに含まれていました。 他のメッセージと集約されたコミット。 validator は、 ブロックプロデューサーによって提供されるマークルパスとその元のコミット 彼らがその挑戦に真剣に取り組んでいることを証明します。 2. シャードに割り当てられているすべての validator が無効である可能性があります。 状態遷移は破損したブロックプロデューサーに割り当てられているため、 彼らを検閲しているのだ。それを回避するために、私たちは彼らが公開を提出することを許可します オンチェーン上の通常のトランザクションとして、集約をバイパスします。 後者は、無効な状態遷移の証明にのみ許可されます。 非常にまれであるため、ブロックのスパム送信にはならないはずです。 対処する必要がある最後の問題は、ブロックプロデューサーが次のことを行うことができるということです。 メッセージ集約に参加しないことを選択するか、特定の validator を意図的に検閲します。ブロック化することで経済的に不利になります プロデューサーの報酬は、割り当てられた validator の数に比例します。私たち また、エポック間のブロックプロデューサーが大部分で交差していることにも注意してください( 常に最も高い賭け金を持つ上位 2 人の参加者です)、validator は次のことができます 同じブロックプロデューサーとの連携にほぼ固執するため、リスクが軽減されます。 過去に検閲を行ったブロックプロデューサーに割り当てられたことについて。 3.9 スナップショットチェーン メインチェーン上のブロックは非常に頻繁に生成されるため、ダウンロード 完全な履歴はすぐに高価になる可能性があります。また、 ブロックには多数の参加者の BLS 署名が含まれており、署名をチェックするための公開鍵の集合だけでも法外な量になる可能性があります。 高価でもあります。 最後に、予見可能な将来において Ethereum 1.0 は 1 のままになる可能性が高いため、 最も使用されている blockchain から資産を転送する有意義な方法を備えています。

Ethereum に近いことが要件であり、現在、BLS 署名を検証して確実にしています。 Ethereum 側のニアブロックの有効性は不可能です。 Nightshade メインチェーンの各ブロックには、オプションで Schnorr を含めることができます。 このような Schnorr を含む最後のブロックのヘッダーの多重署名 マルチシグネチャ。このようなブロックをスナップショット ブロックと呼びます。の最初のブロック すべてのエポックはスナップショット ブロックである必要があります。このようなマルチシグネチャの作業中に、 ブロックプロデューサーは、validators の BLS 署名も蓄積する必要があります。 最後のスナップショット ブロックで、で説明したのと同じ方法でそれらを集計します。 セクション3.8。 ブロックプロデューサーセットはエポック全体を通じて一定であるため、検証 何もしないと仮定すると、各エポックの最初のスナップショット ブロックだけで十分です。 ブロックプロデューサーとvalidatorの大部分が共謀して作成されたことを指摘する フォーク。 エポックの最初のブロックには、計算に十分な情報が含まれている必要があります ブロックプロデューサーとエポックのvalidator。 スナップショットのみを含むメインチェーンのサブチェーンを呼び出します。 スナップショット チェーンをブロックします。 Schnorr マルチ署名の作成は対話型のプロセスですが、 どんなに非効率なプロセスであっても、頻繁に実行するだけで済みます。 十分でしょう。 Schnorr マルチ署名は Ethereum で簡単に検証できます。 したがって、クロスblockchainを安全に実行するための重要なプリミティブが提供されます。 コミュニケーション。 Near チェーンと同期するには、すべてのスナップショットをダウンロードするだけで済みます ブロックし、Schnorr 署名が正しいことを確認し (オプションで validator の個々の BLS 署名も検証します)、同期のみを行います。 最後のスナップショット ブロックからのメイン チェーン ブロック。

Conclusion

Conclusion

In this document we discussed approaches to building sharded blockchains and covered two major challenges with existing approaches, namely state validity and data availability. We then presented Nightshade, a sharding design that powers NEAR Protocol. The design is work in progress, if you have comments, questions or feedback on this document, please go to https://near.chat.

結論

このドキュメントでは、シャード化された blockchain を構築するアプローチについて説明しました。 既存のアプローチの 2 つの主要な課題、つまり状態の妥当性をカバーしました。 データの可用性。次に、Nightshade というシャーディング デザインを提案しました。 NEAR プロトコルを強化します。 デザインは進行中です。コメント、質問、フィードバックがありましたら このドキュメントについては、https://near.chat. にアクセスしてください。