header-langage
简体中文
繁體中文
English
Tiếng Việt
Scan to Download the APP
Partnered With:

V god: how to realize ETH cross-sharding fast transfer

Read this article in 5 Minutes
Create an execution environment "expense environment" to store ETH balances held by other execution environments. The execution environment includes a minimum balance record and a cross-sharding receipt system, allowing ETH to make quick transfers between

Original title: "meta-execution environment of trans-sharding ETH transfer"
Vitalik Buterin, Unitimes


Please refer to the problem description:"Problem description about ETH transfer between slices」。


We can create an executive environment, called a "fee environment," whose main function is to store ETH balances held by other executive environments. The execution environment includes a minimum balance record and a cross-sharding receipt system, allowing ETH to make quick transfers between sharding.

The premise


Let's assume that a block contains (I) data and (ii) a list of execution environments that access that data. The execution environments in the list are called in turn, and all execution environments have access to the entire data (each execution environment will then have access to only part of the data, but there is no additional cost to allowing each execution environment access to the entire block data). The execution environment can also access the finished "auxiliary outputs".


We assume that block producers are "aware" of the expense environment, in a sense, that they know when to receive funds in the expense environment.

Expected block structure



Each block will contain one or more segments, each segment specific to an execution environment that contains transactions made in that execution environment. The execution environments themselves generate a secondary output that represents a summary of the cross-sharding transfers that these execution environments want to make. Multiple transactions to the same destination (sharding/execution environment) go into batch processing.

At the end of the block, there is a cost environment of special section, which is stored in the block of piecewise Merkle prove more of all the execution environment (note that the previous execution environment balance of this part will check and verify the correctness and sufficiency of the [sufficiency check will require execution environment also check before execution environment aux output]).

The expense environment will publish a state root containing the Merkle tree with the updated balance in the shard and a receipt root containing all cross-shard transfers. The design of the receipt root requires that the path be coded based on a combination of sharding and execution environment, while the code of the leaf node also contains the amount of the transfer.

For example, if A block on shard A contains A single transaction [Alice -- {50 ETH} --> Bob], and the receiver Bob is on another shard B, then two receipts are generated: (I) the receipt specific to the execution environment that allows Bob to extract ETH, and (ii) the execution environment will generate A secondary output {B, EE_id, 50}, then the expense environment will reduce the balance of {A, EE_id} by 50, publish the updated status root, and create A receipt tree with A single element {key = (B, EE_id), value = 50}. If there are N transactions in the same execution environment, only N + 1 branches will be generated. The overhead is constant.

Receive the receipt


Now, let's extend the above scheme to allow receipt. The state of the expense environment now contains a third root, a Merkle root for a field, for each shard and for each slot to mark whether the receipt for that slot has been processed. To increase efficiency, we wanted to keep bits corresponding to the same slot side-by-side, so in the "ideal case" we would only need a Merkle branch to process the receipt immediately.


The portion of the block used for the expense environment also declares the branch corresponding to the bit field. For each branch, the bit defaults to 0, the pre-balanced Merkle proof also needs to show the corresponding execution environment balance, and the expense environment also needs to provide Merkle proof of the corresponding receipt. The updated pre-balance root will increase the execution environment balance based on the receipt and set the bit to 1.



At the same time, the execution environment itself will enforce a rule that the Alice to Bob receipt is valid only if the corresponding Merkle branch representing the ETH transfer at the execution environment level is located in the subsection of the expense environment. This prevents Bob from receiving ETH without an execution environment. Note that sometimes receipts with the same start and target shards created in the same time slot will be received in different time slots. In this case, proof of the cost execution environment bit field must be included again, showing that the receipt is contained in time slot n and that the bit field has been set to 1 in all containment items, so that the execution environment level balance increase does not occur more than once.

Fees and cashing


The execution environment can also specify in its secondary output the number of ETH they pay for the transaction fee. The verifier can also have an account in the charging environment to receive this ETH. The charging environment also allows the verifier to extract ETH.


Cost analysis


Assuming that the block chain is relatively complete and active, each block runs about three execution environments, and each shard sends transactions to other shards, the overhead can be calculated as follows:


Balance proof: 3 branches, assuming 2^16 execution environments take up approximately 15 * 3 = 45 hashes or 1440 bytes


Bit fields: assume that, on average, all receipts are declared within 5 time slots. This requires that the last 5 slots contain the proof of all sharding; These bits are contiguous, so for a bit domain segment, 320 bytes + a 1024 byte branch = 1356 bytes. A single receipt after N slots increases log (N) * 32 bytes.


Transfer value proof: given 216 execution environments and 64 shards, a Merkle branch of length 22 represents a (shard, execution environment) key. There are 64 of them, so we get 22 times 64 hashes which is 22,528 bytes. Note that we can use a smarter approach to put our common execution environment further down the tree, reducing the storage space by more than half.


Therefore, in general, each shard USES about 10-25 kB of space to store the evidence related to the cost environment.


update


See how to replace bit fields with nonceComment on the content。


Text link:https://ethresear.ch/t/a-meta-execution-environment-for-cross-shard-eth-transfers/6656

Source:https://www.unitimes.pro/m/p/4404ed455edf4bad840a0882dabc216e



Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit