NEAR श्वेत पत्र

Nightshade: Near Protocol Sharding Design

Par 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.

साझाकरण की मूल बातें

आइए शार्डिंग के सबसे सरल तरीके से शुरुआत करें। इसके बजाय इस दृष्टिकोण में एक blockchain चलाने पर, हम एकाधिक चलाएंगे, और ऐसे प्रत्येक blockchain को कॉल करेंगे "शार्द"। प्रत्येक शार्ड के पास validators का अपना सेट होगा। यहां और नीचे हम उपयोग करते हैं लेनदेन को सत्यापित करने वाले प्रतिभागियों को संदर्भित करने के लिए एक सामान्य शब्द "validator"। ब्लॉक का उत्पादन करें, या तो खनन द्वारा, जैसे कि कार्य के प्रमाण में, या मतदान-आधारित के माध्यम से 1यह अनुभाग पहले https://near.ai/shard1. पर प्रकाशित हुआ था यदि आपने इसे पहले पढ़ा है, अगले भाग पर जाएँ.

तंत्र। अभी के लिए मान लेते हैं कि शार्क कभी भी एक-दूसरे से संवाद नहीं करते हैं अन्य. यह डिज़ाइन, हालांकि सरल है, शार्डिंग में कुछ प्रारंभिक प्रमुख चुनौतियों को रेखांकित करने के लिए पर्याप्त है। 1.1 सत्यापनकर्ता विभाजन और बीकन श्रृंखलाएँ कहें कि सिस्टम में 10 टुकड़े शामिल हैं। पहली चुनौती यह है कि प्रत्येक के साथ शार्ड का अपना validators है, प्रत्येक शार्ड अब 10 गुना कम सुरक्षित है पूरी शृंखला. इसलिए यदि X validators वाली एक गैर-शार्ड श्रृंखला हार्ड-फोर्क का निर्णय लेती है एक खंडित श्रृंखला में, और X validators को 10 खंडों में विभाजित करता है, प्रत्येक खंड अब केवल X/10 validators हैं, और एक शार्ड को भ्रष्ट करने के लिए केवल भ्रष्ट करने की आवश्यकता होती है validators की कुल संख्या का 5.1% (51% / 10) (चित्र 1 देखें), चित्र 1: validators को टुकड़ों में विभाजित करना जो हमें दूसरे बिंदु पर लाता है: प्रत्येक शार्ड के लिए validator कौन चुनता है? validators के 5.1% को नियंत्रित करना केवल हानिकारक है यदि वे सभी validators के 5.1% हों एक ही हिस्से में हैं. यदि validators यह नहीं चुन सकते कि उन्हें कौन सा शार्ड मान्य करना है में, validator के 5.1% को नियंत्रित करने वाले प्रतिभागी को सभी प्राप्त होने की अत्यधिक संभावना नहीं है उनके validators एक ही हिस्से में हैं, जिससे समझौता करने की उनकी क्षमता काफी कम हो गई है प्रणाली. आज लगभग सभी शार्डिंग डिज़ाइन यादृच्छिकता के किसी न किसी स्रोत पर निर्भर करते हैं शार्ड को validators असाइन करें। blockchain पर यादृच्छिकता अपने आप में एक बहुत ही चुनौतीपूर्ण विषय है और इस दस्तावेज़ के दायरे से बाहर है। अभी के लिए मान लेते हैं कि वहाँ है यादृच्छिकता के कुछ स्रोत जिनका हम उपयोग कर सकते हैं। हम validator के असाइनमेंट को कवर करेंगे अनुभाग 2.1 में अधिक विवरण। यादृच्छिकता और validator असाइनमेंट दोनों के लिए गणना की आवश्यकता होती है जो कि नहीं है किसी विशेष शार्ड के लिए विशिष्ट। उस गणना के लिए, व्यावहारिक रूप से सभी विद्यमान हैं डिज़ाइन में एक अलग blockchain होता है जिसे संचालन करने का काम सौंपा जाता है पूरे नेटवर्क के रखरखाव के लिए आवश्यक है। यादृच्छिक उत्पन्न करने के अलावासंख्याएँ और शार्डों को validators निर्दिष्ट करना, ये ऑपरेशन अक्सर भी होते हैं इसमें शार्ड से अपडेट प्राप्त करना और उनका स्नैपशॉट लेना, प्रोसेसिंग करना शामिल है प्रूफ़-ऑफ़-स्टेक सिस्टम में हिस्सेदारी और कटौती, और उस समय टुकड़ों को पुनर्संतुलित करना सुविधा समर्थित है. ऐसी श्रृंखला को Ethereum में बीकन श्रृंखला, एक रिले कहा जाता है पोल्काडॉट में श्रृंखला, और Cosmos में Cosmos हब। इस पूरे दस्तावेज़ में हम ऐसी श्रृंखला को बीकन श्रृंखला के रूप में संदर्भित करेंगे। बीकन श्रृंखला का अस्तित्व हमें अगले दिलचस्प विषय पर लाता है द्विघात विखंडन. 1.2 द्विघात विखंडन शेयरिंग को अक्सर ऐसे समाधान के रूप में विज्ञापित किया जाता है जो संख्या के साथ अनंत रूप से बढ़ता है नेटवर्क संचालन में भाग लेने वाले नोड्स की संख्या। जबकि सैद्धांतिक रूप से ऐसा करना संभव है ऐसा शार्डिंग समाधान डिज़ाइन करें, कोई भी समाधान जिसमें बीकन की अवधारणा हो श्रृंखला में अनंत मापनीयता नहीं है। इसका कारण समझने के लिए, बीकन पर ध्यान दें श्रृंखला को कुछ बहीखाता गणना करनी होती है, जैसे validators निर्दिष्ट करना शार्ड, या स्नैपशॉटिंग शार्ड चेन ब्लॉक, जो संख्या के समानुपाती होता है सिस्टम में टुकड़ों की. चूंकि बीकन श्रृंखला स्वयं एक blockchain है, साथ में इसे संचालित करने वाले नोड्स की कम्प्यूटेशनल क्षमताओं से बंधी गणना, टुकड़ों की संख्या स्वाभाविक रूप से सीमित है। हालाँकि, एक शार्ड नेटवर्क की संरचना एक गुणक प्रदान करती है इसके नोड्स में किसी भी सुधार पर प्रभाव। उस मामले पर विचार करें जिसमें एक मनमाना नेटवर्क में नोड्स की दक्षता में सुधार किया गया है जो अनुमति देगा वे तेजी से लेनदेन प्रसंस्करण समय. यदि नेटवर्क का संचालन करने वाले नोड्स, बीकन श्रृंखला में नोड्स सहित, चार गुना तेज़ हो जाएं, तो प्रत्येक टुकड़ा चार गुना अधिक प्रक्रिया करने में सक्षम हो जाएगा लेनदेन, और बीकन श्रृंखला 4 गुना अधिक शार्क बनाए रखने में सक्षम होगी। पूरे सिस्टम में थ्रूपुट 4 × 4 = 16 के कारक से बढ़ जाएगा - इस प्रकार इसका नाम क्वाड्रैटिक शार्डिंग पड़ा। कितने टुकड़े हैं इसका सटीक माप प्रदान करना कठिन है आज व्यवहार्य है, लेकिन निकट भविष्य में थ्रूपुट की संभावना नहीं है blockchain उपयोगकर्ताओं की ज़रूरतें द्विघात शार्डिंग की सीमाओं को पार कर जाएंगी। इतनी बड़ी मात्रा में शार्क को सुरक्षित रूप से संचालित करने के लिए नोड्स की सरासर संख्या आवश्यक है संभवतः सभी को संचालित करने वाले नोड्स की संख्या से अधिक परिमाण का आदेश है blockchains आज संयुक्त। 1.3 राज्य विभाजक अब तक हम यह अच्छी तरह से परिभाषित नहीं कर पाए हैं कि वास्तव में क्या है और क्या अलग नहीं है जब किसी नेटवर्क को शार्ड में विभाजित किया जाता है। विशेष रूप से, blockchain में नोड्स तीन महत्वपूर्ण कार्य करते हैं: न केवल वे 1) लेन-देन की प्रक्रिया करते हैं, वे इसके अलावा 2) मान्य लेनदेन और पूर्ण किए गए ब्लॉक को अन्य नोड्स पर रिले करें और 3) संपूर्ण नेटवर्क बही की स्थिति और इतिहास को संग्रहीत करें। इन तीनों में से प्रत्येक कार्य नेटवर्क को संचालित करने वाले नोड्स पर बढ़ती आवश्यकता को लागू करते हैं:1. लेनदेन को संसाधित करने की आवश्यकता के लिए अधिक गणना शक्ति की आवश्यकता होती है संसाधित किए जा रहे लेनदेन की बढ़ी हुई संख्या; 2. लेन-देन और ब्लॉक को रिले करने की आवश्यकता के लिए रिले किए जाने वाले लेन-देन की बढ़ी हुई संख्या के साथ अधिक नेटवर्क बैंडविड्थ की आवश्यकता होती है; 3. जैसे-जैसे राज्य बढ़ता है डेटा को संग्रहीत करने की आवश्यकता अधिक भंडारण की आवश्यकता होती है। महत्वपूर्ण बात यह है कि प्रसंस्करण शक्ति और नेटवर्क के विपरीत, लेनदेन दर (संसाधित लेनदेन की संख्या) होने पर भी भंडारण की आवश्यकता बढ़ती है प्रति सेकंड) स्थिर रहता है। उपरोक्त सूची से ऐसा लग सकता है कि भंडारण की आवश्यकता होगी सबसे अधिक दबाव वाला, क्योंकि यह एकमात्र ऐसा है जो समय के साथ बढ़ाया जा रहा है भले ही प्रति सेकंड लेनदेन की संख्या नहीं बदलती, लेकिन व्यवहार में आज सबसे बड़ी आवश्यकता गणना शक्ति की है। का सम्पूर्ण राज्य Ethereum इस लेखन के अनुसार 100GB है, जिसे अधिकांश नोड्स द्वारा आसानी से प्रबंधित किया जा सकता है। लेकिन लेन-देन की संख्या Ethereum लगभग 20 ऑर्डर संसाधित कर सकती है कई व्यावहारिक उपयोग के मामलों के लिए आवश्यकता से कम परिमाण। Zilliqa सबसे प्रसिद्ध परियोजना है जो प्रसंस्करण को खंडित करती है लेकिन भंडारण को नहीं। प्रोसेसिंग को साझा करना एक आसान समस्या है क्योंकि प्रत्येक नोड में संपूर्ण होता है राज्य, जिसका अर्थ है कि अनुबंध स्वतंत्र रूप से अन्य अनुबंधों को लागू कर सकते हैं और किसी भी डेटा को पढ़ सकते हैं blockchain से. सुनिश्चित अपडेट करने के लिए कुछ सावधानीपूर्वक इंजीनियरिंग की आवश्यकता है राज्य के समान भागों को अद्यतन करने वाले एकाधिक शार्डों से टकराव नहीं होता है। में इस संबंध में ज़िलिक्का अपेक्षाकृत सरल दृष्टिकोण अपना रहा है2। जबकि प्रसंस्करण को विभाजित किए बिना भंडारण को विभाजित करने का प्रस्ताव किया गया था, यह है अत्यंत असामान्य. इस प्रकार व्यवहार में भंडारण का विखंडन, या राज्य विखंडन, लगभग हमेशा प्रसंस्करण और नेटवर्क के विखंडन का तात्पर्य होता है। व्यावहारिक रूप से, स्टेट शेयरिंग के तहत प्रत्येक शार्ड में नोड्स अपना निर्माण कर रहे हैं स्वयं का blockchain जिसमें लेनदेन शामिल है जो केवल स्थानीय भाग को प्रभावित करता है वैश्विक स्थिति जो उस शार्ड को सौंपी गई है। इसलिए, validators में शार्ड को केवल वैश्विक स्थिति के अपने स्थानीय हिस्से को संग्रहीत करने और केवल निष्पादित करने की आवश्यकता है, और इस तरह केवल रिले, लेनदेन जो राज्य के उनके हिस्से को प्रभावित करते हैं। यह विभाजन रैखिक रूप से सभी गणना शक्ति, भंडारण और पर आवश्यकता को कम कर देता है नेटवर्क बैंडविड्थ, लेकिन नई समस्याएं पेश करता है, जैसे डेटा उपलब्धता और क्रॉस-शार्क लेनदेन, दोनों को हम नीचे कवर करेंगे। 1.4 क्रॉस-शार्ड लेनदेन हमने अब तक जिस शार्डिंग मॉडल का वर्णन किया है वह बहुत उपयोगी नहीं है, क्योंकि यदि व्यक्तिगत टुकड़े एक दूसरे के साथ संवाद नहीं कर सकते, वे एकाधिक से बेहतर नहीं हैं स्वतंत्र blockchains। आज भी, जब शार्डिंग उपलब्ध नहीं है, तो एक है विभिन्न blockchain के बीच अंतरसंचालनीयता की भारी मांग। आइए अभी केवल साधारण भुगतान लेनदेन पर विचार करें, जहां प्रत्येक भागीदार के पास बिल्कुल एक शार्ड पर खाता है। अगर कोई पैसे ट्रांसफर करना चाहता है 2उनके दृष्टिकोण का हमारा विश्लेषण यहां पाया जा सकता है: https://medium.com/nearprotocol/ 8f9efae0ce3bएक ही शार्ड के भीतर एक खाते से दूसरे खाते में लेनदेन की प्रक्रिया की जा सकती है उस टुकड़े में पूरी तरह से validators द्वारा। यदि, तथापि, ऐलिस जो शार्ड पर रहती है

1 बॉब को पैसे भेजना चाहता है जो शार्ड #2 पर रहता है, न ही validators

शार्ड #1 पर (वे बॉब के खाते को क्रेडिट नहीं कर पाएंगे) और न ही validators पर शार्ड #2 (वे ऐलिस के खाते से डेबिट नहीं कर पाएंगे) संपूर्ण प्रक्रिया कर सकता है लेनदेन. क्रॉस-शार्क लेनदेन के दृष्टिकोण के दो परिवार हैं: • सिंक्रोनस: जब भी किसी क्रॉस-शार्ड लेनदेन को निष्पादित करने की आवश्यकता होती है, एकाधिक शार्डों में ब्लॉक जिनमें राज्य संक्रमण से संबंधित होता है सभी लेन-देन एक ही समय में उत्पन्न होते हैं, और एकाधिक शार्ड के validator ऐसे लेन-देन को निष्पादित करने में सहयोग करते हैं।3 • एसिंक्रोनस: एक क्रॉस-शार्क लेनदेन जो कई शार्डों को प्रभावित करता है उन शार्डों में अतुल्यकालिक रूप से निष्पादित किया जाता है, "क्रेडिट" शार्ड निष्पादित होता है इसका आधा भाग एक बार पर्याप्त सबूत हो जाने पर कि "डेबिट" शार्ड ने अपना हिस्सा निष्पादित कर दिया है। इसके कारण यह दृष्टिकोण अधिक प्रचलित होता है सरलता और समन्वय में आसानी. यह प्रणाली आज Cosmos, Ethereum सेरेनिटी, नियर, कडेना और अन्य में प्रस्तावित है। इससे एक समस्या है दृष्टिकोण यह है कि यदि ब्लॉक स्वतंत्र रूप से उत्पादित किए जाते हैं, तो एक गैर-शून्य संभावना है कि कई ब्लॉकों में से एक अनाथ हो जाएगा, इस प्रकार लेन-देन केवल आंशिक रूप से लागू किया गया। चित्र 2 पर विचार करें जो दो को दर्शाता है दोनों टुकड़ों में एक कांटा और एक क्रॉस-शार्क लेनदेन का सामना करना पड़ा इसे क्रमशः ब्लॉक ए और एक्स में दर्ज किया गया था। यदि जंजीर ए-बी और V'-X'-Y'-Z' अंततः संगत शार्डों में विहित हो जाता है लेन-देन पूरी तरह से अंतिम रूप ले चुका है। यदि A'-B'-C'-D' और V-X विहित हो जाते हैं, तो लेन-देन पूरी तरह से छोड़ दिया जाता है, जो स्वीकार्य है। लेकिन अगर, के लिए उदाहरण के लिए, ए-बी और वी-एक्स विहित हो जाते हैं, फिर लेन-देन का एक हिस्सा अंतिम हो जाता है और एक छोड़ दिया जाता है, जिससे परमाणु विफलता पैदा होती है। हम दूसरे भाग में प्रस्तावित प्रोटोकॉल में इस समस्या को कैसे संबोधित किया जाता है, इस पर चर्चा की जाएगी, जब फोर्क-चॉइस नियमों और सर्वसम्मति में परिवर्तन को कवर किया जाएगा साझा प्रोटोकॉल के लिए प्रस्तावित एल्गोरिदम। ध्यान दें कि शृंखलाओं के बीच संचार शार्ड blockchains के बाहर उपयोगी है भी. श्रृंखलाओं के बीच अंतरसंचालनीयता एक जटिल समस्या है जो कई परियोजनाओं में होती है सुलझाने का प्रयास कर रहे हैं. शार्डेड blockchains में समस्या कुछ हद तक आसान है ब्लॉक संरचना और आम सहमति सभी शार्क में समान होती है, और एक बीकन श्रृंखला होती है जिसका उपयोग समन्वय के लिए किया जा सकता है। हालाँकि, एक खंडित blockchain में, सभी शार्ड श्रृंखलाएं समान हैं, जबकि वैश्विक blockchains पारिस्थितिकी तंत्र में हैं विभिन्न लक्ष्य उपयोग के मामलों, विकेंद्रीकरण के साथ बहुत सारे अलग-अलग blockchain हैं और गोपनीयता की गारंटी। एक ऐसी प्रणाली का निर्माण करना जिसमें श्रृंखलाओं के एक सेट में अलग-अलग गुण हों पर्याप्त रूप से समान सर्वसम्मति और ब्लॉक संरचना का उपयोग करें और एक सामान्य बीकन श्रृंखला होने से विषम blockchain के पारिस्थितिकी तंत्र को सक्षम किया जा सकता है जिसमें एक 3द सबसे विस्तृत प्रस्ताव ज्ञात को द लेखक का यह दस्तावेज़ है विलय ब्लॉक, वर्णित यहाँ: https://ethresear.ch/t/ मर्ज-ब्लॉक-और-सिंक्रोनस-क्रॉस-शार्ड-स्टेट-निष्पादन/1240चित्र 2: अतुल्यकालिक क्रॉस-शार्क लेनदेन कार्यशील अंतरसंचालनीयता उपप्रणाली। ऐसी प्रणाली में validator रोटेशन की सुविधा होने की संभावना नहीं है, इसलिए सुरक्षा सुनिश्चित करने के लिए कुछ अतिरिक्त उपाय किए जाने की आवश्यकता है। दोनों Cosmos और PolkaDot प्रभावी रूप से ऐसे सिस्टम4 हैं 1.5 दुर्भावनापूर्ण व्यवहार इस अनुभाग में हम समीक्षा करेंगे कि कौन सा प्रतिकूल व्यवहार validators को दुर्भावनापूर्ण बना सकता है यदि वे किसी टुकड़े को भ्रष्ट करने में सफल हो जाते हैं तो व्यायाम करें। हम क्लासिक दृष्टिकोणों की समीक्षा करेंगे खंड 2.1 में भ्रष्ट टुकड़ों से बचने के लिए। 1.5.1 दुर्भावनापूर्ण कांटे दुर्भावनापूर्ण validators का एक सेट एक कांटा बनाने का प्रयास कर सकता है। ध्यान दें कि ऐसा नहीं है इससे कोई फर्क नहीं पड़ता कि अंतर्निहित सर्वसम्मति BFT है या नहीं, पर्याप्त संख्या को दूषित कर रही है validators से हमेशा एक कांटा बनाना संभव हो जाएगा। पूरे नेटवर्क के 50% से अधिक के दूषित होने की तुलना में एकल शार्ड के 50% से अधिक के दूषित होने की काफी अधिक संभावना है (हम करेंगे) खंड 2.1 में इन संभावनाओं पर गहराई से विचार करें)। जैसा कि खंड 1.4 में चर्चा की गई है, क्रॉस-शार्ड लेन-देन में कई शार्डों में कुछ निश्चित स्थिति परिवर्तन शामिल होते हैं, और ऐसे टुकड़ों में संबंधित ब्लॉक जो ऐसे राज्य परिवर्तन लागू करते हैं, अवश्य होने चाहिए या तो सभी को अंतिम रूप दिया जाए (अर्थात चयनित श्रृंखलाओं में उनके अनुरूप दिखाई दें)। शार्ड), या सभी अनाथ हो जाएंगे (अर्थात चयनित श्रृंखलाओं में उनके संबंधित शार्ड पर दिखाई नहीं देंगे)। चूंकि आम तौर पर शार्क के दूषित होने की संभावना होती है 4Cosmos: https://forum.cosmos.network/ से जकी मनियन द्वारा लिखित इस आलेख को देखें t/polkadot-vs-cosmos/1397/2 और इस दस्तावेज़ के पहले लेखक का यह ट्वीट-स्टॉर्म: विस्तृत तुलना के लिए https://twitter.com/AlexSkidanov/status/1129511266660126720 दोनों में से

नगण्य नहीं है, हम यह नहीं मान सकते कि कांटे नहीं होंगे, भले ही शार्ड validators के बीच एक बीजान्टिन सहमति बन गई हो, या कई ब्लॉक बनाए गए हों राज्य परिवर्तन के साथ ब्लॉक के शीर्ष पर उत्पादन किया गया। इस समस्या के कई समाधान हैं, जिनमें से सबसे आम समाधान कभी-कभार होता है नवीनतम शार्ड चेन ब्लॉक को बीकन चेन से क्रॉस-लिंक करना। कांटा फिर शार्ड श्रृंखलाओं में चयन नियम को हमेशा उस श्रृंखला को प्राथमिकता देने के लिए बदल दिया जाता है क्रॉस-लिंक्ड, और केवल उन ब्लॉकों के लिए शार्ड-विशिष्ट कांटा-पसंद नियम लागू करें जो थे अंतिम क्रॉस-लिंक के बाद से प्रकाशित। 1.5.2 अमान्य ब्लॉकों को मंजूरी देना validators का एक सेट एक ब्लॉक बनाने का प्रयास कर सकता है जो राज्य संक्रमण फ़ंक्शन को गलत तरीके से लागू करता है। उदाहरण के लिए, उस राज्य से शुरू करना जिसमें ऐलिस इसमें 10 tokens हैं और बॉब के पास 0 tokens हैं, ब्लॉक में एक लेनदेन शामिल हो सकता है ऐलिस से बॉब तक 10 tokens भेजता है, लेकिन अंत में ऐलिस जैसी स्थिति आती है 0 tokens और बॉब के पास 1000 tokens हैं, जैसा कि चित्र 3 पर दिखाया गया है। चित्र 3: अमान्य ब्लॉक का एक उदाहरण क्लासिक नॉन-शार्डेड blockchain में ऐसा हमला संभव नहीं है, सब के बाद से नेटवर्क में भागीदार सभी ब्लॉकों को मान्य करता है, और ऐसे ब्लॉक को एक अमान्य राज्य परिवर्तन को अन्य दोनों ब्लॉक उत्पादकों द्वारा अस्वीकार कर दिया जाएगा, और नेटवर्क के प्रतिभागी जो ब्लॉक नहीं बनाते हैं। भले ही दुर्भावनापूर्ण हो validators ऐसे अमान्य ब्लॉक के ऊपर तेजी से ब्लॉक बनाना जारी रखते हैं ईमानदार validator सही श्रृंखला बनाते हैं, इस प्रकार श्रृंखला अमान्य के साथ होती है ब्लॉक लंबा है, इससे कोई फर्क नहीं पड़ता, क्योंकि प्रत्येक प्रतिभागी जो इसका उपयोग कर रहा है blockchain किसी भी उद्देश्य के लिए सभी ब्लॉकों को मान्य करता है, और सभी ब्लॉकों को हटा देता है अमान्य ब्लॉक के शीर्ष पर बनाया गया. चित्र 4 पर पाँच validator हैं, जिनमें से तीन दुर्भावनापूर्ण हैं। वे एक अमान्य ब्लॉक A' बनाया, और फिर शीर्ष पर नए ब्लॉक बनाना जारी रखा इसका. दो ईमानदार validator ने A' को अमान्य मानकर खारिज कर दिया और शीर्ष पर निर्माण कर रहे थेचित्र 4: गैर-साझा blockchain में एक अमान्य ब्लॉक बनाने का प्रयास उन्हें ज्ञात अंतिम वैध ब्लॉक का, एक कांटा बनाना। चूँकि कम हैं ईमानदार कांटे में validators, उनकी श्रृंखला छोटी होती है। हालाँकि, क्लासिक नॉनशार्डेड blockchain में प्रत्येक प्रतिभागी जो किसी भी उद्देश्य के लिए blockchain का उपयोग करता है वे प्राप्त सभी ब्लॉकों को मान्य करने और राज्य की पुनर्गणना करने के लिए जिम्मेदार हैं। इस प्रकार कोई भी व्यक्ति जिसकी blockchain में कोई रुचि है, वह यह देखेगा कि A' अमान्य है, और इस प्रकार बी', सी' और डी' को तुरंत हटा दें, जैसे कि लेना वर्तमान सबसे लंबी वैध श्रृंखला के रूप में श्रृंखला ए-बी। हालाँकि, शार्ड blockchain में, कोई भी भागीदार सभी शार्ड पर सभी लेनदेन को मान्य नहीं कर सकता है, इसलिए उन्हें इसकी पुष्टि करने का कोई तरीका होना चाहिए। blockchain के किसी भी टुकड़े के इतिहास में कोई भी अमान्य ब्लॉक शामिल नहीं किया गया था। ध्यान दें कि फोर्क्स के विपरीत, बीकन श्रृंखला से क्रॉस-लिंकिंग एक पर्याप्त समाधान नहीं है, क्योंकि बीकन श्रृंखला में सत्यापन करने की क्षमता नहीं है ब्लॉक. यह केवल यह सत्यापित कर सकता है कि उस शार्ड में पर्याप्त संख्या में validators हैं ब्लॉक पर हस्ताक्षर किए (और इस प्रकार इसकी सत्यता को प्रमाणित किया गया)। हम नीचे अनुभाग 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. यदि आपने इसे पहले पढ़ा है, तो अगले भाग पर जाएँ।

वे परस्पर क्रिया ब्लॉकों के कुछ वैध अनुक्रम और उस अनुक्रम का परिणाम है ब्लॉकों की संख्या वास्तव में शार्ड में विहित श्रृंखला है। एक समस्या जो नहीं है गैर-शार्ड blockchain में मौजूद है। हम सबसे पहले इस समस्या का एक सरल समाधान प्रस्तुत करेंगे जो प्रस्तावित किया गया है कई प्रोटोकॉल द्वारा और फिर विश्लेषण करें कि यह समाधान कैसे टूट सकता है और क्या इसे संबोधित करने का प्रयास किया गया है। 2.1 सत्यापनकर्ता रोटेशन वैधता बताने का सरल समाधान चित्र 5 पर दिखाया गया है: मान लीजिए कि हम मान लेते हैं पूरे सिस्टम में हजारों validators के ऑर्डर हैं, जिनमें से 20% से अधिक दुर्भावनापूर्ण नहीं हैं या अन्यथा विफल हो जाएंगे (जैसे कि होने में विफल होना)। एक ब्लॉक बनाने के लिए ऑनलाइन)। फिर यदि हम 200 validators का नमूना लेते हैं, तो संभावना 1 से अधिक का व्यावहारिक उद्देश्यों के लिए 3 विफलता को शून्य माना जा सकता है। चित्र 5: नमूनाकरण validators 1 3 एक महत्वपूर्ण सीमा है. सर्वसम्मति प्रोटोकॉल का एक परिवार है, जिसे कहा जाता है BFT सर्वसम्मति प्रोटोकॉल, जो 1 से कम समय तक इसकी गारंटी देता है 3 का प्रतिभागी विफल हो जाते हैं, या तो दुर्घटनाग्रस्त होकर या किसी ऐसे तरीके से कार्य करके जो इसका उल्लंघन करता है प्रोटोकॉल, सहमति बनेगी। ईमानदार validator प्रतिशत की इस धारणा के साथ, यदि वर्तमान सेट validators एक शार्ड में हमें कुछ ब्लॉक प्रदान करता है, अनुभवहीन समाधान मानता है कि ब्लॉक वैध है और यह validators के आधार पर बनाया गया है जब उन्होंने सत्यापन करना शुरू किया तो उस शार्ड के लिए विहित श्रृंखला। validators validators के पिछले सेट से विहित श्रृंखला सीखी, जो उसी के द्वारा ब्लॉक के शीर्ष पर बनी धारणा जो विहित श्रृंखला का प्रमुख थी उससे पहले. प्रेरण द्वारा पूरी श्रृंखला वैध है, और चूंकि validators का कोई सेट नहीं है किसी भी बिंदु पर कांटे उत्पन्न होने पर, सरल समाधान यह भी निश्चित है कि वर्तमान शृंखला शार्ड में एकमात्र श्रृंखला है। विज़ुअलाइज़ेशन के लिए चित्र 6 देखें।

चित्र 6: प्रत्येक ब्लॉक के साथ एक blockchain को BFT सर्वसम्मति के माध्यम से अंतिम रूप दिया गया यह सरल समाधान काम नहीं करता है अगर हम मान लें कि validators हो सकते हैं अनुकूल रूप से भ्रष्ट हो गया, जो एक अनुचित धारणा नहीं है6। अनुकूल रूप से 1000 शार्ड वाले सिस्टम में एक शार्ड को भ्रष्ट करना काफी सस्ता है पूरे सिस्टम को भ्रष्ट करने की तुलना में. इसलिए, प्रोटोकॉल की सुरक्षा शार्ड की संख्या के साथ रैखिक रूप से कम हो जाती है। की वैधता में निश्चितता होना एक ब्लॉक, हमें पता होना चाहिए कि इतिहास में किसी भी बिंदु पर सिस्टम में कोई भी टुकड़ा नहीं है अधिकांश validator मिलीभगत कर रहे हैं; अनुकूली प्रतिकूलताओं के साथ, अब हमारे पास नहीं है ऐसी निश्चितता. जैसा कि हमने अनुभाग 1.5 में चर्चा की, validator मिलकर व्यायाम कर सकते हैं दो बुनियादी दुर्भावनापूर्ण व्यवहार: फ़ोर्क्स बनाना, और अमान्य ब्लॉक उत्पन्न करना। दुर्भावनापूर्ण कांटों को बीकन श्रृंखला से क्रॉस-लिंक किए गए ब्लॉकों द्वारा संबोधित किया जा सकता है जिन्हें आम तौर पर तुलना में काफी अधिक सुरक्षा के लिए डिज़ाइन किया गया है शार्ड जंजीरें. हालाँकि, अमान्य ब्लॉक बनाना काफी अधिक है चुनौतीपूर्ण समस्या से निपटना। 2.2 राज्य की वैधता चित्र 7 पर विचार करें जिस पर शार्ड #1 दूषित है और एक दुर्भावनापूर्ण अभिनेता निर्माण करता है अमान्य ब्लॉक बी। मान लीजिए कि इस ब्लॉक बी में 1000 tokens को पतले से ढाला गया था ऐलिस के खाते पर प्रसारित। दुर्भावनापूर्ण अभिनेता तब वैध ब्लॉक सी (ए में) उत्पन्न करता है समझ में आता है कि सी में लेन-देन सही ढंग से लागू किया गया है) बी के शीर्ष पर, अस्पष्ट अमान्य ब्लॉक बी, और शार्ड #2 के लिए एक क्रॉस-शार्क लेनदेन शुरू करता है उन 1000 token को बॉब के खाते में स्थानांतरित करता है। इस क्षण से अनुचित रूप से निर्मित tokens शार्ड #2 में अन्यथा पूरी तरह से वैध blockchain पर रहते हैं। इस समस्या से निपटने के कुछ सरल उपाय हैं: 6पढ़ें यह आलेख के लिए विवरण पर कैसे अनुकूली भ्रष्टाचार कर सकते हैं हो ले जाया गया बाहर: https://medium.com/nearprotocol/d859adb464c8. के लिए अधिक विवरण पर अनुकूली भ्रष्टाचार, पढ़ें https://github.com/ethereum/wiki/wiki/Sharding-FAQ# वे सुरक्षा मॉडल क्या हैं जिनके तहत हम काम कर रहे हैंचित्र 7: एक श्रृंखला से एक क्रॉस-शार्क लेनदेन जिसमें एक अमान्य ब्लॉक है 1. शार्ड #2 के validators के लिए उस ब्लॉक को मान्य करने के लिए जिससे लेनदेन हुआ है आरंभ किया गया है. ब्लॉक सी के बाद से, यह उपरोक्त उदाहरण में भी काम नहीं करेगा पूर्णतः वैध प्रतीत होता है। 2. शार्ड #2 में validators के लिए उस ब्लॉक से पहले कुछ बड़ी संख्या में ब्लॉक को मान्य करना जिससे लेनदेन शुरू किया गया है। स्वाभाविक रूप से, के लिए किसी भी संख्या में ब्लॉक एन को दुर्भावनापूर्ण प्राप्तकर्ता द्वारा मान्य किया गया है validators अमान्य ब्लॉक के शीर्ष पर N+1 वैध ब्लॉक बना सकते हैं उत्पादित. इस समस्या को हल करने का एक आशाजनक विचार टुकड़ों को एक में व्यवस्थित करना होगा अप्रत्यक्ष ग्राफ़ जिसमें प्रत्येक शार्ड कई अन्य शार्डों से जुड़ा होता है, और केवल पड़ोसी शार्डों के बीच क्रॉस-शार्क लेनदेन की अनुमति दें (उदाहरण के लिए यह कैसे होता है)। व्लाद ज़म्फिर की शार्डिंग अनिवार्य रूप से काम करती है7, और इसी तरह का विचार कडेना में उपयोग किया जाता है चेनवेब [1])। यदि शार्डों के बीच क्रॉस-शार्ड लेन-देन की आवश्यकता है पड़ोसी नहीं, इस तरह का लेन-देन कई शार्डों के माध्यम से किया जाता है। इस डिज़ाइन में प्रत्येक शार्ड में एक validator से उनके शार्ड के सभी ब्लॉकों को मान्य करने की उम्मीद की जाती है साथ ही सभी पड़ोसी खंडों के सभी ब्लॉक। नीचे एक चित्र पर विचार करें 10 टुकड़ों के साथ, प्रत्येक में चार पड़ोसी होते हैं, और दो टुकड़ों के लिए अधिक की आवश्यकता नहीं होती है चित्र 8 पर दिखाए गए क्रॉस-शार्ड संचार के लिए दो हॉप से अधिक। शार्ड #2 न केवल अपने स्वयं के blockchain को मान्य कर रहा है, बल्कि blockchain को भी मान्य कर रहा है शारद #1 सहित सभी पड़ोसी। तो अगर शार्ड #1 पर एक दुर्भावनापूर्ण अभिनेता एक अमान्य ब्लॉक बी बनाने का प्रयास कर रहा है, फिर उसके ऊपर ब्लॉक सी बनाएं और एक क्रॉस-शार्क लेनदेन शुरू करें, ऐसा क्रॉस-शार्क लेनदेन नहीं चलेगा चूँकि शार्द #2 ने शार्द #1 के पूरे इतिहास को मान्य कर दिया होगा इससे यह अवैध ब्लॉक बी की पहचान कर सकेगा। 7डिज़ाइन के बारे में यहां और पढ़ें: https://medium.com/nearprotocol/37e538177ed9

चित्र 8: चेनवेब जैसी प्रणाली में एक अमान्य क्रॉस-शार्क लेनदेन जो होगा पता लगाओ जबकि एक भी टुकड़े को भ्रष्ट करना अब एक व्यवहार्य हमला नहीं है, एक को भ्रष्ट करना कुछ टुकड़े एक समस्या बने हुए हैं। चित्र 9 पर एक प्रतिद्वंद्वी दोनों शारद को भ्रष्ट कर रहा है

1 और शार्ड #2 शार्ड #3 के लिए एक क्रॉस-शार्क लेनदेन को सफलतापूर्वक निष्पादित करते हैं

अमान्य ब्लॉक बी से धन के साथ: चित्र 9: चेनवेब जैसी प्रणाली में एक अमान्य क्रॉस-शार्क लेनदेन जो होगा पता नहीं चलता शार्ड #3 शार्ड #2 में सभी ब्लॉकों को मान्य करता है, लेकिन शार्ड #1 में नहीं, और दुर्भावनापूर्ण ब्लॉक का पता लगाने का कोई तरीका नहीं है। राज्य की वैधता को ठीक से हल करने की दो प्रमुख दिशाएँ हैं: मछुआरे

और गणना के क्रिप्टोग्राफ़िक प्रमाण। 2.3 मछुआरा पहले दृष्टिकोण के पीछे का विचार निम्नलिखित है: जब भी कोई ब्लॉक हेडर किसी भी उद्देश्य के लिए श्रृंखलाओं के बीच संचार किया जाता है (जैसे कि क्रॉस-लिंकिंग)। बीकन श्रृंखला, या एक क्रॉस-शार्ड लेनदेन), के दौरान एक समयावधि होती है जिसे कोई भी ईमानदार validator यह प्रमाण दे सकता है कि ब्लॉक अमान्य है। वहाँ विभिन्न निर्माण हैं जो बहुत ही संक्षिप्त प्रमाण देते हैं कि ब्लॉक हैं अमान्य है, इसलिए प्राप्त नोड्स के लिए संचार ओवरहेड बहुत छोटा है पूर्ण ब्लॉक प्राप्त करने की तुलना में। इस दृष्टिकोण के साथ जब तक कम से कम एक ईमानदार validator है शार्ड, सिस्टम सुरक्षित है. चित्र 10: मछुआरा आज प्रस्तावित प्रोटोकॉल में यह प्रमुख दृष्टिकोण है (यह दिखावा करने के अलावा कि समस्या मौजूद नहीं है)। हालाँकि, इस दृष्टिकोण में दो हैं प्रमुख नुकसान: 1. ईमानदार validator के लिए चुनौती की अवधि काफी लंबी होनी चाहिए यह पहचानने के लिए कि कोई ब्लॉक तैयार किया गया है, इसे डाउनलोड करें, इसे पूरी तरह से सत्यापित करें और तैयार करें यदि ब्लॉक अमान्य है तो चुनौती। ऐसे कालखंड का परिचय होगा क्रॉस-शार्क लेनदेन को काफी धीमा कर दें। 2. चुनौती प्रोटोकॉल का अस्तित्व हमलों का एक नया वेक्टर बनाता है जब दुर्भावनापूर्ण नोड्स अमान्य चुनौतियों के साथ स्पैम करते हैं। एक स्पष्ट समाधान इस समस्या के लिए चुनौती देने वालों से token की कुछ राशि जमा कराना है यदि चुनौती वैध है तो लौटा दी जाती है। यह केवल एक आंशिक समाधान है, जैसा कि यह है प्रतिद्वंद्वी के लिए सिस्टम को स्पैम करना (और जलाना) अभी भी फायदेमंद हो सकता है जमा) अमान्य चुनौतियों के साथ, उदाहरण के लिए वैध को रोकने के लिएएक ईमानदार validator से गुजरने की चुनौती। ये हमले हैं दुःखदायी आक्रमण कहा जाता है। बाद वाले बिंदु से बचने के तरीके के लिए अनुभाग 3.7.2 देखें। 2.4 ज्ञान के संक्षिप्त गैर-संवादात्मक तर्क मल्टीपल-शार्ड भ्रष्टाचार का दूसरा समाधान कुछ प्रकार के क्रिप्टोग्राफ़िक निर्माणों का उपयोग करना है जो किसी को यह साबित करने की अनुमति देता है कि एक निश्चित गणना (जैसे) लेनदेन के एक सेट से एक ब्लॉक की गणना के रूप में) सही ढंग से किया गया था। ऐसे निर्माण मौजूद हैं, उदा. zk-SNARKs, zk-STARKs और कुछ अन्य, और कुछ आज निजी भुगतान के लिए blockchain प्रोटोकॉल में सक्रिय रूप से उपयोग किए जाते हैं, सबसे विशेष रूप से ZCash। ऐसे आदिम लोगों के साथ प्राथमिक समस्या यह है कि वे गणना करने में बेहद धीमे हैं। जैसे कोडा प्रोटोकॉल, जो zk-SNARKs का उपयोग करता है विशेष रूप से यह साबित करने के लिए कि blockchain में सभी ब्लॉक वैध हैं, एक में कहा गया है साक्षात्कारों में कहा गया है कि प्रमाण बनाने में प्रति लेनदेन 30 सेकंड का समय लग सकता है (यह संख्या शायद अब तक छोटी है)। दिलचस्प बात यह है कि, किसी प्रमाण की गणना किसी विश्वसनीय पक्ष द्वारा करने की आवश्यकता नहीं है प्रमाण न केवल उस गणना की वैधता को प्रमाणित करता है जिसके लिए इसे बनाया गया है, बल्कि प्रमाण की वैधता ही. इस प्रकार, ऐसे प्रमाणों की गणना को विभाजित किया जा सकता है प्रतिभागियों के एक समूह के बीच, जिनकी अतिरेकता काफी कम होगी कुछ भरोसेमंद गणना करने के लिए आवश्यक है। यह प्रतिभागियों को भी अनुमति देता है जो बिना कम किए विशेष हार्डवेयर पर चलने के लिए zk-SNARKs की गणना करते हैं व्यवस्था का विकेंद्रीकरण. प्रदर्शन के अलावा, zk-SNARKs की चुनौतियाँ हैं: 1. कम शोध और कम समय में परीक्षण किए गए क्रिप्टोग्राफ़िक प्राइमेटिव्स पर निर्भरता; 2. "विषाक्त अपशिष्ट" - zk-SNARKs एक विश्वसनीय सेटअप पर निर्भर करते हैं जिसमें एक समूह होता है लोग कुछ गणना करते हैं और फिर मध्यवर्ती को हटा देते हैं उस गणना के मान. यदि प्रक्रिया में सभी भागीदार मिलीभगत करते हैं और मध्यवर्ती मूल्यों को बनाए रखें, नकली प्रमाण बनाए जा सकते हैं; 3. सिस्टम डिज़ाइन में अतिरिक्त जटिलता पेश की गई; 4. zk-SNARKs केवल संभावित गणनाओं के सबसेट के लिए काम करते हैं, इसलिए एक प्रोटोकॉल ट्यूरिंग-पूर्ण के साथ smart contract भाषा का उपयोग नहीं किया जा सकेगा श्रृंखला की वैधता साबित करने के लिए SNARKs। 2.5 डेटा उपलब्धता दूसरी समस्या जिस पर हम बात करेंगे वह है डेटा उपलब्धता। आम तौर पर नोड्स किसी विशेष blockchain को संचालित करने को दो समूहों में विभाजित किया गया है: पूर्ण नोड्स, वे जो प्रत्येक पूर्ण ब्लॉक को डाउनलोड करते हैं और प्रत्येक लेनदेन को मान्य करते हैं, और लाइट नोड्स, वे जो केवल ब्लॉक हेडर डाउनलोड करते हैं, और भागों के लिए मर्कल प्रूफ़ का उपयोग करते हैं जिस स्थिति और लेन-देन में उनकी रुचि है, जैसा कि चित्र 11 में दिखाया गया है।

चित्र 11: मर्कल वृक्ष अब यदि अधिकांश पूर्ण नोड्स मिलीभगत करते हैं, तो वे एक ब्लॉक, वैध या उत्पन्न कर सकते हैं अमान्य है, और इसके hash को लाइट नोड्स पर भेजें, लेकिन कभी भी पूरी सामग्री का खुलासा न करें ब्लॉक का. ऐसे कई तरीके हैं जिनसे वे इससे लाभ उठा सकते हैं। उदाहरण के लिए, चित्र 12 पर विचार करें: चित्र 12: डेटा उपलब्धता समस्या तीन ब्लॉक हैं: पिछला, ए, ईमानदार validators द्वारा निर्मित है; वर्तमान, बी, में validators की मिलीभगत है; और अगला, सी, भी निर्मित किया जाएगा ईमानदार validators द्वारा (blockchain को निचले दाएं कोने में दर्शाया गया है)। आप एक व्यापारी हैं. वर्तमान ब्लॉक (बी) के validators को ब्लॉक प्राप्त हुआ पिछले validators से A ने एक ब्लॉक की गणना की जिसमें आपको धन प्राप्त होता है,और आपको उस ब्लॉक का एक हेडर भेजा है जिसमें उस स्थिति का मर्कल प्रमाण शामिल है आपके पास पैसा है (या वैध लेनदेन का मर्कल प्रमाण जो पैसा भेजता है आपके लिए)। आश्वस्त रहें कि लेन-देन पूरा हो गया है, आप सेवा प्रदान करते हैं। हालाँकि, validators कभी भी ब्लॉक B की पूरी सामग्री वितरित नहीं करते हैं कोई भी. इस प्रकार, ब्लॉक सी के ईमानदार validators ब्लॉक को पुनः प्राप्त नहीं कर सकते हैं, और या तो सिस्टम को रोकने या ए के शीर्ष पर निर्माण करने के लिए मजबूर किया जाता है, जिससे आप वंचित रह जाते हैं पैसे का व्यापारी. जब हम उसी परिदृश्य को शार्डिंग पर लागू करते हैं, तो पूर्ण और की परिभाषाएँ लाइट नोड आम तौर पर प्रति शार्ड पर लागू होता है: प्रत्येक शार्ड डाउनलोड में validators उस शार्ड को ब्लॉक करें और उस शार्ड के प्रत्येक लेन-देन को मान्य करें, लेकिन अन्य सिस्टम में नोड्स, जिनमें स्नैपशॉट शार्ड चेन शामिल हैं बीकन श्रृंखला, केवल हेडर डाउनलोड करें। इस प्रकार शार्ड में validators हैं उस शार्ड के लिए प्रभावी रूप से पूर्ण नोड्स, जबकि सिस्टम में अन्य प्रतिभागी, बीकन श्रृंखला सहित, प्रकाश नोड्स के रूप में कार्य करें। काम करने के लिए जिस मछुआरे दृष्टिकोण की हमने ऊपर चर्चा की, उसके लिए ईमानदार validators बीकन श्रृंखला से क्रॉस-लिंक किए गए ब्लॉक डाउनलोड करने में सक्षम होने की आवश्यकता है। यदि दुर्भावनापूर्ण validators ने किसी अमान्य ब्लॉक के हेडर को क्रॉस-लिंक किया है (या इसका उपयोग किया है) एक क्रॉस-शार्ड लेन-देन शुरू करें), लेकिन कभी भी ब्लॉक वितरित नहीं किया, ईमानदार validator के पास चुनौती तैयार करने का कोई तरीका नहीं है। हम इस समस्या के समाधान के लिए तीन दृष्टिकोणों को शामिल करेंगे जो पूरक हैं एक दूसरे. 2.5.1 हिरासत के सबूत हल की जाने वाली सबसे तात्कालिक समस्या यह है कि क्या कोई ब्लॉक एक बार उपलब्ध है यह प्रकाशित हो चुकी है।. एक प्रस्तावित विचार तथाकथित नोटरी रखने का है जो घूमते रहें validators से अधिक बार शार्ड के बीच जिनका एकमात्र काम डाउनलोड करना है ब्लॉक करें और इस तथ्य की पुष्टि करें कि वे इसे डाउनलोड करने में सक्षम थे। वे हो सकते हैं अधिक बार घुमाया जाता है क्योंकि उन्हें पूरे राज्य को डाउनलोड करने की आवश्यकता नहीं होती है शार्ड का, validators के विपरीत, जिन्हें बार-बार घुमाया नहीं जा सकता है हर बार घूमने पर शार्ड की स्थिति को डाउनलोड करना होगा, जैसा कि चित्र में दिखाया गया है 13. इस अनुभवहीन दृष्टिकोण के साथ समस्या यह है कि इसे बाद में साबित करना असंभव है क्या नोटरी ब्लॉक डाउनलोड करने में सक्षम था या नहीं, इसलिए एक नोटरी वे हमेशा यह प्रमाणित करना चुन सकते हैं कि वे बिना ब्लॉक डाउनलोड करने में सक्षम थे यहां तक कि इसे पुनः प्राप्त करने का प्रयास भी किया जा रहा है। इसका एक समाधान नोटरी द्वारा प्रदान किया जाना है कुछ सबूत या tokens की कुछ राशि को दांव पर लगाने के लिए यह प्रमाणित करना कि ब्लॉक था डाउनलोड किया गया। ऐसे ही एक समाधान पर यहां चर्चा की गई है: https://ethresear.ch/t/ 1-बिट-एकत्रीकरण-अनुकूल-अभिरक्षा-बंधन/2236। 2.5.2 मिटाने के कोड जब किसी विशेष प्रकाश नोड को ब्लॉक का hash प्राप्त होता है, तो नोड की रोशनी बढ़ाने के लिए यह विश्वास करते हुए कि ब्लॉक उपलब्ध है, यह कुछ यादृच्छिक डाउनलोड करने का प्रयास कर सकता है ब्लॉक के टुकड़े. यह एक पूर्ण समाधान नहीं है, जब तक कि प्रकाश नोड्स न हों संपूर्ण ब्लॉक को सामूहिक रूप से डाउनलोड करें जिसे दुर्भावनापूर्ण ब्लॉक निर्माता चुन सकते हैं

चित्र 13: सत्यापनकर्ताओं को स्थिति डाउनलोड करने की आवश्यकता होती है और इस प्रकार उसे घुमाया नहीं जा सकता अक्सर ब्लॉक के उन हिस्सों को रोकना जो किसी भी लाइट नोड द्वारा डाउनलोड नहीं किए गए थे, इस प्रकार ब्लॉक अभी भी अनुपलब्ध है। इसे संभव बनाने के लिए एक समाधान इरेज़र कोड्स नामक निर्माण का उपयोग करना है पूर्ण ब्लॉक को पुनर्प्राप्त करने के लिए, भले ही ब्लॉक का केवल कुछ भाग उपलब्ध हो, जैसा कि दिखाया गया है चित्र 14 पर. चित्र 14: Merkle tree को इरेज़र कोडित डेटा के शीर्ष पर बनाया गया है Polkadot और Ethereum दोनों सेरेनिटी के पास इस विचार के आसपास डिज़ाइन हैं कि प्रकाश नोड्स के लिए उचित रूप से आश्वस्त होने का एक तरीका प्रदान करें कि ब्लॉक उपलब्ध हैं। Ethereum सेरेनिटी दृष्टिकोण का [2] में विस्तृत विवरण है।2.5.3 डेटा उपलब्धता के लिए Polkadot का दृष्टिकोण Polkadot में, अधिकांश शार्ड समाधानों की तरह, प्रत्येक शार्ड (जिसे पैराचेन कहा जाता है) अपने ब्लॉक को बीकन श्रृंखला (रिले चेन कहा जाता है) पर स्नैपशॉट करता है। मान लीजिए कि 2f + 1 हैं रिले श्रृंखला पर validators। पैराचेन ब्लॉकों के ब्लॉक उत्पादकों को बुलाया गया कोलेटर्स, एक बार जब पैराचेन ब्लॉक का उत्पादन हो जाता है तो ब्लॉक के इरेज़र कोडित संस्करण की गणना करें जिसमें 2f +1 भाग होते हैं जैसे कि कोई भी f भाग पर्याप्त हो ब्लॉक का पुनर्निर्माण करने के लिए. फिर वे प्रत्येक validator को एक भाग वितरित करते हैं रिले श्रृंखला. एक विशेष रिले श्रृंखला validator केवल रिले श्रृंखला पर हस्ताक्षर करेगी ब्लॉक करें यदि उनके पास स्नैपशॉट किए गए प्रत्येक पैराचेन ब्लॉक के लिए उनका हिस्सा है ऐसे रिले चेन ब्लॉक। इस प्रकार, यदि रिले चेन ब्लॉक में 2f + 1 से हस्ताक्षर हैं validators, और जब तक उनमें से f से अधिक ने प्रोटोकॉल का उल्लंघन नहीं किया, प्रत्येक पैराचेन ब्लॉक का पुनर्निर्माण validators से भागों को लाकर किया जा सकता है जो प्रोटोकॉल का पालन करें. चित्र 15 देखें। चित्र 15: Polkadot की डेटा उपलब्धता 2.5.4 दीर्घकालिक डेटा उपलब्धता ध्यान दें कि ऊपर चर्चा किए गए सभी दृष्टिकोण केवल इस तथ्य की पुष्टि करते हैं कि एक ब्लॉक बिल्कुल प्रकाशित हुआ था, और अब उपलब्ध है। ब्लॉक बाद में अनुपलब्ध हो सकते हैं विभिन्न कारणों से: नोड्स ऑफ़लाइन हो रहे हैं, नोड्स जानबूझकर ऐतिहासिक मिटा रहे हैं डेटा, और अन्य। उल्लेखनीय श्वेतपत्र जो इस मुद्दे को संबोधित करता है वह है पॉलीशर्ड [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 टुकड़ों की जंजीरों से लेकर टुकड़ों के टुकड़ों तक शार्ड चेन और बीकन चेन वाला शार्डिंग मॉडल बहुत शक्तिशाली है लेकिन कुछ जटिलताएँ हैं। विशेष रूप से, कांटा चयन नियम को क्रियान्वित करने की आवश्यकता है प्रत्येक श्रृंखला में अलग-अलग, शार्ड श्रृंखला और बीकन में कांटा चयन नियम श्रृंखला अलग-अलग बनाई जानी चाहिए और अलग से परीक्षण किया जाना चाहिए। नाइटशेड में हम सिस्टम को एकल blockchain के रूप में मॉडल करते हैं, जिसमें प्रत्येक ब्लॉक में तार्किक रूप से सभी शार्क के लिए सभी लेन-देन शामिल होते हैं, और परिवर्तन होता है सभी टुकड़ों की संपूर्ण स्थिति। हालाँकि, भौतिक रूप से, कोई भी प्रतिभागी इसे डाउनलोड नहीं करता है पूर्ण अवस्था या पूर्ण तार्किक ब्लॉक। इसके बजाय, केवल नेटवर्क का प्रत्येक भागीदार उस स्थिति को बनाए रखता है जो उन टुकड़ों से मेल खाती है जिनके लिए वे लेनदेन को मान्य करते हैं, और ब्लॉक में सभी लेनदेन की सूची भौतिक में विभाजित होती है टुकड़े, प्रति टुकड़ा एक टुकड़ा। आदर्श परिस्थितियों में प्रत्येक ब्लॉक में प्रति टुकड़ा ठीक एक टुकड़ा होता है ब्लॉक, जो मोटे तौर पर शार्ड चेन वाले मॉडल से मेल खाता है जिसमें शार्ड चेन बीकन चेन के समान गति से ब्लॉक उत्पन्न करती हैं। हालाँकि, नेटवर्क में देरी के कारण कुछ हिस्से गायब हो सकते हैं, इसलिए व्यवहार में प्रत्येक ब्लॉक प्रति टुकड़े में एक या शून्य टुकड़े होते हैं। कैसे के विवरण के लिए अनुभाग 3.3 देखें ब्लॉक तैयार किये जाते हैं। चित्र 16: बायीं ओर शार्ड चेन वाला और एक चेन वाला मॉडल ब्लॉक दाईं ओर टुकड़ों में विभाजित हो गए

3.2 आम सहमति आज blockchains में सर्वसम्मति के लिए दो प्रमुख दृष्टिकोण हैं सबसे लंबी (या सबसे भारी) श्रृंखला, जिसमें सबसे अधिक काम या हिस्सेदारी वाली श्रृंखला हो इसे बनाने के लिए उपयोग किया गया इसे विहित माना जाता है, और BFT, जिसमें प्रत्येक ब्लॉक के लिए कुछ validators का सेट BFT आम सहमति पर पहुंचता है। हाल ही में प्रस्तावित प्रोटोकॉल में उत्तरार्द्ध अधिक प्रभावी दृष्टिकोण है, चूँकि यह तत्काल अंतिमता प्रदान करता है, जबकि सबसे लंबी श्रृंखला में अधिक ब्लॉक की आवश्यकता होती है अंतिमता सुनिश्चित करने के लिए ब्लॉक के शीर्ष पर बनाया जाना है। अक्सर किसी सार्थक के लिए सुरक्षा के लिए पर्याप्त संख्या में ब्लॉक बनाने में समय लगता है घंटों का क्रम. प्रत्येक ब्लॉक पर BFT सर्वसम्मति का उपयोग करने के नुकसान भी हैं, जैसे: 1. BFT सर्वसम्मति में काफी मात्रा में संचार शामिल होता है। जबकि हाल की प्रगति से संख्या में रैखिक समय में आम सहमति तक पहुंचना संभव हो गया है प्रतिभागियों की (उदाहरण देखें [4]), यह अभी भी प्रति ब्लॉक ध्यान देने योग्य ओवरहेड है; 2. सभी नेटवर्क प्रतिभागियों के लिए BFT में भाग लेना संभव नहीं है प्रति ब्लॉक सर्वसम्मति, इस प्रकार आमतौर पर प्रतिभागियों का केवल यादृच्छिक रूप से नमूना किया गया उपसमूह ही सर्वसम्मति तक पहुंचता है। एक बेतरतीब ढंग से नमूना सेट, सिद्धांत रूप में, हो सकता है अनुकूल रूप से भ्रष्ट, और सिद्धांत में एक कांटा बनाया जा सकता है। सिस्टम या तो ऐसे आयोजन के लिए तैयार रहने के लिए मॉडल तैयार करने की आवश्यकता है, और इस प्रकार अभी भी BFT सर्वसम्मति के अलावा एक कांटा-चयन नियम रखें, या बंद करने के लिए डिज़ाइन किया जाए ऐसी घटना में नीचे. यह उल्लेखनीय है कि कुछ डिज़ाइन, जैसे कि Algorand [5], अनुकूली भ्रष्टाचार की संभावना को काफी कम कर देता है। 3. सबसे महत्वपूर्ण बात यह है कि सिस्टम रुक जाता है यदि 1 सभी प्रतिभागियों में से 3 या अधिक हैं ओफ़िन. इस प्रकार, कोई भी अस्थायी नेटवर्क गड़बड़ी या नेटवर्क विभाजन सिस्टम को पूरी तरह से ठप कर सकता है। आदर्श रूप से सिस्टम को जारी रखने में सक्षम होना चाहिए तब तक काम करें जब तक कम से कम आधे प्रतिभागी ऑनलाइन हों (सबसे भारी)। भले ही आधे से कम प्रतिभागी ऑनलाइन हों, फिर भी श्रृंखला-आधारित प्रोटोकॉल चालू रहते हैं, लेकिन इस संपत्ति की वांछनीयता अधिक विवादास्पद है समुदाय के भीतर)। एक हाइब्रिड मॉडल जिसमें सर्वसम्मति का उपयोग किया जाता है वह किसी प्रकार का सबसे भारी होता है श्रृंखला, लेकिन कुछ ब्लॉकों को समय-समय पर BFT अंतिम गैजेट का उपयोग करके अंतिम रूप दिया जाता है, जो दोनों मॉडलों के फायदे बनाए रखता है। ऐसे BFT अंतिम गैजेट हैं कैस्पर FFG [6] का उपयोग Ethereum 2.0 8, कैस्पर CBC में किया जाता है (देखें https://vitalik. ca/general/2018/12/05/cbc_casper.html) और दादाजी (https:// देखें) मीडियम.com/polkadot-network/d08a24a021b5) Polkadot में उपयोग किया जाता है। नाइटशेड सबसे भारी श्रृंखला सर्वसम्मति का उपयोग करता है। विशेष रूप से जब कोई ब्लॉक निर्माता एक ब्लॉक बनाता है (अनुभाग 3.3 देखें), वे उससे हस्ताक्षर एकत्र कर सकते हैं अन्य ब्लॉक निर्माता और validator पिछले ब्लॉक को प्रमाणित कर रहे हैं। अनुभाग देखें 3.8 विवरण के लिए कि इतनी बड़ी संख्या में हस्ताक्षर कैसे एकत्र किए जाते हैं। वजन 8कैस्पर के गहन अवलोकन के लिए जस्टिन ड्रेक के साथ व्हाइटबोर्ड सत्र भी देखें एफएफजी, और इसे GHOST की सबसे भारी श्रृंखला सर्वसम्मति के साथ कैसे एकीकृत किया गया है: https://www. youtube.com/watch?v=S262StTwkmoएक ब्लॉक का मतलब उन सभी हस्ताक्षरकर्ताओं की संचयी हिस्सेदारी है जिनके हस्ताक्षर हैं ब्लॉक में शामिल है. एक श्रृंखला का वजन ब्लॉक वजन का योग है। सबसे भारी श्रृंखला सर्वसम्मति के शीर्ष पर हम एक अंतिम गैजेट का उपयोग करते हैं जो उपयोग करता है ब्लॉकों को अंतिम रूप देने के लिए सत्यापन। सिस्टम की जटिलता को कम करने के लिए, हम एक अंतिम गैजेट का उपयोग करते हैं जो किसी भी तरह से कांटा चयन नियम को प्रभावित नहीं करता है, और इसके बजाय केवल अतिरिक्त स्लैशिंग शर्तों का परिचय देता है, जैसे कि एक बार ब्लॉक हो जाता है अंतिम गैजेट द्वारा अंतिम रूप दिया गया, एक कांटा तब तक असंभव है जब तक कि बहुत बड़ा प्रतिशत न हो कुल हिस्सेदारी में से कटौती की गई है। कैस्पर सीबीसी एक ऐसा अंतिम गैजेट है, और हम वर्तमान में कैस्पर सीबीसी को ध्यान में रखकर मॉडल तैयार किया जा रहा है। हम TxFlow नामक एक अलग BFT प्रोटोकॉल पर भी काम करते हैं। के समय इस दस्तावेज़ को लिखते समय यह स्पष्ट नहीं है कि कैस्पर के स्थान पर TxFlow का उपयोग किया जाएगा या नहीं सीबीसी. हालाँकि, हम ध्यान दें कि अंतिम गैजेट का चुनाव बाकी डिज़ाइन के लिए काफी हद तक ऑर्थोगोनल है। 3.3 ब्लॉक उत्पादन नाइटशेड में दो भूमिकाएँ हैं: ब्लॉक निर्माता और validators। किसी भी समय बिंदु पर सिस्टम में w ब्लॉक निर्माता, हमारे मॉडल में w = 100, और wv शामिल हैं validators, हमारे मॉडल में v = 100, wv = 10,000। सिस्टम प्रूफ़-ऑफ़-स्टेक है, इसका मतलब है कि ब्लॉक उत्पादकों और validators दोनों के पास कुछ संख्या में आंतरिक हैं मुद्रा (जिसे ''tokens'' कहा जाता है) इससे कहीं अधिक समय के लिए लॉक की गई है वे श्रृंखला के निर्माण और सत्यापन के अपने कर्तव्यों को निभाने में समय व्यतीत करते हैं। सभी प्रूफ़ ऑफ़ स्टेक सिस्टम की तरह, सभी डब्ल्यू ब्लॉक उत्पादकों और नहीं सभी wv validators अलग-अलग इकाइयाँ हैं, क्योंकि उन्हें लागू नहीं किया जा सकता है। प्रत्येक हालाँकि, w ब्लॉक उत्पादकों और wv validators में एक अलग है दांव. सिस्टम में हमारे मॉडल में n शार्ड, n = 1000 शामिल हैं। जैसा कि उल्लेख किया गया है सेक्शन 3.1, नाइटशेड में कोई शार्ड चेन नहीं हैं, इसके बजाय सभी ब्लॉक निर्माता और validator एक एकल blockchain का निर्माण कर रहे हैं, जिसे हम कहते हैं मुख्य श्रृंखला. मुख्य श्रृंखला की स्थिति को n शार्ड और प्रत्येक ब्लॉक में विभाजित किया गया है निर्माता और validator ने किसी भी समय स्थानीय स्तर पर केवल इसका एक उपसमूह डाउनलोड किया है वह स्थिति जो शार्ड के कुछ सबसेट से मेल खाती है, और केवल प्रक्रिया और राज्य के उन हिस्सों को प्रभावित करने वाले लेनदेन को मान्य करें। ब्लॉक निर्माता बनने के लिए, नेटवर्क का एक भागीदार कुछ बड़े को लॉक करता है tokens की राशि (एक हिस्सेदारी)। नेटवर्क का रखरखाव युगों में किया जाता है, जहाँ एक युग दिनों के क्रम में एक समयावधि है। प्रतिभागियों किसी विशेष युग की शुरुआत में सबसे बड़े दांव के साथ ब्लॉक होते हैं उस युग के निर्माता। प्रत्येक ब्लॉक निर्माता को एसडब्ल्यू शार्ड्स को सौंपा गया है, (मान लीजिए sw = 40, जो sww/n = 4 ब्लॉक उत्पादक प्रति शार्ड बना देगा)। ब्लॉक निर्माता उस शार्ड की स्थिति को डाउनलोड करता है जिसे युग से पहले सौंपा गया है शुरू होता है, और पूरे युग में उस हिस्से को प्रभावित करने वाले लेन-देन एकत्र करता है, और उन्हें राज्य पर लागू करता है। मुख्य श्रृंखला पर प्रत्येक ब्लॉक बी के लिए, और प्रत्येक शार्ड्स के लिए, इनमें से एक है एस को ब्लॉक उत्पादकों को सौंपा गया है जो बी से संबंधित भाग का उत्पादन करने के लिए जिम्मेदार है ठीकरे को. शार्ड एस से संबंधित बी के भाग को चंक कहा जाता है, और इसमें शामिल होता है शार्ड के लिए लेन-देन की सूची बी के साथ-साथ मर्कल में भी शामिल की जाएगीपरिणामी अवस्था की जड़. b में अंततः केवल एक बहुत छोटा हेडर होगा हिस्सा, अर्थात् सभी लागू लेन-देन का मर्कल रूट (अनुभाग देखें)। सटीक विवरण के लिए 3.7.1), और अंतिम स्थिति का मर्कल रूट। पूरे दस्तावेज़ में हम अक्सर ब्लॉक निर्माता का उल्लेख करते हैं जो एक विशेष टुकड़े के लिए एक विशेष समय पर एक टुकड़ा तैयार करने के लिए जिम्मेदार है एक खंड निर्माता के रूप में। चंक निर्माता हमेशा ब्लॉक उत्पादकों में से एक होता है। ब्लॉक निर्माता और चंक निर्माता प्रत्येक ब्लॉक को उसके अनुसार घुमाते हैं एक निश्चित कार्यक्रम के लिए. ब्लॉक उत्पादकों के पास ऑर्डर होता है और वे बार-बार उत्पादन करते हैं उस क्रम में ब्लॉक. जैसे यदि 100 ब्लॉक उत्पादक हैं, तो पहला ब्लॉक निर्माता ब्लॉक 1, 101, 201 आदि के उत्पादन के लिए जिम्मेदार है, दूसरा है 2, 102, 202 आदि के उत्पादन के लिए जिम्मेदार)। चूंकि खंड उत्पादन के विपरीत, खंड उत्पादन को रखरखाव की आवश्यकता होती है राज्य, और प्रत्येक शार्ड के लिए केवल sww/n ब्लॉक निर्माता ही राज्य को बनाए रखते हैं प्रति शार्ड, तदनुसार केवल वे sww/n ब्लॉक निर्माता बनाने के लिए घूमते हैं टुकड़े. जैसे उपरोक्त स्थिरांक के साथ चार ब्लॉक उत्पादकों को सौंपा गया प्रत्येक शार्ड, प्रत्येक ब्लॉक निर्माता प्रत्येक चार ब्लॉक में एक बार खंड बनाएगा। 3.4 डेटा उपलब्धता सुनिश्चित करना डेटा उपलब्धता सुनिश्चित करने के लिए हम Polkadot के समान दृष्टिकोण का उपयोग करते हैं खंड 2.5.3 में वर्णित है। एक बार जब कोई ब्लॉक निर्माता एक टुकड़ा तैयार कर लेता है, तो वे निर्माण करते हैं इष्टतम (w, ⌊w/6 + 1⌋) ब्लॉक कोड के साथ इसका एक इरेज़र कोडित संस्करण टुकड़ा. फिर वे इरेज़र कोडित खंड का एक टुकड़ा भेजते हैं (हम ऐसे टुकड़े कहते हैं प्रत्येक ब्लॉक निर्माता को टुकड़ों के हिस्से, या सिर्फ हिस्से)। हम एक मर्केल पेड़ की गणना करते हैं जिसमें पत्तियों और अन्य सभी भाग शामिल होते हैं प्रत्येक टुकड़े के शीर्षलेख में ऐसे पेड़ की मर्केल जड़ होती है। भागों को वनपार्ट संदेशों के माध्यम से validators पर भेजा जाता है। ऐसा प्रत्येक संदेश इसमें चंक हेडर, भाग का क्रमसूचक और भाग सामग्री शामिल है। द संदेश में उस ब्लॉक निर्माता के हस्ताक्षर भी शामिल हैं जिसने इसे बनाया है यह साबित करने के लिए कि भाग हेडर से मेल खाता है, खंड और मर्कल पथ और उचित ब्लॉक निर्माता द्वारा उत्पादित किया जाता है। एक बार जब ब्लॉक निर्माता को मुख्य श्रृंखला ब्लॉक प्राप्त हो जाता है, तो वे पहले जांच करते हैं कि क्या ब्लॉक में शामिल प्रत्येक भाग के लिए एक-भाग संदेश रखें। यदि नहीं, तो ब्लॉक तब तक संसाधित नहीं किया जाता जब तक कि गुम हुए वनपार्ट संदेशों को पुनः प्राप्त नहीं कर लिया जाता। एक बार जब सभी वनपार्ट संदेश प्राप्त हो जाते हैं, तो ब्लॉक निर्माता उन्हें प्राप्त कर लेता है साथियों से शेष भाग और उन हिस्सों का पुनर्निर्माण करता है जिनके लिए वे रखते हैं राज्य. यदि कम से कम एक के लिए ब्लॉक निर्माता मुख्य श्रृंखला ब्लॉक को संसाधित नहीं करता है ब्लॉक में शामिल चंक के पास संबंधित वनपार्ट संदेश नहीं है, या यदि कम से कम एक शार्ड के लिए वे उस स्थिति को बनाए रखते हैं तो वे ऐसा नहीं कर सकते पूरे हिस्से का पुनर्निर्माण करें. किसी विशेष खंड के उपलब्ध होने के लिए ब्लॉक का ⌊w/6⌋+1 होना पर्याप्त है निर्माताओं के पास अपने हिस्से हैं और वे उनकी सेवा करते हैं। इस प्रकार, जब तक की संख्या दुर्भावनापूर्ण अभिनेता ⌊w/3⌋ से अधिक नहीं है, ऐसी कोई श्रृंखला नहीं है जिसमें आधे से अधिक ब्लॉक हो इसे बनाने वाले निर्माताओं के पास अनुपलब्ध हिस्से हो सकते हैं।चित्र 17: प्रत्येक ब्लॉक में प्रति टुकड़े एक या शून्य टुकड़े होते हैं, और प्रत्येक टुकड़े में मिटाना कोडित है. इरेज़र कोडित खंड का प्रत्येक भाग एक निर्दिष्ट व्यक्ति को भेजा जाता है एक विशेष वनपार्ट संदेश के माध्यम से निर्माता को ब्लॉक करें 3.4.1 आलसी ब्लॉक उत्पादकों से निपटना यदि किसी ब्लॉक निर्माता के पास एक ब्लॉक है जिसके लिए एक भाग का संदेश गायब है, तो वे हो सकता है कि वह अभी भी इस पर हस्ताक्षर करना चुने, क्योंकि यदि ब्लॉक अंतत: श्रृंखला पर होता है ब्लॉक निर्माता के लिए अधिकतम इनाम होगा। ब्लॉक के लिए कोई जोखिम नहीं है निर्माता क्योंकि बाद में यह साबित करना असंभव है कि ब्लॉक निर्माता के पास नहीं था एक भाग का संदेश. इसका समाधान करने के लिए हम खंड बनाते समय प्रत्येक खंड को निर्माता बनाते हैं भविष्य में एन्कोड किए गए हिस्से के प्रत्येक भाग के लिए एक रंग (लाल या नीला) चुनें और स्टोर करें एन्कोड होने से पहले टुकड़े में निर्दिष्ट रंग का बिटमास्क। हर एक भाग संदेश में भाग को निर्दिष्ट रंग शामिल होता है, और जब रंग का उपयोग किया जाता है एन्कोडेड भागों के मर्कल रूट की गणना करना। यदि खंड निर्माता भटक जाता है प्रोटोकॉल से, इसे आसानी से सिद्ध किया जा सकता है, क्योंकि या तो मर्कल रूट नहीं होगा एक भाग वाले संदेशों के अनुरूप, या एक भाग वाले संदेशों में रंग मर्केल रूट के अनुरूप टुकड़े में मास्क से मेल नहीं खाएगा। जब कोई ब्लॉक निर्माता किसी ब्लॉक पर हस्ताक्षर करता है, तो उनमें सभी का एक बिटमास्क शामिल होता है ब्लॉक में शामिल टुकड़ों के लिए उन्हें लाल हिस्से मिले। एक प्रकाशन गलत बिटमास्क एक स्लैश करने योग्य व्यवहार है। यदि किसी ब्लॉक निर्माता को प्राप्त नहीं हुआ है एक भाग का संदेश, उनके पास संदेश का रंग जानने का कोई तरीका नहीं है, और इस प्रकार यदि वे बिना सोचे-समझे हस्ताक्षर करने का प्रयास करते हैं तो उन्हें नौकरी से निकाले जाने की 50% संभावना है ब्लॉक. 3.5 राज्य परिवर्तन आवेदन चंक उत्पादक केवल यह चुनते हैं कि किस लेन-देन को चंक में शामिल किया जाए जब वे एक खंड का उत्पादन करते हैं तो राज्य परिवर्तन लागू न करें। तदनुसार,

चंक हेडर में पहले की तरह मर्केलाइज़्ड अवस्था का मर्कल रूट शामिल है खंड में लेनदेन लागू होते हैं। लेन-देन केवल तभी लागू किया जाता है जब एक पूर्ण ब्लॉक जिसमें हिस्सा शामिल हो संसाधित किया जाता है. एक प्रतिभागी किसी ब्लॉक को केवल तभी संसाधित करता है यदि 1. पिछला ब्लॉक प्राप्त और संसाधित किया गया था; 2. प्रत्येक टुकड़े के लिए खिलाड़ी उस स्थिति को बरकरार नहीं रखता जो उसके पास है एक भाग का संदेश देखा; 3. प्रत्येक भाग के लिए प्रतिभागी राज्य को बनाए रखता है क्योंकि उसके पास है पूरा हिस्सा. एक बार ब्लॉक संसाधित होने के बाद, प्रत्येक शार्ड के लिए जिसके लिए प्रतिभागी राज्य को बनाए रखता है, वे लेनदेन लागू करते हैं और नए राज्य की गणना करते हैं लेन-देन लागू होने के बाद, जिसके बाद वे उत्पादन के लिए तैयार होते हैं अगले ब्लॉक के लिए टुकड़े, यदि उन्हें किसी भी टुकड़े को सौंपा गया है, क्योंकि उनके पास है नये मर्केलीकृत राज्य की मर्केल जड़। 3.6 क्रॉस-शार्क लेनदेन और रसीदें यदि किसी लेन-देन को एक से अधिक शार्ड को प्रभावित करने की आवश्यकता है, तो इसे लगातार करने की आवश्यकता है प्रत्येक शार्ड में अलग से निष्पादित। पूरा लेन-देन पहले शार्ड को भेजा जाता है प्रभावित, और एक बार लेन-देन ऐसे शार्ड के हिस्से में शामिल हो जाता है, और किसी ब्लॉक में टुकड़े को शामिल करने के बाद इसे लागू किया जाता है, यह एक तथाकथित रसीद उत्पन्न करता है लेन-देन, जिसे अगले शार्ड पर ले जाया जाता है जिसमें लेन-देन की आवश्यकता होती है निष्पादित किया जाए. यदि अधिक चरणों की आवश्यकता है, तो रसीद लेनदेन का निष्पादन एक नई रसीद लेनदेन इत्यादि उत्पन्न करता है। 3.6.1 रसीद लेनदेन जीवनकाल यह वांछनीय है कि रसीद लेनदेन उस ब्लॉक में लागू किया जाए जो उस ब्लॉक के तुरंत बाद होता है जिसमें यह उत्पन्न हुआ था। रसीद लेनदेन ही है पिछले ब्लॉक को प्राप्त करने और ब्लॉक उत्पादकों द्वारा लागू करने के बाद उत्पन्न हुआ जो मूल टुकड़े को बनाए रखता है, और उस समय तक इसे जानने की आवश्यकता होती है अगले ब्लॉक के लिए हिस्से का उत्पादन गंतव्य के ब्लॉक उत्पादकों द्वारा किया जाता है ठीकरा. इस प्रकार, रसीद को स्रोत शार्ड से सूचित किया जाना चाहिए उन दो घटनाओं के बीच कम समय सीमा में गंतव्य शार्ड। मान लीजिए A अंतिम उत्पादित ब्लॉक है जिसमें लेनदेन t शामिल है जो रसीद r उत्पन्न करता है। मान लीजिए कि B अगला निर्मित ब्लॉक है (अर्थात् एक ब्लॉक जिसमें A है इसका पिछला ब्लॉक) जिसमें हम r शामिल करना चाहते हैं। टी को शार्ड ए और आर में रहने दें शार्ड बी में रसीद का जीवनकाल, चित्र 18 में भी दर्शाया गया है, निम्नलिखित है: रसीदों का निर्माण एवं भंडारण। शार्ड के लिए चंक निर्माता सीपीए ए ब्लॉक ए प्राप्त करता है, लेनदेन टी लागू करता है और रसीद आर उत्पन्न करता है। सी.पी.ए फिर ऐसी सभी उत्पादित प्राप्तियों को अपने आंतरिक लगातार भंडारण अनुक्रमित में संग्रहीत करता है स्रोत शार्ड आईडी द्वारा।रसीदें बाँटना। एक बार सीपीए इस टुकड़े का उत्पादन करने के लिए तैयार हो जाए ब्लॉक बी के लिए शार्ड ए, वे शार्ड ए के लिए ब्लॉक ए से लेनदेन लागू करके उत्पन्न सभी रसीदें लाते हैं, और उन्हें शार्ड के लिए खंड में शामिल करते हैं ब्लॉक बी में ए। एक बार ऐसा खंड उत्पन्न हो जाने पर, सीपीए अपना इरेज़र कोड तैयार करता है संस्करण और सभी संबंधित वनपार्ट संदेश। सीपीए जानता है कि कौन से ब्लॉक निर्माता किस शार्क के लिए पूर्ण स्थिति बनाए रखते हैं। किसी विशेष ब्लॉक निर्माता के लिए बीपी सीपीए में ब्लॉक ए में लेनदेन लागू करने के परिणामस्वरूप प्राप्त रसीदें शामिल हैं शार्ड के लिए जिनके पास कोई ऐसा शार्ड है जिसकी बीपी अपने गंतव्य के रूप में परवाह करता है एक भाग के संदेश में जब उन्होंने ब्लॉक बी में शार्ड ए के लिए हिस्सा वितरित किया (चित्र 17 देखें, जो एक भाग के संदेश में शामिल रसीदें दिखाता है)। रसीदें प्राप्त करना। याद रखें कि प्रतिभागी (ब्लॉक निर्माता और validator दोनों) तब तक ब्लॉक संसाधित नहीं करते हैं जब तक उनके पास एक-भाग वाले संदेश न हों ब्लॉक में शामिल प्रत्येक टुकड़े के लिए। इस प्रकार, जब तक कोई विशेष प्रतिभागी ब्लॉक बी को लागू करता है, तब तक उनके पास सभी एक भाग के संदेश होते हैं जो इसके अनुरूप होते हैं बी में टुकड़े, और इस प्रकार उनके पास आने वाली सभी रसीदें हैं जिनमें टुकड़े हैं प्रतिभागी राज्य को अपने गंतव्य के रूप में बनाए रखता है। आवेदन करते समय किसी विशेष शार्ड के लिए राज्य संक्रमण, प्रतिभागी दोनों रसीदों को लागू करता है जिसे उन्होंने एक भाग के संदेशों के साथ-साथ सभी में भी एकत्र किया है लेन-देन खंड में ही शामिल है। चित्र 18: रसीद लेनदेन का जीवनकाल 3.6.2 बहुत सारी रसीदें संभालना यह संभव है कि प्राप्तियों की संख्या जो किसी विशेष हिस्से को लक्षित करती है विशेष ब्लॉक संसाधित होने के लिए बहुत बड़ा है। उदाहरण के लिए, चित्र 19 पर विचार करें जो प्रत्येक शार्ड में प्रत्येक लेन-देन एक रसीद उत्पन्न करता है जो शार्ड 1 को लक्षित करता है। अगले ब्लॉक तक प्राप्तियों की संख्या, जिसे शार्ड 1 को संसाधित करने की आवश्यकता है यह उस भार के बराबर है जिसे संभालते समय सभी टुकड़ों ने मिलकर संसाधित किया पिछला ब्लॉक.

चित्र 19: यदि सभी प्राप्तियां एक ही शार्ड को लक्षित करती हैं, तो शार्ड नहीं हो सकता है उन्हें संसाधित करने की क्षमता इसे संबोधित करने के लिए हम क्वार्कचेन 9 में उपयोग की गई तकनीक के समान तकनीक का उपयोग करते हैं। विशेष रूप से, प्रत्येक शार्ड के लिए अंतिम ब्लॉक बी और उसके भीतर अंतिम शार्ड होता है जिस ब्लॉक से रसीदें लागू की गई थीं, उसे दर्ज किया गया है। जब नया टुकड़ा है बनाई गई, रसीद को बी में शेष टुकड़ों से पहले क्रम में लागू किया जाता है, और फिर बी का अनुसरण करने वाले ब्लॉकों में, जब तक कि नया हिस्सा भर न जाए। सामान्य से कम संतुलित भार वाली परिस्थितियाँ आम तौर पर सभी प्राप्तियों में परिणामित होंगी लागू किया जा रहा है (और इस प्रकार अंतिम ब्लॉक का अंतिम टुकड़ा रिकॉर्ड किया जाएगा प्रत्येक टुकड़ा), लेकिन ऐसे समय में जब भार संतुलित नहीं होता है, और एक विशेष शार्ड को असंगत रूप से कई रसीदें प्राप्त होती हैं, यह तकनीक उन्हें इसकी अनुमति देती है शामिल लेनदेन की संख्या की सीमा का सम्मान करते हुए संसाधित किया जाना चाहिए। ध्यान दें कि यदि ऐसा असंतुलित भार लंबे समय तक बना रहे तो देरी हो सकती है आवेदन तक रसीद निर्माण अनिश्चित काल तक बढ़ता रह सकता है। एक इसे संबोधित करने का तरीका किसी भी लेनदेन को छोड़ना है जो एक लक्ष्यीकरण रसीद बनाता है शार्ड जिसमें प्रसंस्करण विलंब कुछ स्थिरांक (उदाहरण के लिए एक युग) से अधिक है। चित्र 20 पर विचार करें। ब्लॉक बी द्वारा शार्ड 4 सभी प्राप्तियों को संसाधित नहीं कर सकता है, इसलिए यह केवल ब्लॉक ए में शार्ड 3 तक प्राप्तियों की उत्पत्ति की प्रक्रिया करता है, और इसे रिकॉर्ड करता है. ब्लॉक सी में ब्लॉक बी में शार्ड 5 तक की रसीदें शामिल हैं, और फिर ब्लॉक डी द्वारा शार्ड पकड़ लिया जाता है, शेष सभी प्राप्तियों को संसाधित किया जाता है ब्लॉक बी और ब्लॉक सी से सभी प्राप्तियां। 3.7 टुकड़ों का सत्यापन किसी विशेष शार्ड के लिए उत्पादित खंड (या शार्ड चेन वाले मॉडल में किसी विशेष शार्ड श्रृंखला के लिए उत्पादित शार्ड ब्लॉक) को केवल इसके द्वारा मान्य किया जा सकता है 9क्वार्कचेन के साथ व्हाइटबोर्ड एपिसोड यहां देखें: https://www.youtube.com/watch? v=opEtG6NM4x4, जिसमें अन्य बातों के अलावा क्रॉस-शार्क लेनदेन के दृष्टिकोण पर चर्चा की गई है चीज़ेंचित्र 20: विलंबित रसीद प्रसंस्करण प्रतिभागी जो राज्य को बनाए रखते हैं। वे ब्लॉक निर्माता हो सकते हैं, validators, या केवल बाहरी गवाह जिन्होंने राज्य को डाउनलोड किया और शार्ड को मान्य किया जिसमें वे संपत्ति संग्रहित करते हैं। इस दस्तावेज़ में हम मानते हैं कि अधिकांश प्रतिभागी भंडारण नहीं कर सकते टुकड़ों के एक बड़े हिस्से के लिए राज्य। हालाँकि, यह उल्लेख करने योग्य है, कि ऐसे शार्प blockchains हैं जिन्हें इस धारणा के साथ डिज़ाइन किया गया है अधिकांश प्रतिभागियों के पास राज्य को संग्रहीत करने और अधिकांश को मान्य करने की क्षमता होती है टुकड़े, जैसे कि क्वार्कचेन। चूंकि प्रतिभागियों के केवल एक हिस्से के पास शार्ड को मान्य करने की स्थिति है खंडों में, केवल उन प्रतिभागियों को ही भ्रष्ट करना संभव है जिनके पास है राज्य, और एक अमान्य राज्य संक्रमण लागू करें। एकाधिक शार्डिंग डिज़ाइन प्रस्तावित किए गए थे जो हर कुछ में validators का नमूना लेते थे दिन, और एक दिन के भीतर शार्ड श्रृंखला में कोई भी ब्लॉक जिसमें 2/3 से अधिक हो ऐसे शार्ड को सौंपे गए validators के हस्ताक्षरों पर तुरंत विचार किया जाता है अंतिम. इस तरह के दृष्टिकोण के साथ एक अनुकूली प्रतिद्वंद्वी को केवल 2n/3+1 को भ्रष्ट करने की आवश्यकता होती है एक अमान्य स्थिति संक्रमण को लागू करने के लिए एक शार्ड श्रृंखला में validators का, जो, जबकि इसे हटाना कठिन हो सकता है, जनता के लिए सुरक्षा का स्तर पर्याप्त नहीं है blockchain. जैसा कि खंड 2.3 में चर्चा की गई है, सामान्य दृष्टिकोण किसी भी प्रतिभागी के लिए एक ब्लॉक बनाने के बाद समय की एक निश्चित विंडो की अनुमति देना है (चाहे वह राज्य हो) इसकी वैधता को चुनौती देने के लिए यह एक ब्लॉक निर्माता, एक validator, या एक बाहरी पर्यवेक्षक है)। ऐसे प्रतिभागियों को मछुआरे कहा जाता है। एक मछुआरे के लिए सक्षम होना किसी अमान्य ब्लॉक को चुनौती देते समय, यह सुनिश्चित किया जाना चाहिए कि ऐसा ब्लॉक उपलब्ध है उन्हें. नाइटशेड में डेटा उपलब्धता की चर्चा अनुभाग 3.4 में की गई है। नाइटशेड में एक बार एक ब्लॉक तैयार हो जाने के बाद, टुकड़ों को मान्य नहीं किया जाता था वास्तविक खंड निर्माता के अलावा कोई भी नहीं। विशेष रूप से, ब्लॉक निर्माता वह सुझाव दिया गया कि ब्लॉक में स्वाभाविक रूप से अधिकांश शार्क के लिए राज्य नहीं है, औरटुकड़ों को सत्यापित करने में सक्षम नहीं था। जब अगला ब्लॉक तैयार किया जाता है, तो इसमें कई ब्लॉक उत्पादकों और validators के सत्यापन (अनुभाग 3.2 देखें) शामिल होते हैं। लेकिन चूंकि अधिकांश ब्लॉक उत्पादक और validator राज्य का रखरखाव नहीं करते हैं अधिकांश शार्क के लिए, केवल एक अमान्य खंड वाला ब्लॉक आधे से अधिक सत्यापन एकत्र करेगा और सबसे भारी बना रहेगा श्रृंखला. इस मुद्दे को संबोधित करने के लिए, हम किसी भी प्रतिभागी को अनुमति देते हैं जो स्थिति को बनाए रखता है उसमें उत्पादित किसी भी अमान्य हिस्से के लिए ऑन-चेन चुनौती प्रस्तुत करने के लिए एक शार्ड ठीकरा. 3.7.1 राज्य वैधता चुनौती एक बार जब किसी प्रतिभागी को पता चलता है कि कोई विशेष हिस्सा अमान्य है, तो उन्हें इस बात का प्रमाण देना होगा कि वह हिस्सा अमान्य है। चूंकि अधिकांश नेटवर्क प्रतिभागी उस शार्ड की स्थिति को बनाए नहीं रखते हैं जिसमें अमान्य हिस्सा है उत्पादित, ब्लॉक की पुष्टि के लिए सबूत में पर्याप्त जानकारी होनी चाहिए राज्य के बिना अमान्य। हम एक एकल लेनदेन में राज्य की मात्रा (बाइट्स में) की एक सीमा Ls निर्धारित करते हैं संचयी रूप से पढ़ या लिख सकते हैं। कोई भी लेनदेन जो Ls से अधिक को छूता है राज्य को अमान्य माना जाता है. अनुभाग 3.5 से याद रखें कि खंड किसी विशेष ब्लॉक बी में केवल लागू किए जाने वाले लेनदेन शामिल हैं, लेकिन नहीं नया राज्य मूल. ब्लॉक बी में खंड में शामिल राज्य जड़ राज्य है ऐसे लेनदेन को लागू करने से पहले रूट करें, लेकिन लेनदेन को लागू करने के बाद ब्लॉक बी से पहले उसी टुकड़े में आखिरी टुकड़ा। एक दुर्भावनापूर्ण अभिनेता जो व्यक्ति अमान्य राज्य परिवर्तन लागू करना चाहता है, उसमें गलत राज्य रूट शामिल होगा ब्लॉक बी में यह उस राज्य रूट के अनुरूप नहीं है जो आवेदन करने से उत्पन्न होता है पिछले हिस्से में लेनदेन। हम उस जानकारी का विस्तार करते हैं जो एक चंक निर्माता चंक में शामिल करता है। सभी लेनदेन को लागू करने के बाद राज्य को शामिल करने के बजाय, इसके बजाय लेनदेन के प्रत्येक सन्निहित सेट को लागू करने के बाद एक राज्य रूट शामिल होता है राज्य के एलएस बाइट्स को सामूहिक रूप से पढ़ें और लिखें। इस जानकारी के साथ मछुआरे ने एक चुनौती पैदा की कि एक राज्य परिवर्तन गलत तरीके से लागू किया गया है इस तरह के पहले अमान्य राज्य रूट को खोजने के लिए पर्याप्त है, और इसमें केवल एलएस बाइट्स शामिल हैं वे राज्य जो अंतिम राज्य रूट (जो था) के बीच लेनदेन से प्रभावित होते हैं वैध) और वर्तमान स्थिति रूट मर्कल प्रमाणों के साथ। फिर कोई भी प्रतिभागी खंड में लेनदेन को सत्यापित कर सकता है और पुष्टि कर सकता है कि हिस्सा है अमान्य. इसी तरह, यदि खंड निर्माता ने पढ़ने वाले लेनदेन को शामिल करने का प्रयास किया और राज्य के एलएस बाइट्स से अधिक लिखें, चुनौती के लिए इसे शामिल करना पर्याप्त है पहले एलएस बाइट्स को यह मर्कल प्रूफ़ के साथ छूता है, जो पर्याप्त होगा लेन-देन लागू करें और पुष्टि करें कि एक क्षण ऐसा है जब ऐसा करने का प्रयास किया जाएगा Ls बाइट्स से परे सामग्री को पढ़ना या लिखना बनता है।

3.7.2 मछुआरे और तेज़ क्रॉस-शार्क लेनदेन जैसा कि खंड 2.3 में चर्चा की गई है, एक बार हम यह मान लेते हैं कि शार्ड विखंडन (या शार्ड शार्ड चेन वाले मॉडल में ब्लॉक) अमान्य हो सकते हैं और एक चुनौती पेश कर सकते हैं अवधि, यह अंतिमता और इस प्रकार क्रॉस-शार्क संचार को नकारात्मक रूप से प्रभावित करती है। में विशेष रूप से, किसी भी क्रॉस-शार्क लेनदेन का गंतव्य शार्ड निश्चित नहीं हो सकता है चुनौती की अवधि समाप्त होने तक मूल टुकड़ा या ब्लॉक अंतिम है (चित्र 21 देखें)। चित्र 21: रसीद लगाने से पहले चुनौती अवधि की प्रतीक्षा करें इसे इस तरह से संबोधित करने का तरीका जिससे क्रॉस-शार्क लेनदेन हो सके गंतव्य के लिए तात्कालिक यह है कि चुनौती की अवधि की प्रतीक्षा न की जाए स्रोत शार्ड लेनदेन प्रकाशित होने के बाद, रसीद लेनदेन लागू करें तुरंत, लेकिन फिर स्रोत के साथ गंतव्य शार्ड को वापस रोल करें शार्ड यदि बाद में मूल खंड या ब्लॉक अमान्य पाया गया (चित्र देखें)। 22). यह नाइटशेड डिज़ाइन पर बहुत स्वाभाविक रूप से लागू होता है जिसमें शार्ड शृंखलाएँ स्वतंत्र नहीं हैं, बल्कि सभी टुकड़े प्रकाशित होते हैं एक साथ एक ही मुख्य श्रृंखला ब्लॉक में। यदि कोई भी हिस्सा अमान्य पाया जाता है, तो उस खंड के साथ संपूर्ण ब्लॉक और उस पर बने सभी ब्लॉक अमान्य माने जाते हैं इसके शीर्ष पर. चित्र 23 देखें. उपरोक्त दोनों दृष्टिकोण चुनौती को मानकर परमाणुता प्रदान करते हैं अवधि काफी लंबी है. हम बाद वाले दृष्टिकोण का उपयोग करते हैं क्योंकि सामान्य परिस्थितियों में तेज़ क्रॉसहार्ड लेनदेन प्रदान करना असुविधा को कम करता है इनमें से किसी एक में अमान्य स्थिति परिवर्तन के कारण गंतव्य शार्ड वापस लुढ़क रहा है स्रोत के टुकड़े, जो एक अत्यंत दुर्लभ घटना है। 3.7.3 validators को छिपाया जा रहा है चुनौतियों का अस्तित्व पहले से ही इसकी संभावना को काफी कम कर देता है अनुकूली भ्रष्टाचार, एक अमान्य राज्य संक्रमण पोस्ट के साथ एक हिस्से को अंतिम रूप देने के लिएचित्र 22: तुरंत रसीदें लागू करना और गंतव्य स्थान वापस ले जाना यदि स्रोत श्रृंखला में कोई अमान्य ब्लॉक है तो श्रृंखला चित्र 23: नाइटशेड में मछुआरे की चुनौती चुनौती की अवधि अनुकूली प्रतिद्वंद्वी को सभी प्रतिभागियों को भ्रष्ट करने की आवश्यकता है जो सभी validator सहित शार्ड की स्थिति को बनाए रखता है। ऐसी घटना की संभावना का अनुमान लगाना बेहद जटिल है, क्योंकि नहीं शार्डेड blockchain ऐसे किसी भी हमले के प्रयास के लिए काफी समय से लाइव है। हमारा तर्क है कि संभावना, हालांकि बेहद कम है, फिर भी पर्याप्त है एक ऐसी प्रणाली के लिए बड़ी, जिससे बहु-मिलियन लेनदेन निष्पादित करने की उम्मीद की जाती है विश्वव्यापी वित्तीय संचालन चलाएँ। इस विश्वास के दो मुख्य कारण हैं: 1. प्रूफ़-ऑफ़-स्टेक श्रृंखलाओं और खनिकों के अधिकांश validators

प्रूफ़-ऑफ़-वर्क श्रृंखलाओं को मुख्य रूप से वित्तीय लाभ द्वारा प्रोत्साहित किया जाता है। यदि एक अनुकूली विरोधी उन्हें अपेक्षित रिटर्न से अधिक धन प्रदान करता है ईमानदारी से काम करने से, कई validators की अपेक्षा करना उचित है प्रस्ताव स्वीकार करेंगे. 2. कई संस्थाएं पेशेवर रूप से प्रूफ-ऑफ-स्टेक श्रृंखलाओं का सत्यापन करती हैं, और यह उम्मीद की जाती है कि किसी भी श्रृंखला में हिस्सेदारी का एक बड़ा प्रतिशत होगा ऐसी संस्थाओं से. ऐसी संस्थाओं की संख्या काफी कम है उनमें से अधिकांश को व्यक्तिगत रूप से जानने और एक अनुकूली प्रतिद्वंद्वी प्राप्त करने के लिए भ्रष्ट होने की उनकी प्रवृत्ति की अच्छी समझ। हम यह छिपाकर अनुकूली भ्रष्टाचार की संभावना को कम करने की दिशा में एक कदम आगे बढ़ाते हैं कि किस validator को किस शार्ड को सौंपा गया है। विचार यह है Algorand [5] validator को छुपाने के तरीके के समान ही। यह ध्यान रखना महत्वपूर्ण है कि भले ही validator छुपाए गए हों, जैसा कि Algorand में है या जैसा कि नीचे वर्णित है, अनुकूली भ्रष्टाचार अभी भी सैद्धांतिक रूप से संभव है। जबकि अनुकूली प्रतिद्वंद्वी उन प्रतिभागियों को नहीं जानता जो निर्माण या सत्यापन करेंगे एक ब्लॉक या एक हिस्सा, प्रतिभागियों को स्वयं पता होता है कि वे प्रदर्शन करेंगे ऐसा कार्य और इसका क्रिप्टोग्राफ़िक प्रमाण होना चाहिए। इस प्रकार, विरोधी ऐसा कर सकता है भ्रष्ट करने के अपने इरादे को प्रसारित करें, और जो भी भागीदार प्रदान करेगा उसे भुगतान करें ऐसा क्रिप्टोग्राफ़िक प्रमाण। हालाँकि, हम ध्यान दें कि चूंकि प्रतिद्वंद्वी ऐसा नहीं करता है वे validator को जानते हैं जो उस शार्ड को सौंपे गए हैं जिन्हें वे भ्रष्ट करना चाहते हैं किसी विशेष हिस्से को भ्रष्ट करने के अपने इरादे को प्रसारित करने के अलावा उनके पास कोई अन्य विकल्प नहीं है संपूर्ण समुदाय. उस समय यह किसी भी ईमानदार के लिए आर्थिक रूप से फायदेमंद है प्रतिभागी को एक पूर्ण नोड को स्पिन करना होगा जो उस शार्ड को मान्य करता है, क्योंकि वहां एक उच्च है उस शार्ड में एक अमान्य ब्लॉक दिखाई देने की संभावना, जो एक अवसर है एक चुनौती बनाएं और संबंधित इनाम इकट्ठा करें। किसी विशेष शार्ड को सौंपे गए validator को प्रकट न करने के लिए, हम ऐसा करते हैं निम्नलिखित (चित्र 24 देखें): असाइनमेंट प्राप्त करने के लिए वीआरएफ का उपयोग करना। प्रत्येक युग की शुरुआत में प्रत्येक validator validator को सौंपे गए शार्ड का बिटमास्क प्राप्त करने के लिए VRF का उपयोग करता है। प्रत्येक validator के बिटमास्क में Sw बिट्स होंगे (परिभाषा के लिए अनुभाग 3.3 देखें) स्व का) validator फिर संबंधित शार्क की स्थिति प्राप्त करता है, और प्राप्त प्रत्येक ब्लॉक के लिए युग के दौरान संबंधित हिस्सों को मान्य किया जाता है उन शार्डों के लिए जिन्हें validator सौंपा गया है। टुकड़ों के बजाय ब्लॉकों पर हस्ताक्षर करें। चूँकि टुकड़ों का असाइनमेंट छिपा हुआ है, validator टुकड़ों पर हस्ताक्षर नहीं कर सकता। इसके बजाय यह हमेशा संपूर्ण पर हस्ताक्षर करता है ब्लॉक, इस प्रकार यह प्रकट नहीं करता कि यह किन टुकड़ों को मान्य करता है। विशेष रूप से, जब validator एक ब्लॉक प्राप्त करता है और सभी खंडों को मान्य करता है, तो यह या तो एक संदेश बनाता है यह प्रमाणित करता है कि validator को सौंपे गए सभी टुकड़ों में सभी टुकड़े हैं वैध (किसी भी तरह से यह बताए बिना कि वे टुकड़े क्या हैं), या कोई संदेश यदि कोई हिस्सा अमान्य है तो इसमें अमान्य स्थिति परिवर्तन का प्रमाण शामिल है। देखें ऐसे संदेशों को कैसे एकत्रित किया जाता है, इसके विवरण के लिए अनुभाग 3.8, इसके लिए अनुभाग 3.7.4 संदेशों पर validators को गुल्लक से रोकने के तरीके के बारे में विवरण अन्य validators, और अनुभाग 3.7.5 विवरण के लिए कि कैसे पुरस्कार और दंड दिया जाए validators को एक सफल अमान्य राज्य परिवर्तन चुनौती वास्तव में होनी चाहिए।चित्र 24: नाइटशेड में validator को छुपाना 3.7.4 प्रतिबद्ध-प्रकटीकरण validators के साथ आम समस्याओं में से एक यह है कि validator राज्य को डाउनलोड करना और वास्तव में टुकड़ों और ब्लॉकों को मान्य करना छोड़ सकता है, और इसके बजाय नेटवर्क का निरीक्षण करें, देखें कि अन्य validators क्या सबमिट करते हैं और अपना दोहराएँ संदेश. ऐसी रणनीति का पालन करने वाला validator कोई अतिरिक्त प्रदान नहीं करता है नेटवर्क के लिए सुरक्षा, लेकिन पुरस्कार एकत्र करता है। इस समस्या का एक सामान्य समाधान प्रत्येक validator के लिए एक प्रमाण प्रदान करना है कि उन्होंने वास्तव में ब्लॉक को मान्य किया है, उदाहरण के लिए एक अद्वितीय ट्रेस प्रदान करके राज्य परिवर्तन को लागू करने के लिए, लेकिन ऐसे प्रमाण लागत में उल्लेखनीय वृद्धि करते हैं सत्यापन का. चित्र 25: प्रतिबद्ध-प्रकटीकरण

इसके बजाय हम validators को पहले सत्यापन परिणाम के लिए प्रतिबद्ध करते हैं (या तो वह संदेश जो खंडों की वैधता, या अमान्य के प्रमाण को प्रमाणित करता है राज्य परिवर्तन), एक निश्चित अवधि तक प्रतीक्षा करें, और उसके बाद ही वास्तविक सत्यापन परिणाम प्रकट करें, जैसा कि चित्र 25 पर दिखाया गया है। प्रतिबद्ध अवधि इसके साथ प्रतिच्छेद नहीं करती है प्रकटीकरण अवधि, और इस प्रकार एक आलसी validator ईमानदार validators की नकल नहीं कर सकता। इसके अलावा, यदि कोई बेईमान validator किसी ऐसे संदेश के प्रति प्रतिबद्ध है जो इसकी पुष्टि करता है निर्दिष्ट खंडों की वैधता, और एक बार ऐसा होने पर कम से कम एक खंड अमान्य था दिखाया गया है कि हिस्सा अमान्य है validator स्लैशिंग से बच नहीं सकता, क्योंकि, जैसा कि हम अनुभाग 3.7.5 में दिखाते हैं, ऐसी स्थिति में कटौती से बचने का एकमात्र तरीका है एक संदेश प्रस्तुत करना है जिसमें अमान्य स्थिति परिवर्तन का प्रमाण शामिल है प्रतिबद्धता से मेल खाता है. 3.7.5 चुनौतियों से निपटना जैसा कि ऊपर चर्चा की गई है, एक बार validator को एक अमान्य खंड वाला ब्लॉक प्राप्त होता है, फिर वे पहले अमान्य स्थिति परिवर्तन का प्रमाण तैयार करते हैं (धारा 3.7.1 देखें)। ऐसे प्रमाण के लिए प्रतिबद्ध रहें (3.7.4 देखें), और कुछ अवधि के बाद चुनौती का खुलासा करें। एक बार जब प्रकट चुनौती को किसी ब्लॉक में शामिल कर लिया जाता है, तो निम्नलिखित होता है: 1. सभी राज्य परिवर्तन जो युक्त ब्लॉक से हुए अमान्य खंड तब तक है जब तक कि वह ब्लॉक जिसमें प्रकट चुनौती शामिल है, प्राप्त न हो जाए निरस्त कर दिया गया। ब्लॉक से पहले की स्थिति जिसमें प्रकट चुनौती शामिल है इसे उस ब्लॉक से पहले की स्थिति के समान माना जाता है जिसमें शामिल है अमान्य हिस्सा. 2. एक निश्चित अवधि के भीतर प्रत्येक validator को अपना बिटमास्क प्रकट करना होगा वे जिन टुकड़ों को मान्य करते हैं। चूंकि बिटमास्क वीआरएफ के माध्यम से बनाया गया है, यदि उन्हें उस शार्ड को सौंपा गया था जिसमें अमान्य राज्य परिवर्तन था, वे इसका खुलासा करने से बच नहीं सकते. कोई भी validator जो बिटमास्क को प्रकट करने में विफल रहता है यह माना जाता है कि इसे शार्ड को सौंपा गया है। 3. प्रत्येक validator को ऐसी अवधि के बाद शार्ड को सौंपा जाना पाया जाता है, जिसमें शामिल ब्लॉक के लिए कुछ सत्यापन परिणाम दिए गए थे अमान्य खंड और इससे अमान्य राज्य परिवर्तन का प्रमाण प्रकट नहीं हुआ जो उनकी प्रतिबद्धता से मेल खाता है उसे काट दिया गया है। 4. प्रत्येक validator को एक नया शार्ड असाइनमेंट मिलता है, और एक नया युग निर्धारित किया जाता है सभी validators को डाउनलोड करने के लिए पर्याप्त समय के बाद प्रारंभ करें स्थिति, जैसा कि चित्र 26 में दिखाया गया है। ध्यान दें कि उस क्षण से validators उन टुकड़ों को प्रकट करते हैं जिन्हें उन्हें सौंपा गया है जब तक नया युग शुरू नहीं हो जाता तब तक सिस्टम की सुरक्षा कम हो जाती है शार्ड्स असाइनमेंट का पता चला है। नेटवर्क के प्रतिभागियों को इसे रखना होगा ऐसी अवधि के दौरान नेटवर्क का उपयोग करते समय ध्यान रखें। 3.8 हस्ताक्षर एकत्रीकरण सुरक्षित रूप से संचालित करने के लिए सैकड़ों टुकड़ों वाली प्रणाली के लिए, हम इसे चालू रखना चाहते हैं 10,000 या अधिक validators का ऑर्डर। जैसा कि खंड 3.7 में चर्चा की गई है, हम प्रत्येक चाहते हैंचित्र 26: चुनौती को संभालना validator औसतन एक निश्चित संदेश और एक हस्ताक्षर के लिए प्रतिबद्धता प्रकाशित करने के लिए प्रति ब्लॉक एक बार. भले ही प्रतिबद्ध संदेश समान हों, ऐसे को एकत्रित करना बीएलएस-हस्ताक्षर और इसे मान्य करना अत्यधिक महंगा होता। लेकिन स्वाभाविक रूप से प्रतिबद्ध और प्रकट संदेश validators में समान नहीं हैं, और इस प्रकार हमें ऐसे संदेशों और हस्ताक्षरों को एक में एकत्रित करने के लिए किसी तरीके की आवश्यकता है वह तरीका जो बाद में तेजी से सत्यापन की अनुमति देता है। हमारे द्वारा उपयोग किया जाने वाला विशिष्ट दृष्टिकोण निम्नलिखित है: सत्यापनकर्ता ब्लॉक उत्पादकों से जुड़ रहे हैं। ब्लॉक उत्पादक ज्ञात हैं युग शुरू होने से कुछ समय पहले, क्योंकि उन्हें डाउनलोड करने के लिए कुछ समय चाहिए युग शुरू होने से पहले की स्थिति, और validators के विपरीत ब्लॉक निर्माता हैं छुपाया नहीं गया. प्रत्येक ब्लॉक निर्माता के पास v validator स्लॉट हैं। सत्यापनकर्ता प्रस्तुत करते हैं ब्लॉक उत्पादकों को उनके वी में से एक के रूप में शामिल करने के लिए ऑफ-चेन प्रस्ताव validators. यदि कोई ब्लॉक निर्माता validator को शामिल करना चाहता है, तो वे एक सबमिट करते हैं लेन-देन जिसमें validator से प्रारंभिक ओff-श्रृंखला अनुरोध शामिल है, और ब्लॉक निर्माता का हस्ताक्षर जो validator को ब्लॉक निर्माता से जोड़ता है। ध्यान दें कि ब्लॉक उत्पादकों को सौंपा गया validator जरूरी नहीं है उन्हीं टुकड़ों को मान्य करें जिनके लिए ब्लॉक निर्माता टुकड़ों का उत्पादन करता है। यदि ए validator ने कई ब्लॉक उत्पादकों से जुड़ने के लिए आवेदन किया, केवल लेनदेन से पहला ब्लॉक निर्माता सफल होगा। ब्लॉक निर्माता कमिट एकत्र करते हैं। ब्लॉक निर्माता लगातार कमिट एकत्र करता है और validators से संदेश प्रकट करता है। एक बार जब ऐसे संदेशों की एक निश्चित संख्या जमा हो जाती है, तो ब्लॉक निर्माता एक मर्कल की गणना करता है इन संदेशों का वृक्ष, और प्रत्येक validator को मर्केल रूट और भेजता है उनके संदेश के लिए मर्कल पथ। validator पथ को मान्य करता है और उस पर हस्ताक्षर करता है मर्केल जड़. ब्लॉक निर्माता तब बीएलएस हस्ताक्षर जमा करता है validators से मर्कल रूट, और केवल मर्कल रूट और प्रकाशित करता है संचित हस्ताक्षर. ब्लॉक निर्माता भी इसकी वैधता पर हस्ताक्षर करता है सस्ते ईसीडीएसए हस्ताक्षर का उपयोग करते हुए बहुहस्ताक्षर। यदि बहुहस्ताक्षरकर्ता ऐसा नहीं करता है सबमिट किए गए मर्कल रूट या भाग लेने वाले validators के बिटमास्क से मिलान करें, यह एक स्लैश करने योग्य व्यवहार है। श्रृंखला को सिंक्रनाइज़ करते समय, एक भागीदार validators से सभी BLS हस्ताक्षरों को मान्य करना चुन सकते हैं (जो बेहद महंगा है क्योंकि इसमें validators सार्वजनिक कुंजी एकत्र करना शामिल है), या केवलब्लॉक उत्पादकों से ईसीडीएमए हस्ताक्षर और इस तथ्य पर भरोसा करते हैं कि ब्लॉक निर्माता को चुनौती नहीं दी गई और उसे काट दिया गया। चुनौतियों के लिए ऑन-चेन लेनदेन और मर्कल प्रमाणों का उपयोग करना। यह यह ध्यान दिया जा सकता है कि यदि नहीं, तो validators से संदेशों को प्रकट करने का कोई महत्व नहीं है अमान्य स्थिति परिवर्तन का पता चला. केवल वे संदेश जिनमें वास्तविक तथ्य शामिल हैं अमान्य स्थिति परिवर्तन के प्रमाण प्रकट करने की आवश्यकता है, और केवल ऐसे संदेशों के लिए यह दिखाने की ज़रूरत है कि वे पूर्व प्रतिबद्धता से मेल खाते हैं। संदेश की जरूरत है दो उद्देश्यों के लिए प्रकट किया जाना: 1. वास्तव में चेन के रोलबैक को उस क्षण से पहले आरंभ करना अमान्य स्थिति परिवर्तन (अनुभाग 3.7.5 देखें)। 2. यह साबित करने के लिए कि validator ने इसकी वैधता को प्रमाणित करने का प्रयास नहीं किया अमान्य हिस्सा. किसी भी स्थिति में हमें दो मुद्दों पर ध्यान देने की आवश्यकता है: 1. वास्तविक प्रतिबद्धता को श्रृंखला में शामिल नहीं किया गया था, केवल मर्कल रूट को शामिल किया गया था अन्य संदेशों के साथ एकत्रित प्रतिबद्धता। validator का उपयोग करने की आवश्यकता है ब्लॉक निर्माता द्वारा प्रदान किया गया मर्कल पथ और उनकी मूल प्रतिबद्धता साबित करें कि वे चुनौती के प्रति प्रतिबद्ध हैं। 2. यह संभव है कि शार्ड को सौंपे गए सभी validator अमान्य हों राज्य परिवर्तन भ्रष्ट ब्लॉक उत्पादकों को सौंपा जाना है उन्हें सेंसर कर रहे हैं. इससे निजात पाने के लिए हम उन्हें अपने खुलासे प्रस्तुत करने की अनुमति देते हैं श्रृंखला पर एक नियमित लेनदेन के रूप में और एकत्रीकरण को बायपास करें। उत्तरार्द्ध को केवल अमान्य राज्य संक्रमण के प्रमाण के लिए अनुमति दी गई है, जो हैं अत्यंत दुर्लभ, और इस प्रकार ब्लॉकों को स्पैम करने का परिणाम नहीं होना चाहिए। अंतिम मुद्दा जिसे संबोधित करने की आवश्यकता है वह यह है कि ब्लॉक निर्माता ऐसा कर सकते हैं संदेश एकत्रीकरण में भाग न लेने या जानबूझकर विशेष validators को सेंसर न करने का चयन करें। ब्लॉक बनाकर हम इसे आर्थिक रूप से अलाभकारी बनाते हैं निर्माता का इनाम उन्हें सौंपी गई validator की संख्या के अनुपात में होता है। हम यह भी ध्यान दें कि चूंकि युगों के बीच ब्लॉक उत्पादक बड़े पैमाने पर प्रतिच्छेद करते हैं (तब से)। यह हमेशा उच्चतम हिस्सेदारी वाले शीर्ष w प्रतिभागी होते हैं), validators कर सकते हैं बड़े पैमाने पर समान ब्लॉक उत्पादकों के साथ काम करने पर अड़े रहते हैं, और इस प्रकार जोखिम कम हो जाता है एक ऐसे ब्लॉक निर्माता को सौंपे जाने का, जिसने अतीत में उन्हें सेंसर किया था। 3.9 स्नैपशॉट श्रृंखला चूंकि मुख्य श्रृंखला पर ब्लॉक बहुत बार डाउनलोड किए जाते हैं पूरा इतिहास बहुत जल्दी महंगा हो सकता है। इसके अलावा, प्रत्येक के बाद से ब्लॉक में बड़ी संख्या में प्रतिभागियों के बीएलएस हस्ताक्षर हैं, हस्ताक्षर की जांच करने के लिए सार्वजनिक कुंजी का एकत्रीकरण निषेधात्मक हो सकता है महंगा भी. अंततः, चूंकि किसी भी निकट भविष्य में Ethereum 1.0 संभवतः एक ही रहेगा सबसे अधिक उपयोग किए जाने वाले blockchains में से, संपत्तियों को स्थानांतरित करने का एक सार्थक तरीका है

Ethereum के करीब होना एक आवश्यकता है, और आज यह सुनिश्चित करने के लिए BLS हस्ताक्षरों का सत्यापन किया जा रहा है Ethereum की ओर निकट ब्लॉक वैधता संभव नहीं है। नाइटशेड मुख्य श्रृंखला के प्रत्येक ब्लॉक में वैकल्पिक रूप से एक श्नोरर हो सकता है अंतिम ब्लॉक के हेडर पर बहुहस्ताक्षर जिसमें ऐसा श्नोर शामिल था बहुहस्ताक्षर. ऐसे ब्लॉक को हम स्नैपशॉट ब्लॉक कहते हैं। का सबसे पहला ब्लॉक प्रत्येक युग एक स्नैपशॉट ब्लॉक होना चाहिए। ऐसे बहुहस्ताक्षर पर काम करते समय, ब्लॉक उत्पादकों को validators के BLS हस्ताक्षर भी जमा करने होंगे अंतिम स्नैपशॉट ब्लॉक पर, और उन्हें उसी तरह एकत्रित करें जैसा कि इसमें वर्णित है धारा 3.8. चूँकि ब्लॉक उत्पादकों का सेट पूरे युग में स्थिर रहता है, मान्य होता है यह मानते हुए कि प्रत्येक युग में केवल पहला स्नैपशॉट ब्लॉक ही पर्याप्त है ब्लॉक उत्पादकों और validator के एक बड़े प्रतिशत ने मिलीभगत करके निर्माण किया एक कांटा. युग के पहले खंड में गणना के लिए पर्याप्त जानकारी होनी चाहिए युग के लिए ब्लॉक निर्माता और validators। हम मुख्य श्रृंखला की उपश्रृंखला कहते हैं जिसमें केवल स्नैपशॉट होता है स्नैपशॉट श्रृंखला को अवरुद्ध करता है। Schnorr मल्टीसिग्नेचर बनाना एक इंटरैक्टिव प्रक्रिया है, लेकिन चूंकि हम केवल इसे कभी-कभार ही निष्पादित करने की आवश्यकता है, कोई भी, चाहे प्रक्रिया कितनी भी अकुशल क्यों न हो पर्याप्त होगा. Schnorr बहुहस्ताक्षरों को Ethereum पर आसानी से मान्य किया जा सकता है, इस प्रकार क्रॉस-blockchain निष्पादित करने के सुरक्षित तरीके के लिए महत्वपूर्ण आदिम प्रदान करना संचार. नियर चेन के साथ सिंक करने के लिए केवल सभी स्नैपशॉट को डाउनलोड करना होगा ब्लॉक करें और पुष्टि करें कि Schnorr हस्ताक्षर सही हैं (वैकल्पिक रूप से validators के व्यक्तिगत 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.

निष्कर्ष

इस दस्तावेज़ में हमने शार्प्ड blockchains और के निर्माण के तरीकों पर चर्चा की मौजूदा दृष्टिकोणों के साथ दो प्रमुख चुनौतियों को कवर किया गया, अर्थात् राज्य की वैधता और डेटा उपलब्धता। फिर हमने नाइटशेड प्रस्तुत किया, जो एक शानदार डिज़ाइन है शक्तियाँ NEAR प्रोटोकॉल। यदि आपके पास टिप्पणियाँ, प्रश्न या प्रतिक्रिया है तो डिज़ाइन पर काम चल रहा है इस दस्तावेज़ पर, कृपया https://near.chat. पर जाएँ