Rollup data restore
All transaction data on the shard chain has full data visibility on the beacon chain, so anyone is able to restore the data on the shard chain without permission. The process of data restoration involves rebuilding the Genesis root node by getting records from the beacon chain based on the Genesis hash, and then restoring the state tree and all rollup transactions based on transaction.input
. The details are as follows.
Restore the Genesis Root Node
All the operations of the sharded chain are stored in transaction.input
on the base chain. We can get the record of Genesis hash to reconstruct the Genesis root node information by the eth_getTransactionByHash method, which is stored from the transaction.input.0
commitment
field to extract the 6 smart contract addresses.
Restore Rollup Transaction Data
The calldata
field of transaction.input.1
contains the original compressed data of all blocks of the shard chain, which can restore all transaction data.
transaction.input[1]._calldata = tx_type | chips * chip_bytes(10bytes)
DepositTx structure
0x01
6
1 ~ 5 bytes
5 ~ 9 bytes
9 ~ 25 bytes
25 ~ 45 bytes
TransferToNewAddrTx & TransferToNewAddrNFTTx structure
0x02
6
1 ~ 5 bytes
5 ~ 9 bytes
9 ~ 14 bytes
14 ~ 34 bytes
34 ~ 38 bytes
38 ~ 40 bytes
WithdrawTx structure
0x03
6
1 ~ 5 bytes
5 ~ 9 bytes
9 ~ 13 bytes
25 ~ 27 bytes
27 ~ 47 bytes
TransferTx & TransferNFTTx structure
0x05
2
1 ~ 5 bytes
5 ~ 9 bytes
9 ~ 13 bytes
13 ~ 18 bytes
18 ~ 20 bytes
FullWithdrawTx & FullWithdrawNFTTx structure
0x06
11
1 ~ 5 bytes
5 ~ 25 bytes
25 ~ 29 bytes
29 ~ 45 bytes
45 ~ 65 bytes
65 ~ 97 bytes
UpdatePublicKeyTx structure
0x07
6
1 ~ 5 bytes
5 ~ 25 bytes
25 ~ 45 bytes
45 ~ 49 bytes
49 ~ 53 bytes
53 ~ 55 bytes
ForcedWithdrawTx structure
0x08
6
1 ~ 5 bytes
5 ~ 9 bytes
9 ~ 13 bytes
13 ~ 29 bytes
29 ~ 31 bytes
31 ~ 51 bytes
MintNFTTx structure
0x09
5
1 ~ 5 bytes
5 ~ 9 bytes
9 ~ 41 bytes
41 ~ 45 bytes
45 ~ 47 bytes
WithdrawNFTTx structure
0x0a
10
1 ~ 5 bytes
5 ~ 9 bytes
9 ~ 29 bytes
29 ~ 33 bytes
33 ~ 65 bytes
65 ~ 85 bytes
85 ~ 89 bytes
89 ~ 93 bytes
93 ~ 95 bytes
SwapTx & SwapNFTTx structure
0x0b
5
1 ~ 5 bytes
5 ~ 9 bytes
9 ~ 13 bytes
13 ~ 17 bytes
17 ~ 21 bytes
21 ~ 25 bytes
25 ~ 29 bytes
29 ~ 33 byte
33 ~ 38 bytes
38 ~ 43 bytes
43 ~ 45 bytes
45~47 bytes
47 ~ 49 bytes
49 ~ 49 bytes
Last updated