WO2025139339A1 - Blockchain system and resource management method thereof - Google Patents
Blockchain system and resource management method thereof Download PDFInfo
- Publication number
- WO2025139339A1 WO2025139339A1 PCT/CN2024/128765 CN2024128765W WO2025139339A1 WO 2025139339 A1 WO2025139339 A1 WO 2025139339A1 CN 2024128765 W CN2024128765 W CN 2024128765W WO 2025139339 A1 WO2025139339 A1 WO 2025139339A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- transaction
- batch
- account
- mode
- blockchain system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/04—Payment circuits
- G06Q20/06—Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/08—Payment architectures
- G06Q20/10—Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/22—Payment schemes or models
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/40—Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
Definitions
- the embodiments of this specification belong to the field of blockchain technology, and more particularly to a blockchain system and a resource management method thereof.
- the blockchain system is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.
- data blocks are combined into a chain data structure in a sequential manner according to time order, and a distributed ledger that cannot be tampered with or forged is guaranteed by cryptography. Due to the characteristics of decentralization, information cannot be tampered with, and autonomy, the blockchain system has received more and more attention and application.
- the purpose of the present invention is to provide a blockchain system and a resource management method thereof.
- a resource management method for a blockchain system is provided, the method being executed by a second blockchain system supporting M roll-up modes, the second blockchain system including a packaged transaction batch chain, the batch chain including a plurality of batches connected in sequence, the method including: receiving a seventh transaction, the sender field and the receiver field of the seventh transaction including a first account and a second account respectively, the seventh transaction also including a resource transfer share, a first roll-up mode corresponding to the sender field, and a second roll-up mode corresponding to the receiver field; packaging the seventh transaction into a first batch in the batch chain, the first batch corresponding to the first roll-up mode, executing the seventh transaction, and realizing: according to the resource transfer share, a transaction belonging to the first roll-up mode and corresponding to the The first sub-account corresponding to the first account transfers the second target resource to the first relay sub-account belonging to the first cascading mode and corresponding to the relay account, and generates a cross-mode transfer event; according to the
- a second blockchain system including: a receiver configured to receive a seventh transaction, wherein a sender field and a receiver field of the seventh transaction include a first account and a second account respectively, and the seventh transaction also includes a resource transfer share, a first rollup mode corresponding to the sender field, and a second rollup mode corresponding to the receiver field; a sorter configured to package the seventh transaction into the first in the batch chain a batch, the first batch corresponds to the first cascading mode, the seventh transaction is executed to achieve: according to the resource transfer share, the first sub-account belonging to the first cascading mode and corresponding to the first account transfers the second target resource to the first relay sub-account belonging to the first cascading mode and corresponding to the relay account, and generates a cross-mode transfer event; the shared bridge is configured to generate an eighth transaction according to the cross-mode transfer event, the sender field and the receiver field of the eighth transaction respectively include the relay account and the second account, and the eighth transaction
- a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in the first aspect is implemented.
- a computer-readable storage medium on which a computer program is stored.
- the computing device executes the method described in the first aspect.
- the second blockchain system does not need to wait for the first batch to which the seventh transaction belongs to enter an unchangeable state, and can continue to execute the eighth transaction corresponding to the seventh transaction in a second batch located after the first batch, thereby completing the resource transfer transaction expected to be completed by the seventh transaction, which is conducive to quickly completing the resource transfer in the second blockchain system according to the user's expectations.
- FIG2 is a second schematic diagram of the principle of Layer 2 in one embodiment
- FIG4 is a fourth schematic diagram of the principle of Layer 2 in one embodiment
- FIG5 is a schematic diagram of a process of registering a Rollup mode in an embodiment
- FIG6 is one of the flow charts of a resource method of a blockchain system provided in an embodiment of this specification.
- FIG7 is a schematic diagram of Layer 1 and Layer 2 cooperating to implement resource transfer in one embodiment
- FIG8 is a schematic diagram of a client of a blockchain system and a transaction initiated by the client in one embodiment
- FIG9 is a second flowchart of a resource management method for a blockchain system provided in an embodiment of this specification.
- FIG10 is a flowchart of a resource management method for a blockchain system provided in an embodiment of this specification.
- FIG11 is a fourth flowchart of a resource management method for a blockchain system provided in an embodiment of this specification.
- FIG12 is a fifth flowchart of a resource management method for a blockchain system provided in an embodiment of this specification.
- FIG13 is a schematic diagram of the structure of a batch chain provided in an embodiment of this specification.
- FIG. 14 is a schematic diagram of an event relationship provided in an embodiment of this specification.
- Layer2 can be set up with: receivers, repeaters and sequencers of the transaction pool (Txpool); in the ZK-Rollup and TEE-Rollup mechanisms, Prover can also be set up in Layer2; for the TEE-Rollup mechanism, Prover can be set up in TEE.
- the main function of the Rollup Contract in Layer1 is to store the specified content in the transaction sent from Layer2 into the specified position, and does not involve complex execution logic.
- Tx21, Tx22, and Tx23 are stored in Tx_12 in the transaction tree locked by Tx_Root in the Block N Header.
- the Pre State Root and Post State Root in the Batch M Header in Transaction 1 can be stored in State 1 and State 2 in the contract state on Layer 1 through Rollup Contract, respectively.
- State 1 and State 2 are contained in the state trie locked by State_Root in Block N Header, specifically, in the storage trie.
- Figure 6 is one of the flow charts of a resource method of a blockchain system provided in an embodiment of this specification.
- the method exemplarily describes the process of registering a new roll-up mode (referred to as the second roll-up mode) in the first blockchain system and the second blockchain system.
- Any user, such as user 1, with an account ZK-A1 under ZK-Rollup can be derived from account A1 and the rollup mode ZK-Rollup; similarly, user 1's account TEE-A1 under TEE-Rollup can be derived from account A1 and the rollup mode TEE-Rollup.
- the second blockchain system can also construct and store the corresponding relationship between any user, such as user 1's account A1 in the first blockchain system and its account in any Rollup mode in the second blockchain system by directly maintaining a mapping relationship table.
- the client of the second blockchain system does not need to present its account ZK-A1 under ZK-Rollup and its account TEE-A1 under TEE-Rollup to user 1. It only needs to present to user 1: the share of the first target resource held by user 1's account under ZK-Rollup and the share of the first target resource held by user 1's account under ZK-Rollup.
- the client of the second blockchain system can only present to user 1 the account A1 registered in the first blockchain system; when user 1 holds the second target resource under any Rollup mode such as ZK-Rollup and TEE-Rollup, the client of the second blockchain system can also present to user 1 the share of the second target resource held by his sub-account under ZK-Rollup (i.e., the ZK account balance), and can also present to user 1 the share of the second target resource held by his sub-account under TEE-Rollup (i.e., the TEE account balance), but does not present to him the accounts ZK-A1 and TEE-A1.
- ZK-Rollup i.e., the ZK account balance
- TEE-Rollup i.e., the TEE account balance
- the second blockchain system can learn, based on transaction Tx, the subaccounts that actually need to transfer out the second target resources and the subaccounts that actually need to transfer into the second target resources in the transaction Tx, thereby completing the resource transfer transaction that the transaction Tx expects to complete by executing the transaction Tx.
- the method may include but is not limited to the following steps S901 to S907 .
- step S901 the first blockchain system receives a first transaction initiated by a first account, where the first transaction is used to call the Bridge Contract deployed by the first blockchain system.
- the first transaction indicates N types of cascading modes among the M types of cascading modes supported by the second blockchain system, and resource distribution shares corresponding to each of the N types of cascading modes.
- Step S903 the first blockchain system executes the Bridge Contract according to the first transaction to achieve: transferring the first target resource to the relay account according to the resource distribution shares corresponding to the N folding modes, and generating a resource distribution event, wherein the resource distribution event includes the first account, N folding modes and their corresponding resource distribution shares.
- the first blockchain system can, for example, execute Deposite() in Bridge Contract according to the first transaction to generate a resource distribution event.
- the resource distribution event can also include identification information of the second blockchain system.
- the management member of the second blockchain system can register a relay account corresponding to the second blockchain system, such as account A, in the first blockchain system.
- Bridge Contract can also distribute events to storage resources through corresponding asset transfer event lists or other methods.
- the Bridge included in the repeater of the second blockchain system can also query the simplified payment verification (SPV) certificate corresponding to the resource distribution event from the first blockchain system, and only execute the following step S905 after determining through the SPV certificate that the block to which the first transaction belongs has been successfully submitted in the first blockchain system.
- SPV payment verification
- Step S905 The second blockchain system generates N sub-transactions according to the resource distribution event, and any i-th sub-transaction includes the first account, the i-th folding mode among the N folding modes, and its corresponding resource distribution share.
- the From field may include the relay account
- the To field may include the first account
- the Data field may include the resource distribution share corresponding to the i-th rollup mode
- the Rollup mode included in the FR field corresponding to the From field and the TR field corresponding to the To field are both the i-th rollup mode.
- Bridge can generate TEE sub-transactions and ZK sub-transactions based on resource distribution events: in the ZK sub-transaction, the FR field corresponding to the From field and the TR field corresponding to the To field include the rollup mode of ZK-Rollup; and in the TEE sub-transaction, the FR field corresponding to the From field and the TR field corresponding to the To field include the rollup mode of TEE-Rollup.
- Step S907 the second blockchain system executes the i-th sub-transaction to achieve: determining the i-th first sub-account that belongs to the i-th cascading mode and corresponds to the first account, and transferring the second target resource to the i-th first sub-account from the relay sub-account that belongs to the i-th cascading mode and corresponds to the relay account according to the resource distribution share corresponding to the i-th cascading mode.
- the second blockchain system can execute the ith sub-transaction through its Sequencer.
- the Sequencer executes the ith sub-transaction: in one possible implementation, the first account included in the ith sub-transaction and the ith folding mode can be used to perform a derivative calculation to obtain the ith first sub-account; in another possible implementation, the ith first sub-account can be obtained by querying the mapping relationship table maintained in the second blockchain system.
- the Sequencer After the Sequencer obtains the ith first sub-account, it can query the ith first sub-account in the sub-state tree corresponding to the ith roll-up mode. If the ith first sub-account cannot be queried from the sub-state tree corresponding to the ith roll-up mode, the ith first sub-account can be registered in the corresponding sub-state tree by calling the system contract of the second blockchain system.
- the first account includes account A2
- the N types of Rollup modes include TEE-Rollup and ZK-Rollup.
- the Sequencer can call the System Contract of the second blockchain system to register the sub-account ZK-A2 in the sub-state tree corresponding to ZK-Rollup; if the Sequencer fails to find the sub-account TEE-A2 corresponding to account A2 from the sub-state tree corresponding to TEE-Rollup during the execution of the TEE sub-transaction, the Sequencer can call the System Contract of the second blockchain system to register the sub-account TEE-A2 in the sub-state tree corresponding to TEE-Rollup.
- the Sequencer of the second blockchain system can transfer the second target resource to the i-th first sub-account from the relay sub-account belonging to the i-th cascading mode and corresponding to the relay account based on the resource distribution share included in the i-th sub-transaction.
- the Sequencer can, for example, transfer the second target resource from ZK-AA to the sub-account ZK-A2 according to the resource distribution share included in the ZK sub-transaction, and transfer the second target resource from TEE-AA to the sub-account ZK-A2 according to the resource distribution share included in the TEE sub-transaction.
- the second target resource may be deposited into the i-th first sub-account by other methods other than the aforementioned step 907.
- the second blockchain system executes the i-th sub-transaction, it may be implemented as follows: determining the i-th first sub-account that belongs to the i-th folding mode and corresponds to the first account, and casting the second target resource for the i-th first sub-account according to the resource distribution share corresponding to the i-th folding mode.
- the Rollup Contract in the first blockchain system can perceive that the i-th sub-transaction has entered an unchangeable state.
- the Rollup Contract can also generate the i-th asset transfer completion event corresponding to the i-th sub-transaction by calling the Bridge Contract.
- the asset transfer completion event may include, for example, the first account, the i-th rollup mode and its corresponding resource distribution share; further, when the Bridge Contract collects N asset transfer completion events corresponding to N sub-exchanges, the Bridge Contract can confirm that the N asset transfer completion events are successfully matched with the aforementioned resource distribution events based on the contents included in the N asset transfer completion events and the aforementioned resource distribution events, thereby confirming that all the transactions expected to be executed by the first transaction have been successfully executed.
- Bridge Contract fails to completely collect N asset transfer completion events corresponding to N sub-exchanges, it means that some or all of the sub-transactions have not been successfully executed in the second blockchain system.
- the management members of Bridge Contract can, for example, determine the compensation share of the first target resource that needs to be returned from the relay account to the first account based on the resource distribution event and the collected asset transfer completion events, and thus transfer the first target resource from the relay account to the first account based on the compensation share through the corresponding contract call transaction or other methods.
- Figure 10 is a flowchart of a resource management method for a blockchain system provided in an embodiment of this specification.
- the method exemplarily describes the process of adding a corresponding share of the first target resource to the first account registered by the first user in the first blockchain system according to the second target resource held by the sub-account belonging to any first roll-up mode in the second blockchain system when the second blockchain system supports M roll-up modes.
- the method may include but is not limited to the following steps S1001 to S1007 .
- Step S1001 The second blockchain system receives a second transaction initiated by a first account, wherein the second transaction indicates a resource transfer share and a first roll-up mode.
- the first roll-up mode belongs to the M roll-up modes supported by the second blockchain system.
- the From field of the second transaction may include the first account, and the folding mode included in the FR field corresponding to the From field may be the first folding mode; the Data field of the second transaction may include the resource transfer share.
- the To field of the second transaction and its corresponding TR field may be set according to preset rules, for example: both the To field and the TR field are Null; or the To field and the From field include the same first account, and the TR field and the FR field include the same first folding mode.
- the receiver of the second blockchain system can add the second transaction to the transaction pool corresponding to the first concatenation mode according to the first concatenation mode included in the FR field corresponding to the sender field in the second transaction.
- Step S1003 the second blockchain system executes the second transaction to achieve: determining a second sub-account that belongs to the first cascading mode and corresponds to the first account, and transferring the second target resource from the second sub-account to a relay sub-account that belongs to the first cascading mode and corresponds to the relay account according to the resource transfer share.
- the third transaction may also include the batch number of the third batch to which the second transaction belongs, and the third transaction may also include the transaction number of the second transaction in the third batch.
- the Bridge of the second blockchain system may send the third transaction to the first blockchain system only after the Replayer has completed submitting the proof data corresponding to the third batch to the first blockchain system.
- the asset transfer completion event is used to support Bridge Contract to match it with the asset pending transfer event in the event set, so as to confirm the asset transfer transaction that the transaction corresponding to the asset pending transfer event has completed.
- Step S1225 The second blockchain system sends the twelfth transaction to the first blockchain system through the second prover corresponding to the second rolling mode.
- the twelfth transaction is used to call the fifth method function in the Rollup Contract deployed by the first blockchain system.
- the twelfth transaction includes the second proof data corresponding to the second rolling mode and the second batch.
- the fifth method function in the Rollup Contract can, for example, call the verification method TEE verifier corresponding to the TEE-Rollup in the contract according to the TEE-Rollup included in the twelfth transaction, and process the second proof data included in the twelfth transaction through the TEE verifier to complete the verification of whether the multiple transactions in the second batch are correctly executed. If the verification is passed, the second batch enters an unchangeable state; at the same time, the fifth method function itself, or by calling the Bridge Contract in the contract, generates asset pending transfer events for transactions in certain specific data formats, and generates asset transfer completion events for transactions in certain specific data formats.
- the asset transfer completion event generated for the eighth transaction can be used to consume the asset pending transfer event corresponding to the seventh transaction in the event set maintained by Bridge Contrac, thereby confirming that the transaction expected to be completed by the seventh transaction is successfully executed.
- the asset pending transfer event and the asset transfer completion event shown in Figure 14 can be generated accordingly, and the two events will be successfully matched.
- the management member can confirm that the resource transfer transaction expected to be completed by the seventh transaction is not successfully executed by querying the event set, and based on the asset pending transfer event corresponding to the seventh transaction, return the corresponding second target resource to the sub-account belonging to the first cascading mode and corresponding to the first account.
- the technical solutions described in the above method steps S1201 to S1227 mainly describe the following aspects: The process of transferring resources from a first sub-account in a rollover mode and corresponding to a first account to a second sub-account in a second rollover mode (different from the first rollover mode) and corresponding to a second account.
- the FR field and the TR field of some transactions may include the same rollover mode. In this case, the transaction that is expected to be completed can be completed by other means.
- the second blockchain system may receive the thirteenth transaction, the sender field and the receiver field of the thirteenth transaction include the first account and the second account respectively, and the thirteenth transaction also includes a resource transfer share, a first roll-up mode corresponding to the sender field, and a first roll-up mode corresponding to the receiver field; in this case, after the second blockchain system packages the thirteenth transaction into a batch corresponding to the first roll-up mode, such as the fourth batch, when executing the thirteenth transaction, the second target resource can be directly transferred from the first sub-account belonging to the first roll-up mode and corresponding to the first account to the third sub-account belonging to the first roll-up mode and corresponding to the second account according to the resource transfer share.
- a second blockchain system is also provided in the embodiment of the specification, wherein the second blockchain system supports M types of cascading modes, and the second blockchain system includes a packaged transaction batch chain, wherein the batch chain includes multiple batches connected in sequence.
- the second blockchain also includes: a receiver configured to receive a seventh transaction, wherein the sender field and the receiver field of the seventh transaction include a first account and a second account respectively, and the seventh transaction also includes a resource transfer share, a first cascading mode corresponding to the sender field, and a second cascading mode corresponding to the receiver field; a sorter configured to package the seventh transaction into the first batch in the batch chain, wherein the first batch corresponds to the first cascading mode, and execute the seventh transaction to achieve: according to the resource transfer share, the second target is transferred from the first subaccount belonging to the first cascading mode and corresponding to the first account to the first relay subaccount belonging to the first cascading mode and corresponding to the relay account resources, and generates a cross-mode transfer event; a shared bridge is configured to generate an eighth transaction according to the cross-mode transfer event, the sender field and the receiver field of the eighth transaction respectively include the relay account and the second account, and the eighth transaction also includes the resource transfer share
- a computer-readable storage medium is also provided in an embodiment of the present specification, on which a computer program/instruction is stored.
- the computer program/instruction is executed in a computer, the computer is caused to execute the method steps performed by the first blockchain system or the second blockchain system in the aforementioned embodiments.
- a computing device including a memory and a processor, wherein the memory stores a computer program/instruction, and when the processor executes the computer program/instruction, the method steps performed by the first blockchain system or the second blockchain system in the aforementioned embodiments are implemented.
- a programmable logic device such as a field programmable gate array (FPGA)
- FPGA field programmable gate array
- HDL There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc.
- ABEL Advanced Boolean Expression Language
- AHDL Altera Hardware Description Language
- HDCal JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc.
- VHDL Very-High-Speed Integrated Circuit Hardware Description Language
- Verilog Verilog
- the controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer readable medium storing a computer readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory.
- a computer readable program code e.g., software or firmware
- the controller may be implemented in the form of a logic gate, a switch, an application specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the means for implementing various functions included therein may also be considered as a structure within the hardware component. Or even, the means for implementing various functions may be considered as both a software module for implementing the method and a structure within the hardware component.
- the systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions.
- a typical implementation device is a server system.
- the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
- each module can be implemented in the same or more software and/or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc.
- the device embodiments described above are only schematic.
- the division of the units is only a logical function division. There may be other division methods in actual implementation.
- multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
- Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
- each process and/or box in the flowchart and/or block diagram, as well as the combination of the process and/or box in the flowchart and/or block diagram can be implemented by computer program instructions.
- These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
- These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
- These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
- a computing device includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
- processors CPU
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
- RAM random access memory
- ROM read-only memory
- flash RAM flash memory
- Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information.
- the information can be computer-readable instructions, data structures, program modules or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only ROM, EEPROM, flash memory or other memory technology, CD-ROM, DVD or other optical storage, magnetic cassettes, magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
- PRAM phase change memory
- SRAM static random access memory
- DRAM dynamic random access memory
- RAM random access memory
- read-only ROM EEPROM
- flash memory or other memory technology
- CD-ROM DVD or other optical storage
- magnetic cassettes magnetic disk storage
- graphene storage or other magnetic storage devices or any other non-transmission
- One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules.
- program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
- One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network.
- program modules may be located in local and remote computer storage media, including storage devices.
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Theoretical Computer Science (AREA)
- Finance (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本申请要求于2023年12月29日提交中国国家知识产权局、申请号为202311869835.6、申请名称为“区块链系统及其资源管理方法”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on December 29, 2023, with application number 202311869835.6 and application name “Blockchain system and its resource management method”, all contents of which are incorporated by reference in this application.
本说明书实施例属于区块链技术领域,尤其涉及一种区块链系统及其资源管理方法。The embodiments of this specification belong to the field of blockchain technology, and more particularly to a blockchain system and a resource management method thereof.
区块链(Blockchain)系统是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链系统中按照时间顺序将数据区块以顺序相连的方式组合成链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。由于区块链系统具有去中心化、信息不可篡改、自治性等特性,区块链系统受到人们越来越多的重视和应用。The blockchain system is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. In the blockchain system, data blocks are combined into a chain data structure in a sequential manner according to time order, and a distributed ledger that cannot be tampered with or forged is guaranteed by cryptography. Due to the characteristics of decentralization, information cannot be tampered with, and autonomy, the blockchain system has received more and more attention and application.
发明内容Summary of the invention
本发明的目的在于提供一种区块链系统及其资源管理方法。The purpose of the present invention is to provide a blockchain system and a resource management method thereof.
第一方面,提供了一种区块链系统的资源管理方法,所述方法由支持M种卷叠模式的第二区块链系统执行,所述第二区块链系统中包括打包交易batch链,所述batch链中包括顺序连接的多个batch,所述方法包括:接收第七交易,所述第七交易的发送方字段和接收方字段分别包括第一账户和第二账户,所述第七交易中还包括资源转移份额、与所述发送方字段对应的第一卷叠模式和与所述接收方字段对应的第二卷叠模式;将所述第七交易打包到所述batch链中的第一batch,所述第一batch与所述第一卷叠模式对应,执行所述第七交易,实现:根据所述资源转移份额,从属于所述第一卷叠模式并与所述第一账户对应的第一子账户,向属于所述第一卷叠模式并与中继账户对应的第一中继子账户转移第二目标资源,并生成跨模式转账事件;根据所述跨模式转账事件,生成第八交易,所述第八交易的发送方字段和接收方字段分别包括所述中继账户和所述第二账户,所述第八交易中还包括所述资源转移份额和所述第二卷叠模式;将所述第八交易打包到所述batch链中的第二batch,所述第二batch与所述第二卷叠模式对应,执行所述第八交易,实现:根据所述资源转移份额,从属于所述第二卷叠模式并与所述中继账户对应的第二中继子账户,向属于所述第二卷叠模式并与所述第二账户对应的第二子账户转移第二目标资源。In a first aspect, a resource management method for a blockchain system is provided, the method being executed by a second blockchain system supporting M roll-up modes, the second blockchain system including a packaged transaction batch chain, the batch chain including a plurality of batches connected in sequence, the method including: receiving a seventh transaction, the sender field and the receiver field of the seventh transaction including a first account and a second account respectively, the seventh transaction also including a resource transfer share, a first roll-up mode corresponding to the sender field, and a second roll-up mode corresponding to the receiver field; packaging the seventh transaction into a first batch in the batch chain, the first batch corresponding to the first roll-up mode, executing the seventh transaction, and realizing: according to the resource transfer share, a transaction belonging to the first roll-up mode and corresponding to the The first sub-account corresponding to the first account transfers the second target resource to the first relay sub-account belonging to the first cascading mode and corresponding to the relay account, and generates a cross-mode transfer event; according to the cross-mode transfer event, an eighth transaction is generated, the sender field and the receiver field of the eighth transaction respectively include the relay account and the second account, and the eighth transaction also includes the resource transfer share and the second cascading mode; the eighth transaction is packaged into the second batch in the batch chain, the second batch corresponds to the second cascading mode, and the eighth transaction is executed to achieve: according to the resource transfer share, the second relay sub-account belonging to the second cascading mode and corresponding to the relay account transfers the second target resource to the second sub-account belonging to the second cascading mode and corresponding to the second account.
第二方面,提供了一种第二区块链系统,包括:接收器,配置为接收第七交易,所述第七交易的发送方字段和接收方字段分别包括第一账户和第二账户,所述第七交易中还包括资源转移份额、与所述发送方字段对应的第一卷叠模式和与所述接收方字段对应的第二卷叠模式;排序器,配置为将所述第七交易打包到所述batch链中的第 一batch,所述第一batch与所述第一卷叠模式对应,执行所述第七交易,实现:根据所述资源转移份额,从属于所述第一卷叠模式并与所述第一账户对应的第一子账户,向属于所述第一卷叠模式并与中继账户对应的第一中继子账户转移第二目标资源,并生成跨模式转账事件;共享桥,配置为根据所述跨模式转账事件,生成第八交易,所述第八交易的发送方字段和接收方字段分别包括所述中继账户和所述第二账户,所述第八交易中还包括所述资源转移份额和所述第二卷叠模式;所述排序器,配置为将所述第二交易打包到所述batch链中的第二batch,所述第二batch与所述第二卷叠模式对应,执行所述第八交易,实现:根据所述资源转移份额,从属于所述第二卷叠模式并与所述中继账户对应的第二中继子账户,向属于所述第二卷叠模式并与所述第二账户对应的第二子账户转移第二目标资源。In a second aspect, a second blockchain system is provided, including: a receiver configured to receive a seventh transaction, wherein a sender field and a receiver field of the seventh transaction include a first account and a second account respectively, and the seventh transaction also includes a resource transfer share, a first rollup mode corresponding to the sender field, and a second rollup mode corresponding to the receiver field; a sorter configured to package the seventh transaction into the first in the batch chain a batch, the first batch corresponds to the first cascading mode, the seventh transaction is executed to achieve: according to the resource transfer share, the first sub-account belonging to the first cascading mode and corresponding to the first account transfers the second target resource to the first relay sub-account belonging to the first cascading mode and corresponding to the relay account, and generates a cross-mode transfer event; the shared bridge is configured to generate an eighth transaction according to the cross-mode transfer event, the sender field and the receiver field of the eighth transaction respectively include the relay account and the second account, and the eighth transaction also includes the resource transfer share and the second cascading mode; the sorter is configured to package the second transaction into the second batch in the batch chain, the second batch corresponds to the second cascading mode, and the eighth transaction is executed to achieve: according to the resource transfer share, the second relay sub-account belonging to the second cascading mode and corresponding to the relay account transfers the second target resource to the second sub-account belonging to the second cascading mode and corresponding to the second account.
第三方面,提供了一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现第一方面中所述的方法。According to a third aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in the first aspect is implemented.
第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算设备中执行时,计算设备执行第一方面中所述的方法。According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computing device, the computing device executes the method described in the first aspect.
本说明书实施例提供的技术方案中,因M种卷叠模式对应相同的由多个batch顺序连接而成的batch链,在后提交的batch通过世界状态的状态根实现绑定,如果在先提交的位置相对靠前的batch因故回滚,则在后提交的位置相对靠后的batch必然需要回滚,因此无需等待在先提交的batch已进入不可更改状态后才在该batch链中继续提交新的batch。与之相应的是,当用户通过第一账户和第二账户发起第七交易,期望在属于不同卷叠模式并分别对应第一账户和第二账户的两个子账户间转移目标资源时,第二区块链系统无需等待第七交易所属第一batch进入不可更改状态,即可继续在位于第一batch之后的某个第二batch中,完成执行与第七交易对应的第八交易,进而完成第七交易期望完成的资源转移事务,有利于在第二区块链系统中按照用户的期望快速的完成资源转移。In the technical solution provided by the embodiments of this specification, since M types of rollup modes correspond to the same batch chain formed by connecting multiple batches in sequence, the batch submitted later is bound through the state root of the world state. If the batch submitted earlier with a relatively forward position is rolled back for some reason, the batch submitted later with a relatively backward position must be rolled back. Therefore, there is no need to wait for the batch submitted earlier to enter an unchangeable state before continuing to submit a new batch in the batch chain. Correspondingly, when the user initiates the seventh transaction through the first account and the second account, and expects to transfer the target resource between two sub-accounts belonging to different rollup modes and corresponding to the first account and the second account respectively, the second blockchain system does not need to wait for the first batch to which the seventh transaction belongs to enter an unchangeable state, and can continue to execute the eighth transaction corresponding to the seventh transaction in a second batch located after the first batch, thereby completing the resource transfer transaction expected to be completed by the seventh transaction, which is conducive to quickly completing the resource transfer in the second blockchain system according to the user's expectations.
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
图1是一实施例中Layer2的原理示意图之一;FIG1 is one of the principle schematic diagrams of Layer 2 in one embodiment;
图2是一实施例中Layer2的原理示意图之二;FIG2 is a second schematic diagram of the principle of Layer 2 in one embodiment;
图3是一实施例中Layer2的原理示意图之三;FIG3 is a third schematic diagram of the principle of Layer 2 in one embodiment;
图4是一实施例中Layer2的原理示意图之四;FIG4 is a fourth schematic diagram of the principle of Layer 2 in one embodiment;
图5是一实施例中注册Rollup模式的的过程示意图;FIG5 is a schematic diagram of a process of registering a Rollup mode in an embodiment;
图6为本说明书实施例中提供的一种区块链系统的资源方法的流程图之一;FIG6 is one of the flow charts of a resource method of a blockchain system provided in an embodiment of this specification;
图7是一实施例中Layer1和Layer2协作实现资源转移的示意图;FIG7 is a schematic diagram of Layer 1 and Layer 2 cooperating to implement resource transfer in one embodiment;
图8是一实施例中区块链系统的客户端以及其发起的交易的示意图;FIG8 is a schematic diagram of a client of a blockchain system and a transaction initiated by the client in one embodiment;
图9为本说明书实施例中提供的一种区块链系统的资源管理方法的流程图之二; FIG9 is a second flowchart of a resource management method for a blockchain system provided in an embodiment of this specification;
图10为本说明书实施例中提供的一种区块链系统的资源管理方法的流程图之三;FIG10 is a flowchart of a resource management method for a blockchain system provided in an embodiment of this specification;
图11为本说明书实施例中提供的一种区块链系统的资源管理方法的流程图之四;FIG11 is a fourth flowchart of a resource management method for a blockchain system provided in an embodiment of this specification;
图12为本说明书实施例中提供的一种区块链系统的资源管理方法的流程图之五;FIG12 is a fifth flowchart of a resource management method for a blockchain system provided in an embodiment of this specification;
图13为本说明书实施例中提供的一种batch链的结构示意图;FIG13 is a schematic diagram of the structure of a batch chain provided in an embodiment of this specification;
图14为本说明书实施例中提供的一种事件关系示意图。FIG. 14 is a schematic diagram of an event relationship provided in an embodiment of this specification.
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
分布式系统中存在经典的CAP定理-Consistency(一致性)、Availability(可用性)、Partition tolerance(分区容错性),三者不可兼得,简称“不可能三角”问题。区块链系统中也存在一个不可能三角:效率、去中心化、安全。尽管这里的区块链系统“不可能三角”还没有明确的理论论证,但是是对现有区块链系统的总结。这里的效率、去中心化和安全,分别定义如下:效率:每秒处理交易的数量,即TPS(Transaction per Second);去中心化:参与节点门槛足够低,保证系统中有大量分布式的节点;安全:对区块链系统发动攻击的难度足够大。There is a classic CAP theorem in distributed systems - Consistency, Availability, and Partition tolerance. You can't have all three at the same time, which is referred to as the "impossible triangle" problem. There is also an impossible triangle in the blockchain system: efficiency, decentralization, and security. Although there is no clear theoretical demonstration of the "impossible triangle" of the blockchain system here, it is a summary of the existing blockchain system. The efficiency, decentralization, and security here are defined as follows: Efficiency: the number of transactions processed per second, that is, TPS (Transaction per Second); Decentralization: the threshold for participating nodes is low enough to ensure that there are a large number of distributed nodes in the system; Security: It is difficult enough to launch attacks on the blockchain system.
针对上述区块链系统“不可能三角”的问题,Ethereum(也就是以太坊,也称为“主网”或“一层”,Mainnet或Layer1;此外,目前较为流行的还有币安的BSC、波场TRON等的公链项目,也是Layer1/主网的范畴)选择了安全性和去中心化,牺牲了效率,目前只有大约12~15TPS。当有大量交易需要处理时,尤其是很多操作复杂的交易时,Layer1就会拥堵。除了普通的转账交易外,Layer1还作为DeFi(去中心化金融)和NFT(非同质化代币)等火爆应用的主要平台,在交易盛行时,Layer1拥堵的问题就变得十分严重,带来较大的交易延迟。In response to the "impossible triangle" problem of the above-mentioned blockchain system, Ethereum (also known as "mainnet" or "layer", Mainnet or Layer1; in addition, the more popular public chain projects such as Binance's BSC and TRON are also in the category of Layer1/mainnet) chose security and decentralization, sacrificing efficiency, and currently only has about 12 to 15 TPS. When there are a large number of transactions to be processed, especially when there are many complex transactions, Layer1 will be congested. In addition to ordinary transfer transactions, Layer1 is also the main platform for popular applications such as DeFi (decentralized finance) and NFT (non-homogeneous tokens). When transactions are prevalent, the problem of Layer1 congestion becomes very serious, resulting in large transaction delays.
高昂的Gas fee(汽油费,或交易费)很多时候成为交易的障碍。尽管已从PoW(工作量证明)转向了PoS(权益证明),但这只是改变了区块链上记账权的获取方式,而需要支付给获得记账权的节点的交易费没有明显减少。这是因为Gas费的设计针对的是节点执行交易(包括执行智能合约代码)的消耗,这部分消耗不改变的情况下Gas费并不会降低。例如,一笔去中心化交易所的货币兑换交易的交易费在拥堵时可能会超过100美元,这让很多用户望而却步。High gas fees (gas fees, or transaction fees) often become an obstacle to transactions. Although it has shifted from PoW (proof of work) to PoS (proof of stake), this only changes the way of obtaining the right to record on the blockchain, and the transaction fees that need to be paid to the nodes that obtain the right to record have not decreased significantly. This is because the design of the gas fee targets the consumption of nodes executing transactions (including executing smart contract codes), and the gas fee will not be reduced if this part of the consumption does not change. For example, the transaction fee of a currency exchange transaction on a decentralized exchange may exceed $100 during congestion, which discourages many users.
Layer 2技术是构建在Layer1之上的扩展性解决方案,旨在解决Layer1的效率低和交易费用高的问题。如图1所示,交易可以在Layer2上快速执行,Layer2按照一定的时机将最终状态同步回Layer1。Layer2用于专门提供高速的交易处理,而安全性和去中心化交由Layer1去保障。这样,减轻Layer1压力的同时,Layer2上执行交易的Gas费可以大幅下降,将Layer2上交易执行的最终状态(而不是Layer2上所有的状态)同步回Layer1所需的Gas费也可以大幅下降。在Layer1之上架构Layer 2的技术,实际上是将交易或合约的执行过程与最终状态的保存分离开,执行过程放到了Layer2,Layer1只需 要保存最终的状态。这个设计中,需要保证Layer2上交易或合约的执行过程的正确性,并且写入Layer1的状态与Layer2上正确执行的结果是一致的。Layer 2 technology is a scalability solution built on Layer 1, which aims to solve the problems of low efficiency and high transaction fees of Layer 1. As shown in Figure 1, transactions can be executed quickly on Layer 2, and Layer 2 synchronizes the final state back to Layer 1 at a certain time. Layer 2 is used to provide high-speed transaction processing, while security and decentralization are guaranteed by Layer 1. In this way, while reducing the pressure on Layer 1, the gas fee for executing transactions on Layer 2 can be greatly reduced, and the gas fee required to synchronize the final state of the transaction execution on Layer 2 (rather than all the states on Layer 2) back to Layer 1 can also be greatly reduced. The technology of building Layer 2 on top of Layer 1 actually separates the execution process of transactions or contracts from the preservation of the final state. The execution process is placed on Layer 2, and Layer 1 only needs to To save the final state, this design requires ensuring the correctness of the execution process of transactions or contracts on Layer2, and that the state written to Layer1 is consistent with the result of correct execution on Layer2.
Ethereum的Layer2包括一种称为Rollup的机制。Ethereum's Layer2 includes a mechanism called Rollup.
Rollup的核心思路如图1所示,是在Layer1上保存能够验证交易过程的凭证,而将交易过程(计算过程)还有状态存储运行在Layer2中。所谓交易过程的凭证,包括一组交易执行前的状态(Pre-State)和该组交易执行后的状态(Post-State)以及该组交易,可以用于验证这组交易对应的状态转移是否正确,还可以用于还原出Layer2上所有交易的执行过程和所有账户的状态,从而消除Layer2上由于数据可用性带来的安全风险The core idea of Rollup is shown in Figure 1, which is to save the credentials that can verify the transaction process on Layer1, and run the transaction process (computation process) and state storage in Layer2. The so-called transaction process credentials include a set of states before the execution of a transaction (Pre-State) and the state after the execution of the transaction (Post-State) and the transaction. It can be used to verify whether the state transfer corresponding to the transaction is correct, and can also be used to restore the execution process of all transactions on Layer2 and the status of all accounts, thereby eliminating the security risks caused by data availability on Layer2.
Rollup的原理具体可以如图2和图3(图3中主要是下文中的OP-Rollup)所示。The principle of Rollup can be specifically shown in Figures 2 and 3 (Figure 3 mainly refers to the OP-Rollup mentioned below).
创建智能合约的交易发送到Layer1上,经过Layer1的共识之后,Layer1上各节点可以执行这个交易,从而完成合约的部署。具体的,可以是由区块链节点的EVM/WASM来执行这个交易。EVM是一个图灵完备的虚拟机,这意味着可以通过它实现各种复杂的逻辑,这也是以太坊作为区块链2.0的代表相对于区块链1.0的最大改进之一。用户在以太坊中发布和调用智能合约可以在EVM上运行。执行该部署智能合约的交易之后,Layer1上产生一个与该智能合约对应的合约账户,该合约账户具有链上的地址,并且包括余额balance、计数器nonce、合约代码的hash值Codehash,合约存储的根Storage_Root。通过Codehash和Storage_Root,该合约的代码和账户存储可以保存在该合约账户中。智能合约的行为由合约代码控制,而智能合约的账户存储则保存了合约的状态。换句话说,智能合约使得区块链上产生包含合约代码和账户存储(Storage)的虚拟账户。后续,Layer1上的节点可以接收调用部署的智能合约的交易请求,该交易请求可以包括调用的合约的地址、调用的合约中的函数和输入的参数。一般的,该交易请求经过共识后,区块链各个节点可以各自独立执行指定调用的智能合约。The transaction to create a smart contract is sent to Layer1. After the consensus of Layer1, each node on Layer1 can execute this transaction to complete the deployment of the contract. Specifically, the transaction can be executed by the EVM/WASM of the blockchain node. EVM is a Turing-complete virtual machine, which means that various complex logics can be implemented through it. This is also one of the biggest improvements of Ethereum as a representative of blockchain 2.0 compared to blockchain 1.0. Users can run smart contracts on EVM when publishing and calling them in Ethereum. After executing the transaction to deploy the smart contract, a contract account corresponding to the smart contract is generated on Layer1. The contract account has an address on the chain and includes a balance, a counter nonce, a hash value of the contract code Codehash, and the root of the contract storage Storage_Root. Through Codehash and Storage_Root, the code and account storage of the contract can be saved in the contract account. The behavior of the smart contract is controlled by the contract code, and the account storage of the smart contract saves the state of the contract. In other words, the smart contract generates a virtual account containing contract code and account storage (Storage) on the blockchain. Subsequently, nodes on Layer 1 can receive transaction requests to call deployed smart contracts, which may include the address of the called contract, the function in the called contract, and the input parameters. Generally, after the transaction request reaches consensus, each node in the blockchain can independently execute the specified smart contract.
以太坊中的Storage_root是一个MPT树根节点的哈希,这个MPT树对合约账户的状态的存储进行组织。MPT全称为Merkle Patricia Tree,是结合了Merkle Tree(默克尔树)和Patricia Tree(压缩前缀树,一种更节省空间的Trie树,字典树)的一种树形结构。Merkle Tree算法对每个交易都计算一个Hash值,然后两两连接再次计算Hash,一直到最顶层的Merkle根。以太坊中采用改进的MPT树,例如是16叉树的结构,通常也简称为MPT树。实际上,以太坊区块头中包括三颗MPT树的树根,分别是Transaction_Root(简写为Tx_Root)、State_Root、Receipt_Root。State_Root当前区块中所有账户的状态组成的MPT树的根的哈希值,即指向State_Root的为一颗MPT形式的状态树state trie。从这个MPT的根节点到叶子节点中每个节点的一部分值按照顺序串联起来可以构成账户地址并作为key,叶子节点中存储的账户信息为这个账户地址对应的value,构成了key-value键值对。前述的key可以是sha3(Address),即账户地址的hash值(hash算法例如采用sha3算法),其存储的值value可以为rlp(Account),即账户信息的rlp(Recursive Length Prefix,递归长度前缀)编码。账户信息是[nonce,balance,storageRoot,codeHash]构成的四元组。对于外部账户(Externally Owned Account,简称EOA)来说,一般只有nonce和balance两项,而storageRoot、codeHash字段默认存储空字符串/全0字符串。即外部账户不存储合约,也不存储合约执行后的产生的状态变量。合约账户包括Nonce, Balance,Storage root,CodeHash。不论是外部账户还是合约账户,其账户信息一般都位于一个单独的叶子节点(Leaf Node)中。Storage_root in Ethereum is the hash of the root node of an MPT tree. This MPT tree organizes the storage of the state of the contract account. MPT stands for Merkle Patricia Tree, which is a tree structure that combines Merkle Tree and Patricia Tree (compressed prefix tree, a more space-saving Trie tree, dictionary tree). The Merkle Tree algorithm calculates a hash value for each transaction, and then connects two by two to calculate the hash again, all the way to the top Merkle root. Ethereum uses an improved MPT tree, such as a 16-way tree structure, which is usually referred to as an MPT tree. In fact, the Ethereum block header includes the roots of three MPT trees, namely Transaction_Root (abbreviated as Tx_Root), State_Root, and Receipt_Root. State_Root is the hash value of the root of the MPT tree composed of the state of all accounts in the current block, that is, the state trie pointing to State_Root is a state tree in the form of MPT. Part of the value of each node from the root node to the leaf node of this MPT is connected in sequence to form an account address and serve as a key. The account information stored in the leaf node is the value corresponding to this account address, forming a key-value pair. The aforementioned key can be sha3 (Address), that is, the hash value of the account address (the hash algorithm, for example, uses the sha3 algorithm), and the stored value value can be rlp (Account), that is, the rlp (Recursive Length Prefix) encoding of the account information. The account information is a four-tuple consisting of [nonce, balance, storageRoot, codeHash]. For external accounts (Externally Owned Account, referred to as EOA), there are generally only two items, nonce and balance, and the storageRoot and codeHash fields store empty strings/all 0 strings by default. That is, external accounts do not store contracts, nor do they store state variables generated after the execution of contracts. Contract accounts include Nonce, Balance, Storage root, CodeHash. Regardless of whether it is an external account or a contract account, its account information is generally located in a separate leaf node.
对于state trie中的一个合约账户(Contract Account,简写为CA)来说,其storage_Root指向另一颗同为MPT形式的树,其中存储了合约执行涉及的状态变量(state variable)的数据。这个storage_Root指向的MPT形式的树为Storage Trie,即storage_Root中存储Storage Trie的根节点的hash值。一般的,这个Storage Trie树存储的也是key-value键值对。key表明状态变量的地址,其取值可以是合约中的状态变量声明的位置(从0开始计数的值)经过一定规则处理后得到的结果,例如是sha3(状态变量声明的位置),或者是sha3(合约名称+状态变量声明的位置)。value用于存储状态变量的取值(例如是经RLP编码的值)。从根节点到叶子节点的路径上存储的一部分数据连起来构成key,叶子节点中存储value。State trie和其中的Storage trie中,除了叶子节点外的根节点、中间节点采用图3中云朵状来表示其中灵活和复杂多变的结构。For a contract account (CA) in the state trie, its storage_Root points to another tree in the form of MPT, which stores the data of the state variables involved in the contract execution. The MPT tree pointed to by this storage_Root is the Storage Trie, that is, the hash value of the root node of the Storage Trie is stored in the storage_Root. Generally, this Storage Trie tree also stores key-value pairs. The key indicates the address of the state variable, and its value can be the result obtained by processing the position of the state variable declaration in the contract (the value counting from 0) according to certain rules, such as sha3 (the position of the state variable declaration) or sha3 (the contract name + the position of the state variable declaration). The value is used to store the value of the state variable (for example, the value encoded by RLP). A part of the data stored on the path from the root node to the leaf node is connected to form the key, and the value is stored in the leaf node. In the State trie and the Storage trie therein, the root nodes and intermediate nodes except the leaf nodes are in the cloud shape as shown in Figure 3 to represent the flexible and complex structure.
如图2所示,Rollup中可以在Layer1上部署Rollup Contract。Layer2中,可以接收发起的交易,如图中的Tx_21、Tx_22等。一个批次的交易称为一个交易组(即Batch),作为一个整体按序执行并更新状态。如图1和2中所示,Batch 1假设可以包括Tx_21、Tx_22、Tx_23这3笔交易,Batch 2假设可以包括Tx_24、Tx_25、Tx_26这3笔交易。Layer2中可以按照一种规则对这些交易进行排序,进而可以按照顺序执行排序后的这些交易,例如按照交易中的时间戳排序。一个Batch中的交易在按序执行后,产生的状态可以包括若干,例如Batch 1中的交易分别为:As shown in Figure 2, in Rollup, Rollup Contract can be deployed on Layer 1. In Layer 2, initiated transactions can be received, such as Tx_21, Tx_22, etc. in the figure. A batch of transactions is called a transaction group (i.e., Batch), which is executed in sequence as a whole and updates the status. As shown in Figures 1 and 2, Batch 1 is assumed to include three transactions, Tx_21, Tx_22, and Tx_23, and Batch 2 is assumed to include three transactions, Tx_24, Tx_25, and Tx_26. In Layer 2, these transactions can be sorted according to a rule, and then the sorted transactions can be executed in sequence, such as sorting according to the timestamps in the transactions. After the transactions in a Batch are executed in sequence, the resulting states may include several, for example, the transactions in Batch 1 are:
Tx_21:Alice→Bob 20;表示Alice转给Bob 20个单位的资产,如以太币;Tx_21: Alice→Bob 20; indicates that Alice transfers 20 units of assets, such as ether, to Bob;
Tx_22:Alice→Charlie 10;表示Alice转给Charlie 10个单位的资产,如以太币;Tx_22: Alice→Charlie 10; indicates that Alice transfers 10 units of assets, such as ether, to Charlie;
Tx_23:Bob→Charlie 10;表示Bob转给Charlie 10个单位的资产,如以太币;Tx_23: Bob→Charlie 10; indicates that Bob transfers 10 units of assets, such as ether, to Charlie;
Batch 1中的交易执行前,假设共有4个状态,这里称为Batch 1的初始状态,即图3中由Pre State Root锁定的状态值,分别是:Before the execution of transactions in Batch 1, it is assumed that there are 4 states in total, which are called the initial state of Batch 1, that is, the state value locked by Pre State Root in Figure 3, respectively:
Alice:50,Bob:100,Charlie:150,David:200Alice: 50, Bob: 100, Charlie: 150, David: 200
Batch 1中的交易执行后,这4个状态更新为Batch 1的终局状态,即图3中由Post State Root锁定的状态值,分别是:After the transactions in Batch 1 are executed, these four states are updated to the final state of Batch 1, that is, the state values locked by Post State Root in Figure 3, which are:
Alice:20,Bob:110,Charlie:170,David:200Alice: 20, Bob: 110, Charlie: 170, David: 200
Layer2中可以采用Merkle树来组织Batch 1中的交易按序执行前、后的状态。如图3所示,在Layer2中可以将一个Batch的交易及其相关的状态变化组织在一起,例如将Batch 1中的交易的hash值按照Merkle树组织后得到的Merkle根锁定在Batch的头(Header)中,这个头类似Layer 1中的区块头,这个Merkle根即Batch的头中的Tx_Root。同样的,如前所述,可以将Batch 1中的交易在执行前的所有状态值按照Merkle树组织后得到的Merkle根锁定在Batch的头中,即Pre State Root;可以将Batch 1中的交易在按序执行后的所有状态值的hash按照Merkle树组织后得到的Merkle根锁定在Batch的头中,即Post State Root。对于Batch M来说,在其Header中还可以设置一个时间戳(Timestamp)用于记录该Batch生成的时间,当然还可以设置其它字段的信息。对于第M+1个Batch来说,其Header中的Pre State Root与第M个Batch的Header中的Post State Root相等,如图3中这两个根之间的连线所表示。如此Batch之间则形成了一个链式结构。 Merkle tree can be used in Layer2 to organize the states of transactions in Batch 1 before and after they are executed in sequence. As shown in Figure 3, in Layer2, the transactions of a Batch and their related state changes can be organized together. For example, the Merkle root obtained by organizing the hash value of the transaction in Batch 1 according to the Merkle tree is locked in the header of the Batch. This header is similar to the block header in Layer 1, and this Merkle root is the Tx_Root in the header of the Batch. Similarly, as mentioned above, the Merkle root obtained by organizing all the state values of the transactions in Batch 1 before execution according to the Merkle tree can be locked in the header of the Batch, namely the Pre State Root; the Merkle root obtained by organizing the hash of all the state values of the transactions in Batch 1 after they are executed in sequence according to the Merkle tree can be locked in the header of the Batch, namely the Post State Root. For Batch M, a timestamp can also be set in its Header to record the time when the Batch was generated, and of course, information in other fields can also be set. For the M+1th batch, the Pre State Root in its header is equal to the Post State Root in the header of the Mth batch, as shown by the line between the two roots in Figure 3. In this way, a chain structure is formed between the batches.
Layer2的Rollup机制,可以包括Optimistic-Rollup(乐观Rollup,简称OP-Rollup)、ZK-Rollup(零知识证明Rollup,ZK指的是zero knowledge,即零知识)、TEE-Rollup机制等。The Layer2 Rollup mechanism can include Optimistic-Rollup (OP-Rollup for short), ZK-Rollup (zero-knowledge proof Rollup, ZK refers to zero knowledge), TEE-Rollup mechanism, etc.
OP-Rollup机制中,在Layer2里可以设置:包括交易池(Txpool)的接收器、中继器以及Sequencer(定序器/排序器),在ZK-Rollup以及TEE-Rollup机制中,Layer2中还可以设置Prover(证明器);其中对于TEE-Rollup机制而言,Prover(证明器)可以设置于TEE中。In the OP-Rollup mechanism, Layer2 can be set up with: receivers, repeaters and sequencers of the transaction pool (Txpool); in the ZK-Rollup and TEE-Rollup mechanisms, Prover can also be set up in Layer2; for the TEE-Rollup mechanism, Prover can be set up in TEE.
下面示例性描述OP-Rollup机制。如图3中所示,假设TxPool中收集到Tx21、Tx23、Tx25、Tx22、Tx26、Tx24这些交易。Sequencer按照这些交易中的时间戳对这些交易排序并打包,例如将Tx21、Tx22、Tx23打包到Batch M中,并将这些交易的hash值组织为Merkle后生成Merkle Root(即交易根),并将该Merkle Root的hash值填入生成的Batch M中Header内的Tx_Root中。需要说明的是,在计算Merkle树的树根时,一般对于小于2n的情况,可以将最后一个交易赋值多份以用于补齐2n,从而计算2叉的Merkle树的树根。如图3中,按照时间顺序排序为最末的Tx23重复一次后补齐了4个交易,即使交易的数量达到22,进而可以计算得到2叉的Merkle树的树根。Sequencer按照交易中的时间戳对交易排序后将Tx21、Tx22、Tx23打包到Batch M+1。The OP-Rollup mechanism is described as an example below. As shown in Figure 3, assume that transactions Tx21, Tx23, Tx25, Tx22, Tx26, and Tx24 are collected in TxPool. Sequencer sorts and packages these transactions according to the timestamps in these transactions, for example, packs Tx21, Tx22, and Tx23 into Batch M, and organizes the hash values of these transactions into Merkle to generate Merkle Root (i.e., transaction root), and fills the hash value of the Merkle Root into Tx_Root in the Header of the generated Batch M. It should be noted that when calculating the root of the Merkle tree, generally for cases less than 2n , the last transaction can be assigned multiple copies to make up 2n , thereby calculating the root of the 2-fork Merkle tree. As shown in Figure 3, Tx23, which is the last transaction in chronological order, is repeated once to complete the four transactions, even if the number of transactions reaches 2 2 , and the root of the 2-fork Merkle tree can be calculated. The Sequencer sorts the transactions according to the timestamps in the transactions and packs Tx21, Tx22, and Tx23 into Batch M+1.
在Batch M中的交易序列Tx21、Tx22、Tx23被执行前,所有的状态包括如前所述,Alice:50,Bob:100,Charlie:150,David:200。Sequencer可以将这些状态组织成Merkle树,并将该Merkle树根节点的hash值作为Batch M所对应的前状态根,存储于Batch M Header的Pre State Root字段中。进而Sequencer可以按照顺序执行Tx21、Tx22、Tx23这3笔交易;执行这3笔交易的结果生成了新的状态,如前所述,Alice:20,Bob:110,Charlie:170,David:200。Sequencer可以将这些更新后的状态组织成Merkle树,并将该Merkle树根节点的hash值作为Batch M所对应的后状态根,存储于Batch MHeader的Post State Root字段中。Before the transaction sequence Tx21, Tx22, and Tx23 in Batch M are executed, all the states include Alice: 50, Bob: 100, Charlie: 150, and David: 200 as mentioned above. The Sequencer can organize these states into a Merkle tree, and use the hash value of the root node of the Merkle tree as the pre-state root corresponding to Batch M, and store it in the Pre-State-Root field of the Batch-M-Header. Then the Sequencer can execute the three transactions Tx21, Tx22, and Tx23 in sequence; the results of executing these three transactions generate new states, as mentioned above, Alice: 20, Bob: 110, Charlie: 170, and David: 200. The Sequencer can organize these updated states into a Merkle tree, and use the hash value of the root node of the Merkle tree as the post-state root corresponding to Batch M, and store it in the Post-State-Root field of the Batch-MHeader.
进而,Sequencer可以通过Relayer发送一笔调用Rollup Contract的交易1至Layer1,该交易1中包含Batch M Header中的部分或全部字段以及经过压缩的交易序列Tx21、Tx22、Tx23。Tx21、Tx22、Tx23经过压缩后,所占空间可以大大降低。调用的Rollup Contract合约中的接口,可以包括将压缩后的交易数据(Tx21、Tx22、Tx23)存储于较便宜(Gas费用较低)的位置calldata上。在以太坊智能合约中,calldata是一种特殊的数据位置(data location),用于存储通过函数调用的输入数据。具体的,calldata数据一般直接存储在以太坊的交易数据中,其通常比其它数据位置(如memory和storage)更加节省gas。虽然本文中略去了压缩交易Batch所包括的交易学列的过程,然而可以理解的是下文中所述的任意交易Batch所包括的交易序列,既可以是未经压缩的交易序列,也可能是经压缩后的交易序列。Furthermore, Sequencer can send a transaction 1 that calls Rollup Contract to Layer1 through Relayer. Transaction 1 contains some or all fields in Batch M Header and compressed transaction sequences Tx21, Tx22, and Tx23. After compression, the space occupied by Tx21, Tx22, and Tx23 can be greatly reduced. The interface in the called Rollup Contract contract can include storing the compressed transaction data (Tx21, Tx22, and Tx23) in a cheaper (lower gas fee) location calldata. In Ethereum smart contracts, calldata is a special data location (data location) used to store input data called by a function. Specifically, calldata data is generally stored directly in Ethereum's transaction data, which usually saves more gas than other data locations (such as memory and storage). Although the process of compressing the transaction sequence included in the transaction batch is omitted in this article, it can be understood that the transaction sequence included in any transaction batch described below can be either an uncompressed transaction sequence or a compressed transaction sequence.
值得注意的是,在一笔以太坊交易中,签名部分占了整体的约一半的体积,其From字段可以是0字节,因为该From字段可以从签名中恢复出来。而在Rollup中,通常可以采用BLS或者其它方案进行聚合,平均每笔交易的签名被压缩到约0.5字节,相应的,Rollup交易中由于无法从这种聚合签名中恢复出交易的From字段,因此这里需要单独采用4字节来表示。 It is worth noting that in an Ethereum transaction, the signature part accounts for about half of the total volume, and its From field can be 0 bytes, because the From field can be recovered from the signature. In Rollup, BLS or other schemes can usually be used for aggregation, and the signature of each transaction is compressed to about 0.5 bytes on average. Correspondingly, in Rollup transactions, since the From field of the transaction cannot be recovered from this aggregated signature, it needs to be represented separately by 4 bytes.
BLS签名方案最初是由斯坦福大学教授DanBoneh等人于2001年提出的一种签名方案,基于双线性映射构造。一般一个用户对自身账户的控制,体现在用自身私钥对一笔交易进行签名。单个签名如上表格中所示,可能达到68字节,占用较大体积。多个账户发起的多笔交易,则每个账户需要对自身的每笔交易分别签名。而签名聚合,可以把多个签名聚合成一个签名,因此大大节省了签名的字节空间。这种聚合可以是同一个消息由不同签名者签名的聚合,也可以是不同消息的签名聚合。公钥聚合,可以将多个不同公钥聚合成一个总的公钥,由该总公钥即可对聚合签名完成验证,而不需要在验证总签名时由每个公钥参与计算。通常可以采用Schnorr签名算法、BLS签名算法实现签名聚合。相对于Schnorr签名算法来说,BLS签名算法实现的聚合签名体积更小,约是Schnorr的二分之一。The BLS signature scheme was originally proposed by Dan Boneh, a professor at Stanford University, and others in 2001. It is based on a bilinear mapping structure. Generally, a user's control over his own account is reflected in signing a transaction with his own private key. As shown in the table above, a single signature may reach 68 bytes, which occupies a large volume. For multiple transactions initiated by multiple accounts, each account needs to sign each of its own transactions separately. Signature aggregation can aggregate multiple signatures into one signature, thus greatly saving the byte space of the signature. This aggregation can be the aggregation of the same message signed by different signers, or the aggregation of signatures of different messages. Public key aggregation can aggregate multiple different public keys into a total public key, which can complete the verification of the aggregated signature without the need for each public key to participate in the calculation when verifying the total signature. Signature aggregation can usually be implemented using the Schnorr signature algorithm and the BLS signature algorithm. Compared with the Schnorr signature algorithm, the aggregated signature implemented by the BLS signature algorithm is smaller in size, about half of Schnorr.
上述压缩方案和采用BLS进行签名聚合,是理想中的设计方案。尽管如此,实际中的几种Rollup方案中,目前一笔压缩后的交易仍然占用40-50字节的空间,且其中尚不包括签名,也就是说还未采用BLS签名聚合。The above compression scheme and the use of BLS for signature aggregation are ideal designs. However, in the actual Rollup schemes, a compressed transaction still takes up 40-50 bytes of space, and does not include the signature, which means that BLS signature aggregation has not yet been adopted.
接前文,Layer1中接收到该调用Rollup Contract的交易1后,经过共识,在一些节点上执行这个交易1,并将该交易1及其执行结果连同其它一些交易及执行结果一并生成一个区块,如图3中的Block N。所述其它一些交易,可以包括普通转账交易和涉及其它智能合约的交易。其中,普通转账交易和涉及其它智能合约的交易都可以涉及交易的执行。特别是其它智能合约的交易,可能涉及较为复杂的执行逻辑。而这里的交易1,调用Rollup Contract中存入calldata位置的函数,主要涉及存入指定位置,即不涉及复杂合约逻辑的执行。也就是说,Layer1里的Rollup Contract,主要作用是将Layer2上发来的交易中指定的内容存入指定位置,此外不涉及复杂的执行逻辑。例如,作为一个例子,Tx21、Tx22、Tx23存入由Block N Header中Tx_Root锁定到交易树中的Tx_12中。此外,作为一种实现,交易1中的Batch M Header中的Pre State Root、Post State Root可以通过Rollup Contract分别存入Layer1上合约状态中的状态1和状态2中。如前所述,状态1和状态2包含在由Block N Header中State_Root锁定的state trie中,具体例如是storage trie中。为了加以区分,Layer1上合约状态中的状态1和状态2例如分别称为Last State root和Current State root。此外,为了简化,也可以在Layer1上合约状态中仅保存Current State root,而不保存Last State root,如下面的代码示例所示。在另一些实现中,Last State root和Current State root也可以与Layer2中的交易一样存入Layer1中的calldata内,这里不再赘述。对于前者,例如是调用如下的Layer1中的commitBatch()合约接口:function CommitBatch(bytes[]calldata_transactions,bytes32_preStateRoot,bytes32_postStateRoot),CommitBatch()合约接口内部可以设置基本的校验逻辑,例如可以包括验证当前交易1中的Pre State Root是否与合约存储中的Current State Root相等,如果相等则将交易1中传入的Layer2上的交易存入calldata中,并将合约存储中的Current State Root更新为Post State Root。Continuing from the previous text, after receiving the transaction 1 that calls the Rollup Contract in Layer1, after consensus, this transaction 1 is executed on some nodes, and this transaction 1 and its execution results are generated together with some other transactions and their execution results into a block, such as Block N in Figure 3. The other transactions may include ordinary transfer transactions and transactions involving other smart contracts. Among them, ordinary transfer transactions and transactions involving other smart contracts can all involve the execution of transactions. In particular, transactions of other smart contracts may involve more complex execution logic. And the transaction 1 here, calling the function stored in the calldata position in the Rollup Contract, mainly involves storing in the specified position, that is, it does not involve the execution of complex contract logic. In other words, the main function of the Rollup Contract in Layer1 is to store the specified content in the transaction sent from Layer2 into the specified position, and does not involve complex execution logic. For example, as an example, Tx21, Tx22, and Tx23 are stored in Tx_12 in the transaction tree locked by Tx_Root in the Block N Header. In addition, as an implementation, the Pre State Root and Post State Root in the Batch M Header in Transaction 1 can be stored in State 1 and State 2 in the contract state on Layer 1 through Rollup Contract, respectively. As mentioned above, State 1 and State 2 are contained in the state trie locked by State_Root in Block N Header, specifically, in the storage trie. To distinguish them, State 1 and State 2 in the contract state on Layer 1 are respectively referred to as Last State root and Current State root. In addition, for simplicity, only Current State root can be saved in the contract state on Layer 1 without saving Last State root, as shown in the following code example. In other implementations, Last State root and Current State root can also be stored in calldata in Layer 1 like transactions in Layer 2, which will not be repeated here. For the former, for example, the commitBatch() contract interface in Layer1 is called as follows: function CommitBatch(bytes[]calldata_transactions, bytes32_preStateRoot, bytes32_postStateRoot). The basic verification logic can be set inside the CommitBatch() contract interface, such as verifying whether the Pre State Root in the current transaction 1 is equal to the Current State Root in the contract storage. If they are equal, the transaction on Layer2 passed in in transaction 1 is stored in calldata, and the Current State Root in the contract storage is updated to Post State Root.
通过上述方式,OP-Rollup可以在Layer2中执行各个交易,并且可以在一个Batch中捆绑几十、数百甚至更多的Layer2交易,且只发布最低限度的信息至Layer1上。所谓最低限度的信息,包括如前所述的压缩后的Layer2上的交易和这批交易执行前后的状态根的hash值。如前所示,这里例如可以通过一个Layer1上的交易发送,如图3中的 交易1。可见,这相当于一次性在Layer2上执行了一批交易,但是在Layer1上只执行了一个交易。同时OP-Rollup并不附带任何证明。这是出于假设提交的Layer2上的信息不存在欺诈或恶意行为,因此其是“Optimistic”(乐观)这样的名字。虽然存在这样的假设,为了预防和震慑,仍然会要求提交Layer2信息的交易者在OP-Rollup的Rollup Contract中质押一部分Layer1上的资产(典型的是链上原生的token,如以太坊上的以太币)。对于提交到Layer1上的Layer2信息,尽管其中的交易是经过压缩的,如前所述的是,仍然可以用于还原出Layer2上所有交易的执行过程和所有账户的状态,从而消除Layer2上由于数据可用性带来的安全风险。In this way, OP-Rollup can execute each transaction in Layer2, and can bundle dozens, hundreds or even more Layer2 transactions in a batch, and only publish the minimum information to Layer1. The so-called minimum information includes the compressed Layer2 transactions and the hash value of the state root before and after the execution of this batch of transactions. As shown above, here, for example, a transaction on Layer1 can be sent, as shown in Figure 3. Transaction 1. As you can see, this is equivalent to executing a batch of transactions on Layer2 at one time, but only executing one transaction on Layer1. At the same time, OP-Rollup does not come with any proof. This is based on the assumption that there is no fraud or malicious behavior in the information submitted on Layer2, so it is named "Optimistic". Although there is such an assumption, for the sake of prevention and deterrence, traders who submit Layer2 information will still be required to pledge a portion of Layer1 assets in the Rollup Contract of OP-Rollup (typically native tokens on the chain, such as Ethereum on Ethereum). For the Layer2 information submitted to Layer1, although the transactions therein are compressed, as mentioned above, it can still be used to restore the execution process of all transactions on Layer2 and the status of all accounts, thereby eliminating the security risks caused by data availability on Layer2.
OP-Rollup尽管是乐观的,但Layer1上仍然可以设置一个挑战期,任何人都可以在挑战期内使用欺诈证明提出挑战。典型的原因包括挑战者证明该Batch内的某个交易没有被正确的执行,即该交易的执行没有产生正确的状态。如果一个Batch内的某个交易被证明是无效的,则该Batch也是无效的,Layer1上的这个Rollup合约可以将其中的Layer2的Batch链进行回滚,该无效Batch及其后面的所有Batch都会变成孤块。一旦欺诈证明成功,保证金中的一部分会支付给挑战者,剩余部分则销毁。反之,如果直到挑战期结束都没有人提交欺诈证明,Rollup合约可以确定这个Batch。欺诈证明是Optimistic Rollup方案采用的一种数据有效性的验证方式。目前,欺诈证明可分为单轮交互型和多轮交互型两种。Although OP-Rollup is optimistic, a challenge period can still be set on Layer1, and anyone can use fraud proofs to challenge during the challenge period. Typical reasons include the challenger proving that a transaction in the Batch was not executed correctly, that is, the execution of the transaction did not produce the correct state. If a transaction in a Batch is proven to be invalid, the Batch is also invalid. The Rollup contract on Layer1 can roll back the Batch chain of Layer2, and the invalid Batch and all the batches behind it will become orphan blocks. Once the fraud proof is successful, part of the deposit will be paid to the challenger and the rest will be destroyed. On the contrary, if no one submits a fraud proof until the end of the challenge period, the Rollup contract can confirm the Batch. Fraud proof is a method of verifying data validity adopted by the Optimistic Rollup scheme. At present, fraud proofs can be divided into two types: single-round interactive type and multi-round interactive type.
一种单轮交互型欺诈证明的实现中,在Layer1上重放一遍有争议的交易,检测是否存在无效状态后进行提交。例如,Alice作为验证人将OP-Rollup压缩后的数据同步到Layer1,同时质押保证金。如果挑战者Bob对该数据存在争议,则需在窗口期(挑战期)内发起挑战且同样质押保证金。OP-Rollup的Rollup Contract将会在Layer1上重新计算该区块中交易来判定对错。错误方的保证金将被罚没,正确方将获得奖励。In a single-round interactive fraud proof implementation, the disputed transaction is replayed on Layer1, and submitted after checking whether there is an invalid state. For example, Alice, as a validator, synchronizes the compressed data of OP-Rollup to Layer1 and pledges a deposit. If the challenger Bob has a dispute over the data, he needs to initiate a challenge within the window period (challenge period) and also pledge a deposit. The Rollup Contract of OP-Rollup will recalculate the transactions in the block on Layer1 to determine right and wrong. The deposit of the wrong party will be confiscated, and the correct party will be rewarded.
这里需要说明的是,Layer1上的calldata中尽管有Layer2上所有的压缩后的交易,但在验证欺诈证明过程中,并不直接将calldata中Batch M中压缩后的交易直接取出执行,而是基于挑战者传入的Batch M中的所有交易原文模拟执行。这是因为,calldata中的压缩后Batch M的交易一般仅用于还原出Layer2上所有交易的执行过程和所有账户的状态,从而消除Layer2上由于数据可用性带来的安全风险;且calldata中的压缩后Batch M的交易,不带签名的情况下本身的真实性是有待确定的,而挑战者传入的交易是完整交易,可以验证交易的有效性;再者,还因为无法验证初始状态,合约存储中只是状态根而不是状态,除非从Batch 0开始重新顺序执行所有的交易直至Batch M-1执行后得到的全部状态,而这显然是不经济不高效的。It should be noted here that although the calldata on Layer1 contains all the compressed transactions on Layer2, in the process of verifying the fraud proof, the compressed transactions in Batch M in the calldata are not directly taken out for execution, but are simulated and executed based on the original text of all transactions in Batch M passed in by the challenger. This is because the compressed Batch M transactions in the calldata are generally only used to restore the execution process of all transactions on Layer2 and the status of all accounts, thereby eliminating the security risks caused by data availability on Layer2; and the authenticity of the compressed Batch M transactions in the calldata without signatures is yet to be determined, while the transactions passed in by the challenger are complete transactions, and the validity of the transactions can be verified; furthermore, because the initial state cannot be verified, the contract storage only contains the state root instead of the state, unless all transactions are re-executed in sequence from Batch 0 until the entire state is obtained after Batch M-1 is executed, which is obviously inefficient and uneconomical.
上述单轮交互型欺诈证明,增加了必须在链上发布的数据,且需要在Layer1上重新执行Batch M中的全部交易,并且重放这些交易还会产生巨大的燃料成本,因此,OP-Rollup正在转向多轮交互式证明,以更高的效率实现相同的目标。The above-mentioned single-round interactive fraud proof increases the data that must be published on the chain and requires re-executing all transactions in Batch M on Layer 1. Replaying these transactions will also incur huge fuel costs. Therefore, OP-Rollup is turning to multi-round interactive proofs to achieve the same goal with higher efficiency.
多轮交互型欺诈证明中,当Bob对Sequencer同步的数据提出挑战后,Sequencer需将争议的Batch范围二等分为前、后两段范围并通过例如dispute()合约接口返回,然后由Bob进一步选择继续挑战的二分后的一个范围,再由Sequencer将争议范围二等分……如此循环,直至将争议范围缩减到一个具体的交易。这里Bob会发送挑战的交易的原文(包括每个交易的签名)及该交易执行前的全局状态,Sequencer会发送挑战 的交易执行前的Pre State Root(这里也称为状态承诺)和执行后的Post State Root,交由Layer1的Rollup Contract合约进行计算和判定。具体的,例如Rollup Contract合约基于所挑战交易执行前的Pre State Root验证挑战交易执行前的全局状态,并在该挑战交易执行前的全局状态基础上执行挑战的交易,生成执行后的状态,在挑战交易执行后的全局状态的基础上生成Post State Root,与Sequencer发送的Post State Root相比,如果不同,则说明挑战成功,反之挑战失败。在实际应用中,Arbitrum不是使用二分的方式,而是使用了K分,即每次将N个指令分为N/K组去寻找欺诈指令,效率更高。In a multi-round interactive fraud proof, when Bob challenges the data synchronized by the Sequencer, the Sequencer needs to divide the disputed Batch range into two equal ranges, the front and the back, and return them through the dispute() contract interface, for example. Then Bob further selects a range after the second division to challenge, and the Sequencer divides the disputed range into two equal ranges... This cycle repeats until the disputed range is reduced to a specific transaction. Here, Bob will send the original text of the challenged transaction (including the signature of each transaction) and the global state before the transaction is executed, and the Sequencer will send the challenge The Pre State Root (also called state commitment) before the transaction is executed and the Post State Root after the execution are handed over to the Rollup Contract of Layer1 for calculation and judgment. Specifically, for example, the Rollup Contract verifies the global state before the challenge transaction is executed based on the Pre State Root before the challenge transaction is executed, and executes the challenged transaction based on the global state before the challenge transaction is executed, generates the state after execution, and generates the Post State Root based on the global state after the challenge transaction is executed. Compared with the Post State Root sent by the Sequencer, if they are different, it means that the challenge is successful, otherwise the challenge fails. In actual applications, Arbitrum does not use a binary search method, but a K search method, that is, N instructions are divided into N/K groups each time to find fraudulent instructions, which is more efficient.
因此,相比单轮交互型,多轮交互型能以更低的成本来解决争议,例如二等分协议可以减少发布在链上的数据量(无需为每笔交易发布状态提交),也更容易支持复杂的智能合约和处理更高要求的争议。不过,随着交互次数的增加,它的争议窗口期也会更长一些。Therefore, compared with the single-round interaction type, the multi-round interaction type can resolve disputes at a lower cost. For example, the bisection protocol can reduce the amount of data published on the chain (no need to publish status submissions for each transaction), and it is easier to support complex smart contracts and handle more demanding disputes. However, as the number of interactions increases, its dispute window period will also be longer.
整体来说,由于OP-Rollup的设计中需要把与状态更新和验证相关的数据都放到Layer1上,因此OP-Rollup的拓展性和对吞吐量的提升程度最为有限,且需要7天甚至更长的等待期。这意味着,从OP-Rollup中提取资产会产生延迟,需要等待窗口期过后。In general, since the design of OP-Rollup requires that all data related to status updates and verification be placed on Layer 1, the scalability and throughput improvement of OP-Rollup are the most limited, and a waiting period of 7 days or even longer is required. This means that there will be a delay in extracting assets from OP-Rollup, and you need to wait until the window period has passed.
ZK-Rollup不同于Optimistic Rollup,因为ZK-Rollup使用零知识(zero knowledge)证明技术。ZK指的是在不披露必要信息的情况下向另一方证明某事(一项交易或状态)的能力。ZK-Rollup中,与OP-Rollup不同的是,Layer2中还会为交易Batch生成一个证明(包括proof)(例如采用ZK-SNARK等的密码学证明算法),这个证明中的proof可以证明Post State Root是在Pre State Root基础上按序正确执行对应的交易Batch中的交易序列后得到的,只需要验证proof即可以确认这一点,而不需要重新执行Batch中的交易来验证。ZK-Rollup is different from Optimistic Rollup because ZK-Rollup uses zero-knowledge proof technology. ZK refers to the ability to prove something (a transaction or state) to another party without disclosing necessary information. In ZK-Rollup, unlike OP-Rollup, Layer2 will also generate a proof (including proof) for the transaction Batch (for example, using cryptographic proof algorithms such as ZK-SNARK). The proof in this proof can prove that the Post State Root is obtained by correctly executing the transaction sequence in the corresponding transaction Batch in order based on the Pre State Root. This can be confirmed by verifying the proof without re-executing the transactions in the Batch to verify.
生成证明的过程,可以是由Sequencer将Layer2中一个Batch中所有交易(包括发送方、接收方、金额)以及这个Batch中的交易执行前后的Pre State Root、Post State Root和Proving Key等信息打包发送至Layer2上的一个证明器,由证明器将这些信息转换为一种特殊的形式,称为witness(见证者;选择其中的一部分作为公共输入,另一部分作为隐私输入)。进而,证明器采用其内布置的零知识证明的计算电路(一种特定的算法)对公共输入+隐私输入的有效性和正确性进行验证。如果验证正确,电路执行成功,否则电路执行失败。电路执行成功的情况下,证明器可以输出一个proof,该proof用以证明打包的数据是有效且正确的。而且,这个proof的体积较小,一般只有几十字节。上述生成证明的过程,类似于重新执行的过程,并且包含大量的电路计算,更为复杂,所以一般比较耗时。需要说明,由proof本身无法倒推出隐私输入,只有知道zk-SNARK的验证密钥的一方才能验证用对应创建密钥加密的proof。公共输入可以用来验证打包的数据的有效性和正确性,但无法用来获取打包的数据的具体内容。The process of generating proof can be that the Sequencer packages all transactions in a batch in Layer2 (including sender, receiver, amount) and the Pre State Root, Post State Root and Proving Key before and after the execution of the transactions in this batch and sends them to a prover on Layer2, and the prover converts this information into a special form, called witness (witness; select part of it as public input and the other part as private input). Then, the prover uses the zero-knowledge proof calculation circuit (a specific algorithm) arranged inside it to verify the validity and correctness of the public input + private input. If the verification is correct, the circuit execution is successful, otherwise the circuit execution fails. If the circuit execution is successful, the prover can output a proof, which is used to prove that the packaged data is valid and correct. Moreover, the size of this proof is small, generally only a few dozen bytes. The above process of generating proof is similar to the process of re-execution, and contains a lot of circuit calculations, which is more complicated, so it is generally time-consuming. It should be noted that the private input cannot be deduced from the proof itself. Only the party who knows the verification key of the zk-SNARK can verify the proof encrypted with the corresponding creation key. The public input can be used to verify the validity and correctness of the packaged data, but it cannot be used to obtain the specific content of the packaged data.
采用零知识证明,证明器可以通过Relayer将较小的proof发布到Layer1上,并可以由Rollup Contract快速验证。proof体积较小,这进一步降低了Layer1上Gas的消耗。而且,在ZK-Rollup中这个验证过程通常由智能合约自动完成,且不用像OP-Roll那样再设置窗口期,提取资产也会变得迅速,这是OP-Rollup和ZK-Rollup之间的主要特性差异之一。With zero-knowledge proof, the prover can publish a smaller proof to Layer 1 through Relayer, and it can be quickly verified by the Rollup Contract. The proof is small in size, which further reduces the consumption of Gas on Layer 1. Moreover, in ZK-Rollup, this verification process is usually completed automatically by the smart contract, and there is no need to set a window period like OP-Rollup, and asset withdrawal will also become fast, which is one of the main feature differences between OP-Rollup and ZK-Rollup.
具体的验证过程,首先,将公共输入(可以从Block N中提交的交易1计算得到, 例如是在交易1提交至Layer1的Rollup Contract时由Rollup Contract中的自动执行计算逻辑计算得到)、proof和验证密钥(验证密钥可以通过Layer1上的治理合约保存并提供至Rollup Contract)输入到智能合约中的验证逻辑(例如包括ZK-SNARK的验证算法),由验证逻辑使用验证算法检查proof是否有效。如果proof有效,那么公共输入对应的打包数据就被认为是有效且正确的。如果验证成功,验证算法会输出一个确认信息,证明公共输入对应的打包数据是有效且正确的;否则,验证算法会输出一个错误信息,标示数据的无效性或错误性。The specific verification process is as follows: First, the public input (which can be calculated from transaction 1 submitted in Block N) is For example, when transaction 1 is submitted to the Rollup Contract of Layer1, the proof and verification key (the verification key can be saved and provided to the Rollup Contract through the governance contract on Layer1) are input into the verification logic (for example, the verification algorithm including ZK-SNARK) in the smart contract, and the verification logic uses the verification algorithm to check whether the proof is valid. If the proof is valid, the packaged data corresponding to the public input is considered valid and correct. If the verification is successful, the verification algorithm will output a confirmation message to prove that the packaged data corresponding to the public input is valid and correct; otherwise, the verification algorithm will output an error message indicating the invalidity or error of the data.
然而,ZK-SNARK这类的零知识证明在生成proof过程中的计算量非常大,也意味着生成proof将比较耗时。假设如图4中所示,通过交易1将经过压缩的Tx21、Tx22、Tx23存入Layer1中calldata中,并将Post State Root存入Layer1上合约状态中的Current State Root。这个交易1如图4位于Layer1的Block N中。则Layer2中生成对应proof所需要的复杂计算量带来的延迟,可能在一段时间通过交易2将Batch M的proof传入Layer1上的Block N+412中。从Block N到Block N+412,显然也带来了一定的延迟,这个延迟可能接近小时级。However, the computational complexity of zero-knowledge proofs such as ZK-SNARK in the process of generating proofs is very large, which also means that generating proofs will be time-consuming. Assume that as shown in Figure 4, the compressed Tx21, Tx22, and Tx23 are stored in calldata in Layer1 through transaction 1, and the Post State Root is stored in the Current State Root in the contract state on Layer1. This transaction 1 is located in Block N of Layer1 as shown in Figure 4. The delay caused by the complex computation required to generate the corresponding proof in Layer2 may cause the proof of Batch M to be transferred to Block N+412 on Layer1 through transaction 2 for a period of time. From Block N to Block N+412, there is obviously a certain delay, which may be close to the hour level.
针对计算复杂、生成证明所需时间久这个问题,对应提出了TEE-Roll机制。TEE-Rollup机制相对于ZK-Rollup的不同之处主要在于:Prover采用TEE(Trusted Execution Environment,可信执行环境)实现,而且Prover可以在排序Sequencer提供的某个交易Batch的交易根、前状态根和后状态根等信息通过验证后,采用TEE中的私钥对该交易batch的相关信息进行签名,进而将签名作为证明并通过Relayer将其发布到Layer1上,并可以由Rollup Contract快速验证。In order to solve the problem of complex calculation and long time required to generate proof, TEE-Roll mechanism is proposed. The difference between TEE-Rollup mechanism and ZK-Rollup is that Prover is implemented by TEE (Trusted Execution Environment), and Prover can use the private key in TEE to sign the relevant information of a transaction batch after verifying the transaction root, previous state root and post-state root of a transaction batch provided by Sequencer, and then use the signature as proof and publish it to Layer1 through Relayer, which can be quickly verified by Rollup Contract.
Layer2提交的任意交易Batch所对应的挑战期结束后,或者说任意交易Batch所对应的证明在Layer2的Rollup Contract中通过验证后,该任意Batch及其对应的合约调用交易(例如前述用于调用Rollup Contract中Commit Batch()合约接口的交易1)即进入不可更改(Finality)状态;同时意味着,Layer2中属于该任意Batch的各个交易均已进入不可更改状态。After the challenge period corresponding to any transaction Batch submitted by Layer2 ends, or after the proof corresponding to any transaction Batch is verified in the Rollup Contract of Layer2, the arbitrary Batch and its corresponding contract call transaction (such as transaction 1 used to call the Commit Batch() contract interface in the Rollup Contract) enter the finality state; it also means that all transactions belonging to the arbitrary Batch in Layer2 have entered the finality state.
随着Rollup技术的发展,对位于Layer2中的任意区块链系统的管理成员,其可能因某些具体业务目的的需要,期望Layer2中的区块链系统与Layer1中的区块链系统之间,能够支持多种Rollup模式(即卷叠模式)。不同Rollup模式并不意味着必然采用不同Rollup机制,例如两种Rollup模式可能采用相同的Rollup机制,区别在于Layer1可能采用不同的方式来存储Layer2提交的打包交易,例如Rollup模式1和Rollup模式2采用的Rollup机制均为ZK-Rollup,Rollup模式1中要求Layer1将Layer2中的打包交易按照交易原文存储在Layer1中,然而Rollup模式2中要求Layer1存储Layer2中交易的交易原文,而是要求Layer1存储Layer2中交易的交易哈希。With the development of Rollup technology, for management members of any blockchain system in Layer2, they may expect that the blockchain system in Layer2 and the blockchain system in Layer1 can support multiple Rollup modes (i.e., stacking modes) due to the needs of certain specific business purposes. Different Rollup modes do not necessarily mean that different Rollup mechanisms must be adopted. For example, two Rollup modes may adopt the same Rollup mechanism. The difference is that Layer1 may adopt different methods to store the packaged transactions submitted by Layer2. For example, the Rollup mechanism adopted by Rollup mode 1 and Rollup mode 2 is ZK-Rollup. Rollup mode 1 requires Layer1 to store the packaged transactions in Layer2 in Layer1 according to the original transaction text. However, Rollup mode 2 requires Layer1 to store the original transaction text of the transaction in Layer2, but requires Layer1 to store the transaction hash of the transaction in Layer2.
前文虽然利用Layer1和Layer2来表示区块链系统,然而需要理解的是,Layer1中通常可以包括一个区块链系统,而Layer2中却可以包括一个或多个区块链系统。Layer2中所包括的一个或多个区块链系统均将Layer1中的区块链系统作为其对应的上一层区块链系统。Although Layer 1 and Layer 2 are used to represent blockchain systems in the previous article, it should be understood that Layer 1 can usually include one blockchain system, while Layer 2 can include one or more blockchain systems. The one or more blockchain systems included in Layer 2 all use the blockchain system in Layer 1 as their corresponding upper-layer blockchain system.
如果Rollup模式采用的Rollup机制不同,则必定意味着Rollup模式不同。基于此,本说明书实施例中将主要基于Rollup机制的不同来区别不同的Rollup模式。示例性的, Layer1和Layer2之间采用的Rollup机制为ZK-Rollup,则将其对应的Rollup模式仍然记为ZK-Rollup;Layer1和Layer2之间采用的Rollup机制为TEE-Rollup,则将其对应的Rollup模式仍然记为TEE-Rollup。If the Rollup modes use different Rollup mechanisms, it must mean that the Rollup modes are different. Based on this, in the embodiments of this specification, different Rollup modes will be distinguished mainly based on the differences in Rollup mechanisms. For example, If the Rollup mechanism used between Layer1 and Layer2 is ZK-Rollup, the corresponding Rollup mode is still recorded as ZK-Rollup; if the Rollup mechanism used between Layer1 and Layer2 is TEE-Rollup, the corresponding Rollup mode is still recorded as TEE-Rollup.
随着Rollup模式的增多,期望有一种区块链系统的资源管理方法,支持用户通过Layer1,更加安全且方便的管理Layer2相关的资源,例如按管理成员的需要启动或终止某种Rollup模式,以及按照用户的需要管理其在Layer2中,通过属于多种Rollup模式的多个账户持有的目标资源。With the increase in Rollup modes, it is expected that there will be a resource management method for blockchain systems that supports users to manage Layer2-related resources more securely and conveniently through Layer1. For example, a Rollup mode can be started or terminated according to the needs of management members, and target resources held by multiple accounts belonging to multiple Rollup modes in Layer2 can be managed according to the needs of users.
鉴于以上问题,本说明书实施例提供的解决方案中,参照图5所示,Layer1(即第一区块链系统)中至少部署卷叠合约Rollup Contract,Rollup Contract中包括用于支持注册Rollup模式的第二方法函数。第一区块链系统中还可部署中继合约Bridge Contract和管理合约Governance Contract。Bridge Contract主要负责管理Layer2中的区块链系统,例如管理Layer2中第二区块链系统下的账户及其持有的资源;Governance Contract主要负责管理各种Rollup模式的注册信息。In view of the above problems, in the solution provided by the embodiment of this specification, as shown in Figure 5, at least a rollup contract Rollup Contract is deployed in Layer1 (i.e., the first blockchain system), and the Rollup Contract includes a second method function for supporting the registration of the Rollup mode. The relay contract Bridge Contract and the management contract Governance Contract can also be deployed in the first blockchain system. Bridge Contract is mainly responsible for managing the blockchain system in Layer2, such as managing the accounts under the second blockchain system in Layer2 and the resources they hold; Governance Contract is mainly responsible for managing the registration information of various Rollup modes.
需要说明,Bridge Contract和Governance Contract也可能并不独立部署,而是将其包含的用于实现相应功能的方法函数,直接集成在Rollup Contract的合约代码中。对于Bridge Contract和Governance Contract所包括的方法函数以及其实现的具体功能,将在下文中进行详细描述。It should be noted that Bridge Contract and Governance Contract may not be deployed independently, but the method functions they contain to implement the corresponding functions are directly integrated into the contract code of Rollup Contract. The method functions included in Bridge Contract and Governance Contract and the specific functions they implement will be described in detail below.
图6为本说明书实施例中提供的一种区块链系统的资源方法的流程图之一。该方法示例性描述了在第一区块链系统和第二区块链系统中注册新卷叠模式(记为第二卷叠模式)的过程。Figure 6 is one of the flow charts of a resource method of a blockchain system provided in an embodiment of this specification. The method exemplarily describes the process of registering a new roll-up mode (referred to as the second roll-up mode) in the first blockchain system and the second blockchain system.
参照图6所示,该方法可以包括但不限于如下步骤S601~步骤S607。6 , the method may include but is not limited to the following steps S601 to S607 .
步骤S601,第一区块链系统接收第四交易,第四交易用于调用Rollup Contract中的第二方法函数,该第四交易中包括待注册的第二卷叠模式所对应的注册信息。Step S601: The first blockchain system receives a fourth transaction, where the fourth transaction is used to call a second method function in the Rollup Contract. The fourth transaction includes registration information corresponding to a second rollup mode to be registered.
参见前文,第二方法函数用于支持注册Rollup模式。As mentioned above, the second method function is used to support the registration Rollup mode.
以待注册的第二卷叠模式包括TEE-Rollup为例,参照图5所示。第二区块链系统的管理成员可以在第一区块链系统中发起第四交易,第四交易用于调用Rollup Contract中的第二方法函数,第四交易中可以包括TEE-Rollup所对应的注册信息。TEE-Rollup所对应的注册信息,可以包括但不限于如下各项信息中的一项或多项:标识信息、交易排序模型、验证方法以及创世块;交易排序模型可以包括但不限于共识算法、打包交易的交易数量上限值。Take the second rollup mode to be registered including TEE-Rollup as an example, as shown in Figure 5. The management member of the second blockchain system can initiate a fourth transaction in the first blockchain system, the fourth transaction is used to call the second method function in the Rollup Contract, and the fourth transaction can include the registration information corresponding to the TEE-Rollup. The registration information corresponding to the TEE-Rollup may include, but is not limited to, one or more of the following information: identification information, transaction sorting model, verification method, and genesis block; the transaction sorting model may include, but is not limited to, a consensus algorithm and an upper limit on the number of transactions for packaged transactions.
步骤S603,第一区块链系统根据第四交易执行Rollup Contract中的第二方法函数,实现:根据第二卷叠模式所对应的注册信息,对Rollup Contract和Bridge Contract进行第一升级操作,并生成卷叠注册事件,该卷叠注册事件中包括第二卷叠模式所对应注册信息中的至少部分注册信息。Step S603, the first blockchain system executes the second method function in the Rollup Contract according to the fourth transaction, to achieve: according to the registration information corresponding to the second rollup mode, perform a first upgrade operation on the Rollup Contract and the Bridge Contract, and generate a rollup registration event, which includes at least part of the registration information corresponding to the second rollup mode.
以待注册的第二卷叠模式包括TEE-Rollup为例,参照图5所示。对Rollup Contract进行的第一升级操作可以包括但不限于,在Rollup Contract中新增或启用TEE-Rollup对应的验证方法TEE verifier。对Bridge Contract进行的第一升级操作可以包括但不限于,重配置Bridge Contract中的合约接口Deposite()和合约接口Withdraw(),使注册在第一区块链系统中的账户,能够通过对合约接口Deposite()进行调用,实现对第二区块链系统 中属于TEE-Rollup的某个子账户增加相应份额的第二目标资源;以及,对于第二区块链系统中属于TEE-Rollup的某个子账户所持有的第二目标资源,能够按照相应的策略调用合约接口Withdraw(),实现在第一区块链系统中与该子账户对应的账户下,新增相应份额的第一目标资源。Take the second rollup mode to be registered including TEE-Rollup as an example, as shown in Figure 5. The first upgrade operation on the Rollup Contract may include but is not limited to adding or enabling the verification method TEE verifier corresponding to TEE-Rollup in the Rollup Contract. The first upgrade operation on the Bridge Contract may include but is not limited to reconfiguring the contract interface Deposite() and the contract interface Withdraw() in the Bridge Contract, so that the account registered in the first blockchain system can realize the second blockchain system by calling the contract interface Deposite(). For a sub-account belonging to TEE-Rollup in the second blockchain system, a corresponding share of the second target resource is added; and for a second target resource held by a sub-account belonging to TEE-Rollup in the second blockchain system, the contract interface Withdraw() can be called according to the corresponding strategy to realize the addition of a corresponding share of the first target resource under the account corresponding to the sub-account in the first blockchain system.
第一区块链系统根据第四交易执行Rollup Contract中的第二方法函数时,还可以实现在Governance Contract中存储第二卷叠模式对应的注册信息,例如存储TEE-Rollup的注册信息。When the first blockchain system executes the second method function in the Rollup Contract according to the fourth transaction, it can also store the registration information corresponding to the second rolling mode in the Governance Contract, such as storing the registration information of the TEE-Rollup.
前述的至少部分注册信息例如可以包括但不限于标识信息、交易排序模型和创世块。The aforementioned at least part of the registration information may include, for example, but is not limited to, identification information, a transaction sorting model, and a genesis block.
第二区块链系统中的中继器,例如中继器所包括的共享桥Bridge,可以监听到第一区块链系统中的卷叠注册事件,进而利用该卷叠注册事件中所包括的至少部分注册信息,对第二区块链系统的基础设施进行第二升级操作,从而使进行第一升级操作后的第一区块链系统与进行第二升级操作后的第二区块链系统之间,能够通过新注册的第二卷叠模式实现网络卷叠。The repeater in the second blockchain system, such as the shared bridge Bridge included in the repeater, can monitor the roll-up registration event in the first blockchain system, and then use at least part of the registration information included in the roll-up registration event to perform a second upgrade operation on the infrastructure of the second blockchain system, so that the first blockchain system after the first upgrade operation and the second blockchain system after the second upgrade operation can achieve network roll-up through the newly registered second roll-up mode.
前述的共享桥Bridge可以是独立的服务或者以SDK形式存在。Bridge可以持有第二区块链系统的管理成员注册在第一区块链系统的中继账户,以及该中继账户所对应的私钥;进而该Bridge按照某些规则实现利用中继账户生成交易并将其发送至第一区块链系统,以及按照某些规则实现生成交易并将其发送至第二区块链系统中的Sequencer。The aforementioned shared bridge can be an independent service or exist in the form of SDK. The Bridge can hold the relay account of the management member of the second blockchain system registered in the first blockchain system, and the private key corresponding to the relay account; then the Bridge uses the relay account to generate transactions and send them to the first blockchain system according to certain rules, and generates transactions and sends them to the sequencer in the second blockchain system according to certain rules.
示例性的,第二区块链系统例如可以基于卷叠注册事件执行如下步骤S605和步骤607。Exemplarily, the second blockchain system may, for example, perform the following steps S605 and 607 based on the wrap-up registration event.
步骤S605,第二区块链系统通过其中继器,利用卷叠注册事件生成第一升级交易,第一升级交易中包括第二卷叠模式所对应注册信息中的至少部分注册信息。Step S605: The second blockchain system generates a first upgrade transaction through its repeater using the roll-up registration event, where the first upgrade transaction includes at least part of the registration information corresponding to the second roll-up mode.
第一升级交易可以是特殊交易,其可以并不打包到第二区块链系统所提交的打包交易中。示例性的,中继器所包括的Bridge可以通过对第一升级交易的发送方字段和接收方字段进行特殊设置,例如将From字段设置为中继账户而To字段为Null,使第二区块链系统的Sequencer能够准确获知第一升级交易为特殊交易,执行第一升级交易期望执行的事务且并不将其打包到batch中;第一升级交易的Data字段可以包括该卷叠注册事件中所包括的至少部分注册信息。The first upgrade transaction may be a special transaction, which may not be packaged into the packaged transaction submitted by the second blockchain system. Exemplarily, the Bridge included in the repeater may make special settings for the sender field and the receiver field of the first upgrade transaction, such as setting the From field to the relay account and the To field to Null, so that the Sequencer of the second blockchain system can accurately know that the first upgrade transaction is a special transaction, execute the transaction that the first upgrade transaction expects to execute and does not package it into the batch; the Data field of the first upgrade transaction may include at least part of the registration information included in the rollup registration event.
步骤S607,第二区块链系统通过其Sequencer执行第一升级交易,实现:利用第二卷叠模式所对应注册信息中的至少部分注册信息,对第二区块链系统的基础设施进行第二升级操作。Step S607: The second blockchain system executes the first upgrade transaction through its Sequencer to implement: using at least part of the registration information corresponding to the second rollup mode to perform a second upgrade operation on the infrastructure of the second blockchain system.
以待注册的第二卷叠模式包括TEE-Rollup为例,参照图5所示。第二区块链系统的共享桥Bridge例如可以向Sequencer发送第一升级交易,第一升级交易中包括TEE-Rollup的注册信息所包括的至少部分注册信息。第二区块链系统的Sequencer执行第一升级交易时,对第二区块链系统的基础设施进行的第二升级操作,可以包括但不限于:在接收器中配置与TEE-Rollup对应的交易池TEE Txpool;对Sequencer进行重配置,使得进行重配置后的Sequencer能够按照TEE-Rollup的标识信息、交易排序模型和创世块,处理TEE Txpool中的交易;以及,在第二区块链系统中部署TEE-Rollup所对应的证明器TEE Prover。 Take the second rollup mode to be registered including TEE-Rollup as an example, as shown in Figure 5. The shared bridge of the second blockchain system can, for example, send a first upgrade transaction to the Sequencer, and the first upgrade transaction includes at least part of the registration information included in the registration information of TEE-Rollup. When the Sequencer of the second blockchain system executes the first upgrade transaction, the second upgrade operation performed on the infrastructure of the second blockchain system may include but is not limited to: configuring the transaction pool TEE Txpool corresponding to TEE-Rollup in the receiver; reconfiguring the Sequencer so that the reconfigured Sequencer can process transactions in TEE Txpool according to the identification information, transaction sorting model and genesis block of TEE-Rollup; and deploying the prover TEE Prover corresponding to TEE-Rollup in the second blockchain system.
前文结合图5和图6,示例性描述了注册TEE-Rollup的过程,然而不难理解的是,还可以通过与前文相似的过程注册其它Rollup模式,例如注册ZK-Rollup或其它Rollup模式,从而使得第一区块链系统和第二区块链系统之间,能够同时支持大于1的M种Rollup模式。The foregoing text, in combination with Figures 5 and 6, exemplarily describes the process of registering TEE-Rollup. However, it is not difficult to understand that other Rollup modes can also be registered through a process similar to the foregoing text, such as registering ZK-Rollup or other Rollup modes, so that the first blockchain system and the second blockchain system can simultaneously support M types of Rollup modes greater than 1.
参照图7所示,当第二区块链系统支持大于1的M种卷叠模式的情况下,第二区块链系统中可以对M种Rollup模式维护M个账户集合,即任意用户例如用户1可能在第二区块链系统中对应有不大于M的一个或多个账户。与之相应的,第二区块链系统的世界状态所对应的状态树(state trie)中,可以包括与M种Rollup模式对应的M个子状态树,利用M个子状态树各自对应的状态根可以计算出第二区块链系统的世界状态对应的状态根(即,Global state root)。As shown in FIG7 , when the second blockchain system supports M rollup modes greater than 1, the second blockchain system can maintain M account sets for the M Rollup modes, that is, any user, such as user 1, may have one or more accounts not greater than M in the second blockchain system. Correspondingly, the state trie corresponding to the world state of the second blockchain system may include M sub-state trees corresponding to the M Rollup modes, and the state root corresponding to the world state of the second blockchain system (i.e., Global state root) can be calculated using the state roots corresponding to each of the M sub-state trees.
基于此,在前述步骤S601~步骤S607的基础上,Sequencer还可以在第二区块链系统中初始化与第二卷叠模式对应的子状态树,包括在第二卷叠模式对应的子状态树中,注册属于第二卷叠模式并与中继账户对应的中继子账户,例如基于第二区块链系统对应的中继账户和第二卷叠模式进行派生计算,获得属于第二卷叠模式并与中继账户对应的中继子账户,并通过第二区块链系统中的系统合约System Contract将其注册到第二卷叠模式对应的子状态树中。Based on this, on the basis of the aforementioned steps S601 to S607, the Sequencer can also initialize the sub-state tree corresponding to the second reeling mode in the second blockchain system, including registering a relay sub-account belonging to the second reeling mode and corresponding to the relay account in the sub-state tree corresponding to the second reeling mode, for example, performing a derived calculation based on the relay account corresponding to the second blockchain system and the second reeling mode, obtaining the relay sub-account belonging to the second reeling mode and corresponding to the relay account, and registering it in the sub-state tree corresponding to the second reeling mode through the system contract System Contract in the second blockchain system.
用于对注册在第一区块链系统中的账户(包括中继账户)进行派生计算的算法可以是预先确定的,本说明书实施例中并不限制用于进行派生计算的算法。典型示例中,对于注册在第一区块链系统中的中继账户A,例如可以计算中继账户A和第二卷叠模式的标识信息对应的哈希值,从该哈希值中的前x位,将其作为属于第二卷叠模式并与中继账户对应的中继子账户。The algorithm used to perform the derived calculation on the account (including the relay account) registered in the first blockchain system may be predetermined, and the embodiments of this specification do not limit the algorithm used to perform the derived calculation. In a typical example, for the relay account A registered in the first blockchain system, for example, the hash value corresponding to the relay account A and the identification information of the second cascading mode may be calculated, and the first x bits of the hash value may be used as the relay sub-account belonging to the second cascading mode and corresponding to the relay account.
参照图7所示,当第一区块链系统中包括由第二区块链系统的管理成员注册的、与第二区块链系统对应的中继账户为账户A的情况下,如果第二区块链系统所支持的M种卷叠模式包括ZK-Rollup和TEE-Rollup,则ZK-Rollup对应的子状态树中可能包括与账户A对应的中继子账户ZK-AA,而TEE-Rollup对应的子状态树种则可能包括与账户A对应的中继子账户TEE-AA。As shown in Figure 7, when the first blockchain system includes a relay account corresponding to the second blockchain system registered by the management member of the second blockchain system, which is account A, if the M rolling modes supported by the second blockchain system include ZK-Rollup and TEE-Rollup, the sub-state tree corresponding to ZK-Rollup may include the relay sub-account ZK-AA corresponding to account A, and the sub-state tree corresponding to TEE-Rollup may include the relay sub-account TEE-AA corresponding to account A.
类似的,为了降低用户对其在第一区块链系统和第二区块链系统中所需维护账户的数量,从而提高用户体验,任意用户例如用户1在第二区块链系统中任意Rollup模式下的账户,均作为一个子账户与该用户1注册在第一区块链系统中的某个账户相对应。示例性的,参照图7所示,类似于前述的中继子账户ZK-AA和中继子账户TEE-AA均与账户A对应,属于ZK-Rollup的账户ZK-A1和属于TEE-Rollup的账户TEE-A1,均与用户1注册在Layer1中的账户A1相对应。Similarly, in order to reduce the number of accounts that users need to maintain in the first blockchain system and the second blockchain system, thereby improving user experience, any user, such as user 1, in any Rollup mode in the second blockchain system, is used as a sub-account corresponding to a certain account registered by user 1 in the first blockchain system. Exemplarily, as shown in FIG. 7 , similar to the aforementioned relay sub-account ZK-AA and relay sub-account TEE-AA, both correspond to account A, and account ZK-A1 belonging to ZK-Rollup and account TEE-A1 belonging to TEE-Rollup both correspond to account A1 registered by user 1 in Layer1.
任意用户例如用户1在ZK-Rollup下的账户ZK-A1,可基于账户A1和卷叠模式ZK-Rollup进行派生计算而得到;类似的,用户1在TEE-Rollup下的账户TEE-A1,可基于账户A1和卷叠模式TEE-Rollup进行派生计算而得到。或者,第二区块链系统中也可以通过直接维护映射关系表的方式,实现构造并存储任意用户例如用户1在第一区块链系统中的账户A1,与其在第二区块链系统中任意Rollup模式下的账户之间的对应关系。Any user, such as user 1, with an account ZK-A1 under ZK-Rollup can be derived from account A1 and the rollup mode ZK-Rollup; similarly, user 1's account TEE-A1 under TEE-Rollup can be derived from account A1 and the rollup mode TEE-Rollup. Alternatively, the second blockchain system can also construct and store the corresponding relationship between any user, such as user 1's account A1 in the first blockchain system and its account in any Rollup mode in the second blockchain system by directly maintaining a mapping relationship table.
因用户1在第一区块链系统中注册的账户A1,与用户1在第二区块链系统中的各个账户例如账户ZK-A1和账户TEE-A1之间存在对应关系,用户1可以复用其注册在第一 区块链系统中的账户A1以及对应的公私钥对,实现在第二区块链系统中按需发起相应的交易。与之相应的是,第二区块链系统的客户端可以并不向用户1呈现其在ZK-Rollup下的账户ZK-A1,以及其在TEE-Rollup下的账户TEE-A1,仅需要向用户1呈现:用户1在ZK-Rollup下的账户所持有第一目标资源的份额,以及用户1在ZK-Rollup下的账户所持有第一目标资源的份额即可。Since there is a corresponding relationship between the account A1 registered by user 1 in the first blockchain system and each account of user 1 in the second blockchain system, such as account ZK-A1 and account TEE-A1, user 1 can reuse the account A1 registered in the first blockchain system. Account A1 in the blockchain system and the corresponding public-private key pair can be used to initiate corresponding transactions in the second blockchain system on demand. Correspondingly, the client of the second blockchain system does not need to present its account ZK-A1 under ZK-Rollup and its account TEE-A1 under TEE-Rollup to user 1. It only needs to present to user 1: the share of the first target resource held by user 1's account under ZK-Rollup and the share of the first target resource held by user 1's account under ZK-Rollup.
示例性的,参照图8所示,第二区块链系统的客户端中可以仅向用户1呈现其注册在第一区块链系统中的账户A1;当用户1在任意Rollup模式例如ZK-Rollup和TEE-Rollup下持有第二目标资源时,第二区块链系统的客户端中还可以向用户1呈现其在ZK-Rollup下的子账户所持有第二目标资源的份额(即ZK账户余额),还可以向用户1呈现其在TEE-Rollup下的子账户所持有第二目标资源的份额(即TEE账户余额),然而却并不向其呈现账户ZK-A1和TEE-A1。Exemplarily, as shown in Figure 8, the client of the second blockchain system can only present to user 1 the account A1 registered in the first blockchain system; when user 1 holds the second target resource under any Rollup mode such as ZK-Rollup and TEE-Rollup, the client of the second blockchain system can also present to user 1 the share of the second target resource held by his sub-account under ZK-Rollup (i.e., the ZK account balance), and can also present to user 1 the share of the second target resource held by his sub-account under TEE-Rollup (i.e., the TEE account balance), but does not present to him the accounts ZK-A1 and TEE-A1.
当用户1期望在第二区块链系统中发起交易Tx来实现某种业务目的时,其可以利用注册在第一区块链系统中的账户A1来发起交易Tx。以用户1需要向用户2转移其持有的第二目标资源为例,该交易Tx中的From字段和To字段可以分别包括,用户1和用户2各自注册在第一区块连系统容中的账户A1和账户A2;此外交易Tx中还可以包括与From字段对应的指示字段(记为FR)以及与To字段对应的指示字段(记为TR)。其中:FR字段下的字段值,用于指示与账户A1对应并需要通过交易Tx转出第二目标资源的子账户所属的Rollup模式;TR字段下的字段值,用于指示与账户A2对应并需要通过交易Tx转入第二目标资源的子账户所属的Rollup模式。When user 1 expects to initiate a transaction Tx in the second blockchain system to achieve a certain business purpose, he can use account A1 registered in the first blockchain system to initiate transaction Tx. Taking the case where user 1 needs to transfer the second target resource held by user 2 to user 2, the From field and To field in the transaction Tx can respectively include account A1 and account A2 registered by user 1 and user 2 in the first blockchain system; in addition, the transaction Tx can also include an indication field (denoted as FR) corresponding to the From field and an indication field (denoted as TR) corresponding to the To field. Among them: the field value under the FR field is used to indicate the Rollup mode to which the sub-account corresponding to account A1 and which needs to transfer out the second target resource through transaction Tx belongs; the field value under the TR field is used to indicate the Rollup mode to which the sub-account corresponding to account A2 and which needs to transfer in the second target resource through transaction Tx belongs.
鉴于用户1在第二区块链系统中属于M个Rollup模式的各个子账户,均与其注册在第一区块链系统种的账户A1存在对应关系,而且用户2在L第二区块链系统中属于M个Rollup模式的各个子账户,均与其注册在第一区块链系统种的账户A2存在对应关系,第二区块链系统则能够基于交易Tx获知,该交易Tx中实际需要转出第二目标资源的子账户和实际需要转入第二目标资源的子账户,从而通过执行该交易Tx来完成交易Tx期望完成的资源转移事务。Given that each of the M Rollup modes of user 1 in the second blockchain system corresponds to account A1 registered with the user in the first blockchain system, and each of the M Rollup modes of user 2 in the second blockchain system corresponds to account A2 registered with the user in the first blockchain system, the second blockchain system can learn, based on transaction Tx, the subaccounts that actually need to transfer out the second target resources and the subaccounts that actually need to transfer into the second target resources in the transaction Tx, thereby completing the resource transfer transaction that the transaction Tx expects to complete by executing the transaction Tx.
图9为本说明书实施例中提供的一种区块链系统的资源管理方法的流程图之二。该方法示例性描述了在第二区块链系统支持M种卷叠模式的情况下,任意第一用户通过其注册在第一区块链系统种的第一账户,为其在第二区块链系统中的子账户增加第二目标资源的过程。Figure 9 is a second flow chart of a resource management method for a blockchain system provided in an embodiment of this specification. The method exemplarily describes the process of adding a second target resource to a sub-account in the second blockchain system by any first user through the first account registered in the first blockchain system when the second blockchain system supports M types of cascading modes.
参见图9所示,该方法可以包括但不限于如下步骤S901~步骤S907。As shown in FIG. 9 , the method may include but is not limited to the following steps S901 to S907 .
步骤S901,第一区块链系统接收第一账户发起的第一交易,第一交易用于调用第一区块链系统所部署的Bridge Contract,第一交易中指示了第二区块链系统所支持M种卷叠模式中的N种卷叠模式,以及N种卷叠模式各自对应的资源分发份额。In step S901, the first blockchain system receives a first transaction initiated by a first account, where the first transaction is used to call the Bridge Contract deployed by the first blockchain system. The first transaction indicates N types of cascading modes among the M types of cascading modes supported by the second blockchain system, and resource distribution shares corresponding to each of the N types of cascading modes.
第一用户可以通过其注册在第一区块链系统中的第一账户,发起第一交易。The first user may initiate a first transaction through a first account registered in the first blockchain system.
第一交易的From字段可以包括第一账户,To字段可以包括Bridge Contract对应的合约账户,Data字段中可以包括第二区块链系统所支持M种卷叠模式种的N种卷叠模式,以及该N种卷叠模式各自对应的资源分发份额。除此之外,第一交易的Data字段中还可以包括第二区块链系统的标识信息,以及第一交易期望调用的Bridge Contract中的方法函数/合约接口的标识信息,例如Bridge Contract中合约接口Deposite()的标识信息。 The From field of the first transaction may include the first account, the To field may include the contract account corresponding to the Bridge Contract, and the Data field may include N rollup modes among the M rollup modes supported by the second blockchain system, and the resource distribution shares corresponding to each of the N rollup modes. In addition, the Data field of the first transaction may also include the identification information of the second blockchain system, and the identification information of the method function/contract interface in the Bridge Contract that the first transaction expects to call, such as the identification information of the contract interface Deposite() in the Bridge Contract.
步骤S903,第一区块链系统根据第一交易执行Bridge Contract,实现:根据N种卷叠模式各自对应的资源分发份额,向中继账户转移第一目标资源,并生成资源分发事件,其中该资源分发事件包括第一账户、N种卷叠模式以及其各自对应的资源分发份额。Step S903, the first blockchain system executes the Bridge Contract according to the first transaction to achieve: transferring the first target resource to the relay account according to the resource distribution shares corresponding to the N folding modes, and generating a resource distribution event, wherein the resource distribution event includes the first account, N folding modes and their corresponding resource distribution shares.
第一区块链系统例如可以根据第一交易执行Bridge Contract中的Deposite(),实现生成资源分发事件。在一种可能的实施方式中,资源分发事件还可以包括第二区块链系统的标识信息。The first blockchain system can, for example, execute Deposite() in Bridge Contract according to the first transaction to generate a resource distribution event. In a possible implementation, the resource distribution event can also include identification information of the second blockchain system.
为了确保资源转移的可靠性,第二区块链系统的管理成员可以在第一区块链系统中,注册该第二区块链系统所对应的中继账户例如账户A。In order to ensure the reliability of resource transfer, the management member of the second blockchain system can register a relay account corresponding to the second blockchain system, such as account A, in the first blockchain system.
Bridge Contract还可以通过相应的资产转移事件列表或其它方式对存储资源分发事件。Bridge Contract can also distribute events to storage resources through corresponding asset transfer event lists or other methods.
第二区块链系统中的中继器,例如中继器所包括的共享桥Bridge,可以监听到第一区块链系统生成的资源分发事件,并基于监听到的资源分发事件执行如下步骤S905。The repeater in the second blockchain system, such as the shared bridge Bridge included in the repeater, can monitor the resource distribution event generated by the first blockchain system, and execute the following step S905 based on the monitored resource distribution event.
为了确保安全性,第二区块链系统的中继器所包括的Bridge,还可以从第一区块链系统中查询该资源分发事件对应的简单支付验证(simplified payment verification,SPV)证明,通过SPV证明确定第一交易所属区块已经在第一区块链系统成功提交后,才执行如下步骤S905。To ensure security, the Bridge included in the repeater of the second blockchain system can also query the simplified payment verification (SPV) certificate corresponding to the resource distribution event from the first blockchain system, and only execute the following step S905 after determining through the SPV certificate that the block to which the first transaction belongs has been successfully submitted in the first blockchain system.
步骤S905,第二区块链系统根据资源分发事件,生成N个子交易,任意第i个子交易中包括第一账户、N种卷叠模式中的第i种卷叠模式以及其对应的资源分发份额。Step S905: The second blockchain system generates N sub-transactions according to the resource distribution event, and any i-th sub-transaction includes the first account, the i-th folding mode among the N folding modes, and its corresponding resource distribution share.
第i个子交易中,From字段可以包括中继账户,To字段可以包括第一账户,Data字段可以包括第i种卷叠模式所对应的资源分发份额,与From字段对应的FR字段以及与To字段对应的TR字段所包括的Rollup模式均为第i种卷叠模式。参照图7所示,这里假设N种卷叠模式中包括TEE-Rollup和ZK-Rollup,则Bridge可以根据资源分发事件生成TEE子交易和ZK子交易:在ZK子交易中,与From字段对应的FR字段以及与To字段对应的TR字段,其包括的卷叠模式均为ZK-Rollup;而在TEE子交易中,与From字段对应的FR字段以及与To字段对应的TR字段,其包括的卷叠模式均为TEE-Rollup。In the i-th sub-transaction, the From field may include the relay account, the To field may include the first account, the Data field may include the resource distribution share corresponding to the i-th rollup mode, and the Rollup mode included in the FR field corresponding to the From field and the TR field corresponding to the To field are both the i-th rollup mode. As shown in FIG7 , it is assumed that the N rollup modes include TEE-Rollup and ZK-Rollup, then Bridge can generate TEE sub-transactions and ZK sub-transactions based on resource distribution events: in the ZK sub-transaction, the FR field corresponding to the From field and the TR field corresponding to the To field include the rollup mode of ZK-Rollup; and in the TEE sub-transaction, the FR field corresponding to the From field and the TR field corresponding to the To field include the rollup mode of TEE-Rollup.
步骤S907,第二区块链系统执行第i个子交易,实现:确定属于第i种卷叠模式并与第一账户对应的第i个第一子账户,根据第i种卷叠模式对应的资源分发份额,从属于第i种卷叠模式并与中继账户对应的中继子账户,向第i个第一子账户转移第二目标资源。Step S907, the second blockchain system executes the i-th sub-transaction to achieve: determining the i-th first sub-account that belongs to the i-th cascading mode and corresponds to the first account, and transferring the second target resource to the i-th first sub-account from the relay sub-account that belongs to the i-th cascading mode and corresponds to the relay account according to the resource distribution share corresponding to the i-th cascading mode.
第二区块链系统中可以通过其Sequencer执行第i个子交易。结合前文可以理解,Sequencer在执行第i个子交易时:在一种可能的实施方式中,可以利用第i个子交易所包括的第一账户和第i种卷叠模式,进行派生计算而获得第i个第一子账户;在另一种可能的实施方式中,可以通过查询第二区块链系统中维护的映射关系表而获得第i个第一子账户。The second blockchain system can execute the ith sub-transaction through its Sequencer. In combination with the foregoing, it can be understood that when the Sequencer executes the ith sub-transaction: in one possible implementation, the first account included in the ith sub-transaction and the ith folding mode can be used to perform a derivative calculation to obtain the ith first sub-account; in another possible implementation, the ith first sub-account can be obtained by querying the mapping relationship table maintained in the second blockchain system.
Sequencer获得第i个第一子账户之后,可以在第i种卷叠模式对应的子状态数中查询第i个第一子账户。如果未能从第i种卷叠模式对应的子状态树中查询到第i个第一子账户,则可以通过调用第二区块链系统的系统合约,实现在对应的子状态树中注册该第i个第一子账户。After the Sequencer obtains the ith first sub-account, it can query the ith first sub-account in the sub-state tree corresponding to the ith roll-up mode. If the ith first sub-account cannot be queried from the sub-state tree corresponding to the ith roll-up mode, the ith first sub-account can be registered in the corresponding sub-state tree by calling the system contract of the second blockchain system.
参照图7所示,假设第一账户包括账户A2,N种Rollup模式包括TEE-Rollup和 ZK-Rollup。As shown in FIG. 7 , it is assumed that the first account includes account A2, and the N types of Rollup modes include TEE-Rollup and ZK-Rollup.
如果Sequencer在执行ZK子交易的过程中,未能从ZK-Rollup对应的子状态树中查询到账户A2对应的子账户ZK-A2,Sequencer可以调用第二区块链系统的System Contract,实现在ZK-Rollup对应的子状态树中注册子账户ZK-A2;如果Sequencer在执行TEE子交易的过程中,同样未能从TEE-Rollup对应的子状态树中查询到账户A2对应的子账户TEE-A2,Sequencer则可以调用第二区块链系统的System Contract,实现在TEE-Rollup对应的子状态树中注册子账户TEE-A2。If the Sequencer fails to find the sub-account ZK-A2 corresponding to account A2 from the sub-state tree corresponding to ZK-Rollup during the execution of the ZK sub-transaction, the Sequencer can call the System Contract of the second blockchain system to register the sub-account ZK-A2 in the sub-state tree corresponding to ZK-Rollup; if the Sequencer fails to find the sub-account TEE-A2 corresponding to account A2 from the sub-state tree corresponding to TEE-Rollup during the execution of the TEE sub-transaction, the Sequencer can call the System Contract of the second blockchain system to register the sub-account TEE-A2 in the sub-state tree corresponding to TEE-Rollup.
当第i种卷叠模式对应的子状态数中已包括第i个第一子账户的情况下,第二区块链系统的Sequencer即可基于第i个子交易所包括的资源分发份额,从属于第i种卷叠模式并与中继账户对应的中继子账户,向第i个第一子账户转移第二目标资源。When the number of sub-states corresponding to the i-th cascading mode already includes the i-th first sub-account, the Sequencer of the second blockchain system can transfer the second target resource to the i-th first sub-account from the relay sub-account belonging to the i-th cascading mode and corresponding to the relay account based on the resource distribution share included in the i-th sub-transaction.
接续前文的举例,继续参照图7所示,Sequencer例如可以根据ZK子交易所包括的资源分发份额,从ZK-AA向子账户ZK-A2转移第二目标资源,以及,根据TEE子交易所包括的资源分发份额,从TEE-AA向子账户ZK-A2转移第二目标资源。Continuing with the previous example, referring to Figure 7, the Sequencer can, for example, transfer the second target resource from ZK-AA to the sub-account ZK-A2 according to the resource distribution share included in the ZK sub-transaction, and transfer the second target resource from TEE-AA to the sub-account ZK-A2 according to the resource distribution share included in the TEE sub-transaction.
或者也可以通过除前述步骤907以外的其它方式,实现向第i个第一子账户存入第二目标资源。示例性的,第二区块链系统执行第i个子交易时,可以实现:确定属于第i种卷叠模式并与第一账户对应的第i个第一子账户,根据第i种卷叠模式对应的资源分发份额,为第i个第一子账户铸造第二目标资源。即,此种实现方式下,无需从属于第i种卷叠模式并与中继账户对应的中继子账户转出第二目标资源,而是为第i个第一子账户铸造相应份额的第二目标资源。Alternatively, the second target resource may be deposited into the i-th first sub-account by other methods other than the aforementioned step 907. Exemplarily, when the second blockchain system executes the i-th sub-transaction, it may be implemented as follows: determining the i-th first sub-account that belongs to the i-th folding mode and corresponds to the first account, and casting the second target resource for the i-th first sub-account according to the resource distribution share corresponding to the i-th folding mode. That is, under this implementation, it is not necessary to transfer the second target resource from the relay sub-account that belongs to the i-th folding mode and corresponds to the relay account, but to cast the corresponding share of the second target resource for the i-th first sub-account.
考虑到第i个子交易可能存在执行失败的情况,当第i个子交易所属batch被成功提交到第一区块链系统后,例如第i个子交易所属batch对应的证明数据被提交到第一区块链系统并通过验证,从而使第i个子交易以及其所属batch进入不可更改状态后,依赖于第一区块链系统中的Rollup Contract能够感知第i个子交易已进入不可更改状态,此时Rollup Contract还可以通过调用Bridge Contract来生成与第i个子交易对应的第i个资产转移完成事件,资产转移完成事件中例如可以包括第一账户、第i种卷叠模式以及其对应的资源分发份额;进而,当Bridge Contract搜集到N个子交易所对应的N个资产转移完成事件后,Bridge Contract可以基于该N个资产转移完成事件以及前述的资源分发事件所包括的内容,确认该N个资产转移完成事件与前述的资源分发事件匹配成功,从而确认第一交易期望执行的事务被全部成功执行。Taking into account the possibility that the i-th sub-transaction may fail to execute, after the batch to which the i-th sub-transaction belongs is successfully submitted to the first blockchain system, for example, the proof data corresponding to the batch to which the i-th sub-transaction belongs is submitted to the first blockchain system and passed the verification, so that the i-th sub-transaction and the batch to which it belongs enter an unchangeable state, the Rollup Contract in the first blockchain system can perceive that the i-th sub-transaction has entered an unchangeable state. At this time, the Rollup Contract can also generate the i-th asset transfer completion event corresponding to the i-th sub-transaction by calling the Bridge Contract. The asset transfer completion event may include, for example, the first account, the i-th rollup mode and its corresponding resource distribution share; further, when the Bridge Contract collects N asset transfer completion events corresponding to N sub-exchanges, the Bridge Contract can confirm that the N asset transfer completion events are successfully matched with the aforementioned resource distribution events based on the contents included in the N asset transfer completion events and the aforementioned resource distribution events, thereby confirming that all the transactions expected to be executed by the first transaction have been successfully executed.
与之相应的,如果Bridge Contract未能完整搜集到N个子交易所对应的N个资产转移完成事件,则说明存在部分或全部子交易未能在第二区块链系统中被成功执行,此种情况下Bridge Contract的管理成员例如可以,根据资源分发事件和已搜集的资产转移完成事件,确定需要从中继账户向第一账户返还第一目标资源的补偿份额,从而通过相应的合约调用交易或其它方式,实现根据该补偿份额,从中继账户向第一账户转移第一目标资源。Correspondingly, if Bridge Contract fails to completely collect N asset transfer completion events corresponding to N sub-exchanges, it means that some or all of the sub-transactions have not been successfully executed in the second blockchain system. In this case, the management members of Bridge Contract can, for example, determine the compensation share of the first target resource that needs to be returned from the relay account to the first account based on the resource distribution event and the collected asset transfer completion events, and thus transfer the first target resource from the relay account to the first account based on the compensation share through the corresponding contract call transaction or other methods.
图10为本说明书实施例中提供的一种区块链系统的资源管理方法的流程图之三。该方法示例性描述了在第二区块链系统支持M种卷叠模式的情况下,任意第一用户根据其在第二区块链系统中属于任意第一卷叠模式的子账户所持有的第二目标资源,为该第一用户注册在第一区块链系统中的第一账户增加相应份额的第一目标资源的过程。 Figure 10 is a flowchart of a resource management method for a blockchain system provided in an embodiment of this specification. The method exemplarily describes the process of adding a corresponding share of the first target resource to the first account registered by the first user in the first blockchain system according to the second target resource held by the sub-account belonging to any first roll-up mode in the second blockchain system when the second blockchain system supports M roll-up modes.
参见图10所示,该方法可以包括但不限于如下步骤S1001~步骤S1007。As shown in FIG. 10 , the method may include but is not limited to the following steps S1001 to S1007 .
步骤S1001,第二区块链系统接收由第一账户发起的第二交易,第二交易中指示了资源转出份额和第一卷叠模式。第一卷叠模式属于第二区块链系统支持的M种卷叠模式。Step S1001: The second blockchain system receives a second transaction initiated by a first account, wherein the second transaction indicates a resource transfer share and a first roll-up mode. The first roll-up mode belongs to the M roll-up modes supported by the second blockchain system.
结合前文示例性描述的用户在第二区块链系统中发起的交易Tx的数据格式。第二交易的From字段例如可以包括第一账户,与From字段对应的FR字段所包括的卷叠模式可以为第一卷叠模式;第二交易的Data字段例如可以包括资源转出份额。此外,第二交易的To字段及其对应的TR字段可以按照预设规则进行设置,例如:To字段和TR字段均为Null;或者To字段与From字段包括相同的第一账户,TR字段和FR字段包括相同的第一卷叠模式。Combined with the data format of the transaction Tx initiated by the user in the second blockchain system described in the above example. The From field of the second transaction may include the first account, and the folding mode included in the FR field corresponding to the From field may be the first folding mode; the Data field of the second transaction may include the resource transfer share. In addition, the To field of the second transaction and its corresponding TR field may be set according to preset rules, for example: both the To field and the TR field are Null; or the To field and the From field include the same first account, and the TR field and the FR field include the same first folding mode.
第二区块链系统的接收器在接收到第二交易后,可以根据第二交易中与发送方字段对应的FR字段所包括的第一卷叠模式,将第二交易加入到与第一卷叠模式对应的交易池中。After receiving the second transaction, the receiver of the second blockchain system can add the second transaction to the transaction pool corresponding to the first concatenation mode according to the first concatenation mode included in the FR field corresponding to the sender field in the second transaction.
步骤S1003,第二区块链系统执行第二交易,实现:确定属于第一卷叠模式并与第一账户对应的第二子账户,根据资源转出份额,从第二子账户,向属于第一卷叠模式并与中继账户对应的中继子账户转出第二目标资源。Step S1003, the second blockchain system executes the second transaction to achieve: determining a second sub-account that belongs to the first cascading mode and corresponds to the first account, and transferring the second target resource from the second sub-account to a relay sub-account that belongs to the first cascading mode and corresponds to the relay account according to the resource transfer share.
第二区块链系统的Sequencer可以从第一卷叠模式对应的交易池中拉取多个交易,对其进行排序、执行并生成对应的打包交易。结合前文可以理解,Sequencer在执行第二交易时:在一种可能的实施方式种,可以利用第二交易所包括的第一账户和第一卷叠模式,进行派生计算而获得属于第一卷叠模式并与第一账户对应的第二子账户;在另一种可能的实施方式中,可以通过查询第二区块链系统中维护的映射关系表,获得第二子账户。The Sequencer of the second blockchain system can pull multiple transactions from the transaction pool corresponding to the first roll-up mode, sort them, execute them, and generate corresponding packaged transactions. In combination with the foregoing, it can be understood that when the Sequencer executes the second transaction: in one possible implementation, the first account and the first roll-up mode included in the second transaction can be used to perform a derivative calculation to obtain a second sub-account belonging to the first roll-up mode and corresponding to the first account; in another possible implementation, the second sub-account can be obtained by querying the mapping relationship table maintained in the second blockchain system.
需要注意的是,Sequencer执行第二交易时,能够基于第二交易的特殊结构,例如:To字段和TR字段均为Null,或者To字段与From字段包括相同的第一账户,而TR字段和FR字段包括相同的第一卷叠模式,触发第二区块链系统生成一个与该第二交易对应的第三交易。例如在Sequencer执行第二交易时可以基于前述的特殊结构,生成资源提取事件,其中包括第一账户和资源转出份额,此外还可以包括第二交易在第二区块链系统中所属第三batch的batch序号;第二区块链系统的Bridge例如可以根据该资源提取事件生成第三交易。It should be noted that when the Sequencer executes the second transaction, it can trigger the second blockchain system to generate a third transaction corresponding to the second transaction based on the special structure of the second transaction, for example: both the To field and the TR field are Null, or the To field and the From field include the same first account, and the TR field and the FR field include the same first folding mode. For example, when the Sequencer executes the second transaction, it can generate a resource extraction event based on the aforementioned special structure, which includes the first account and the resource transfer share, and can also include the batch number of the third batch to which the second transaction belongs in the second blockchain system; the Bridge of the second blockchain system can, for example, generate a third transaction based on the resource extraction event.
与之相应的,步骤S1005,第二区块链系统向第一区块链系统发送第三交易,第三交易用于调用Rollup Contract中的第一方法函数,第三交易中包括第一账户和资源转出份额。Correspondingly, in step S1005, the second blockchain system sends a third transaction to the first blockchain system, where the third transaction is used to call the first method function in the Rollup Contract, and the third transaction includes the first account and resource transfer share.
为了确保第一区块链系统能够判断第三交易所对应的第二交易是否被成功执行,第三交易中还可以包括第二交易所属第三batch的batch序号,此外第三交易中还可以包括第二交易在第三batch中的交易序号。而且,第二区块链系统的Bridge还可能在Replayer已完成向第一区块链系统提交第三batch对应的证明数据后,才向第一区块链系统发送第三交易。In order to ensure that the first blockchain system can determine whether the second transaction corresponding to the third transaction is successfully executed, the third transaction may also include the batch number of the third batch to which the second transaction belongs, and the third transaction may also include the transaction number of the second transaction in the third batch. Moreover, the Bridge of the second blockchain system may send the third transaction to the first blockchain system only after the Replayer has completed submitting the proof data corresponding to the third batch to the first blockchain system.
与之相应的,在步骤S1007,第一区块链系统根据第三交易执行Rollup Contract中的第一方法函数,实现:根据资源转出份额,从中继账户向第一账户转移第一目标资 源。Correspondingly, in step S1007, the first blockchain system executes the first method function in the Rollup Contract according to the third transaction to achieve: transferring the first target resource from the relay account to the first account according to the resource transfer share; source.
当第三交易中包括前述的batch序号和交易序号的情况下,第一区块链系统根据第三交易执行Rollup Contract中的第一方法函数时,具体可以实现:首先根据第三交易中所包括的第三batch的batch序号,确定该第三batch是否已进入不可更改状态,如果是则根据第三交易中所包括的交易序号查询该第三batch中是否包括与第三交易对应的第二交易,如果是则根据资源转出份额,从中继账户,向第一账户转移第一目标资源。可以理解,第二交易和第三交易匹配是指,第二交易和第三交易中均包括相同的第一账户和资源转出份额。When the third transaction includes the aforementioned batch number and transaction number, when the first blockchain system executes the first method function in the Rollup Contract according to the third transaction, it can be specifically implemented as follows: first, according to the batch number of the third batch included in the third transaction, determine whether the third batch has entered an unchangeable state; if so, query whether the third batch includes the second transaction corresponding to the third transaction according to the transaction number included in the third transaction; if so, transfer the first target resource from the relay account to the first account according to the resource transfer-out share. It can be understood that the second transaction and the third transaction match means that the second transaction and the third transaction both include the same first account and resource transfer-out share.
第一区块链系统执行第三交易时,第二交易所属第三batch可能并未进入不可更改状态。此种情况下,第一区块链系统根据第三交易执行Rollup Contract中的第一方法函数时,可以根据第二交易所属第三batch的batch序号,以及第二交易在第三batch中的交易序号,在Rollup Contract中设置触发条件;当第二区块链系统中完成向Rollup Contract提交第二交易所属第三batch的证明数据,并且该证明数据通过验证而使得第二交易所属第三batch进入不可状态后,满足在Rollup Contract中设置触发条件,从而对应的触发第一方法函数继续根据第三交易中所包括的交易序号查询该第三batch中是否包括与第三交易对应的第二交易,如果是则根据资源转出份额,从中继账户,向第一账户转移第一目标资源。When the first blockchain system executes the third transaction, the third batch to which the second transaction belongs may not have entered an unchangeable state. In this case, when the first blockchain system executes the first method function in the Rollup Contract according to the third transaction, the trigger condition can be set in the Rollup Contract according to the batch number of the third batch to which the second transaction belongs and the transaction number of the second transaction in the third batch; when the second blockchain system completes submitting the proof data of the third batch to which the second transaction belongs to the Rollup Contract, and the proof data passes the verification and causes the third batch to which the second transaction belongs to enter an unchangeable state, the trigger condition set in the Rollup Contract is satisfied, thereby triggering the corresponding first method function to continue to query whether the third batch includes the second transaction corresponding to the third transaction according to the transaction number included in the third transaction, and if so, the first target resource is transferred from the relay account to the first account according to the resource transfer-out share.
在一种可能的实施方式中,当需要从中继账户向第一账户转移第一目标资源时,Rollup Contract中的第一方法函数可以调用Bridge Contract中的合约接口Withdraw(),从而通过合约接口Withdraw()来完成,根据资源转出份额,从中继账户向第一账户转移第一目标资源。In one possible implementation, when it is necessary to transfer the first target resource from the relay account to the first account, the first method function in the Rollup Contract can call the contract interface Withdraw() in the Bridge Contract, thereby completing the transfer of the first target resource from the relay account to the first account according to the resource transfer share through the contract interface Withdraw().
图11为本说明书实施例中提供的一种区块链系统的资源方法的流程图之四。该方法示例性描述了在第一区块链系统和第二区块链系统中终止卷叠模式(记为第二卷叠模式)的过程。Figure 11 is a fourth flow chart of a resource method of a blockchain system provided in an embodiment of this specification. The method exemplarily describes the process of terminating the roll-up mode (referred to as the second roll-up mode) in the first blockchain system and the second blockchain system.
参照图11所示,该方法可以包括但不限于如下步骤S1101~步骤S1107。11 , the method may include but is not limited to the following steps S1101 to S1107 .
步骤S1101,第一区块链系统接收第五交易,第五交易用于调用Rollup Contract中的第三方法函数,第五交易请求终止第二卷叠模式。Step S1101, the first blockchain system receives the fifth transaction, the fifth transaction is used to call the third method function in the Rollup Contract, and the fifth transaction requests to terminate the second rollup mode.
第二区块链系统的管理成员可以在第一区块链系统中发起第五交易,第五交易用于调用Rollup Contract中的第三方法函数,其中可以指示需要终止的第二卷叠模式。The management member of the second blockchain system can initiate a fifth transaction in the first blockchain system, and the fifth transaction is used to call the third method function in the Rollup Contract, which can indicate that the second rollup mode needs to be terminated.
步骤S1103,第一区块链系统根据第五交易执行第三方法函数,实现:生成卷叠终止事件,并根据第二卷叠模式的注册信息,对卷叠合约和中继合约进行第三升级操作。Step S1103: the first blockchain system executes the third method function according to the fifth transaction to achieve: generating a roll-up termination event, and performing a third upgrade operation on the roll-up contract and the relay contract according to the registration information of the second roll-up mode.
第三升级操作与前述的第一升级操作相对应。The third upgrading operation corresponds to the aforementioned first upgrading operation.
以待终止的第二卷叠模式包括TEE-Rollup为例。对Rollup Contract进行的第三升级操作可以包括但不限于,在Rollup Contract中删除或禁用TEE-Rollup对应的验证方法TEE verifier。对Bridge Contract进行的第三升级操作可以包括但不限于,重配置Bridge Contract中的合约接口Deposite()和合约接口Withdraw(),使注册在第一区块链系统中的账户,无法再通过对合约接口Deposite()进行调用,实现对第二区块链系统中属于TEE-Rollup的某个子账户增加相应份额的第二目标资源;以及,使第二区块链系 统中属于TEE-Rollup的某个子账户,无法再基于其持有第二目标资源的份额,通过合约接口Withdraw(),实现在第一区块链系统中与该子账户对应的账户下,新增第一目标资源。Take the case where the second rollup mode to be terminated includes TEE-Rollup. The third upgrade operation on the Rollup Contract may include, but is not limited to, deleting or disabling the verification method TEE verifier corresponding to TEE-Rollup in the Rollup Contract. The third upgrade operation on the Bridge Contract may include, but is not limited to, reconfiguring the contract interface Deposite() and the contract interface Withdraw() in the Bridge Contract, so that the account registered in the first blockchain system can no longer call the contract interface Deposite() to increase the corresponding share of the second target resource for a sub-account belonging to TEE-Rollup in the second blockchain system; and making the second blockchain system A sub-account belonging to TEE-Rollup in the system can no longer add the first target resource to the account corresponding to the sub-account in the first blockchain system through the contract interface Withdraw() based on its share of the second target resource.
卷叠终止事件中可以指示待终止的第二卷叠模式,例如包括第二卷叠模式的标识信息。The scroll termination event may indicate the second scroll mode to be terminated, for example, including identification information of the second scroll mode.
第二区块链系统中的中继器,例如中继器所包括的Bridge,可以监听到卷叠终止事件,进而根据该卷叠终止事件所指示的第三卷叠模式,对第二区块链系统的基础设施进行第四升级操作,使得进行第三升级操作后的第一区块链系统与进行第四升级操作后的第二区块链系统之间,不再支持采用第二卷叠模式实现卷叠。The repeater in the second blockchain system, such as the Bridge included in the repeater, can monitor the roll-up termination event, and then perform a fourth upgrade operation on the infrastructure of the second blockchain system according to the third roll-up mode indicated by the roll-up termination event, so that the first blockchain system after the third upgrade operation and the second blockchain system after the fourth upgrade operation no longer support the roll-up using the second roll-up mode.
示例性的,第二区块链系统例如可以基于卷叠注册事件执行如下步骤S1105和步骤1107。Exemplarily, the second blockchain system may, for example, perform the following steps S1105 and 1107 based on the wrap-up registration event.
步骤1105,第二区块链系统通过其中继器,利用卷叠终止事件生成第二升级交易,第二升级交易中指示待终止得第二卷叠模式。Step 1105: The second blockchain system generates a second upgrade transaction through its repeater using the roll-up termination event, and the second upgrade transaction indicates the second roll-up mode to be terminated.
第二升级交易可以是特殊交易,其可以并不打包到第二区块链系统所提交的打包交易中。示例性的,中继器所包括的Bridge可以通过对第一升级交易的发送方字段和接收方字段进行特殊设置,例如将From字段设置为中继账户而To字段为Null,使第二区块链系统的Sequencer能够准确获知第二升级交易为特殊交易,执行第二升级交易其期望执行的事务且并不将其打包到batch中;第二升级交易的Data字段可以包括第二卷叠模式的标识信息。The second upgrade transaction may be a special transaction, which may not be packaged into the packaged transaction submitted by the second blockchain system. Exemplarily, the Bridge included in the repeater may make special settings for the sender field and the receiver field of the first upgrade transaction, such as setting the From field to the relay account and the To field to Null, so that the Sequencer of the second blockchain system can accurately know that the second upgrade transaction is a special transaction, execute the transaction that it expects to execute in the second upgrade transaction and do not package it into the batch; the Data field of the second upgrade transaction may include identification information of the second folding mode.
步骤S1007,第二区块链系统通过其Sequencer执行第二升级交易,实现:根据第二卷叠模式的标识信息对第二区块链系统的基础设施进行第四升级操作。Step S1007: The second blockchain system executes a second upgrade transaction through its Sequencer to implement: performing a fourth upgrade operation on the infrastructure of the second blockchain system according to the identification information of the second roll-up mode.
以待终止的第二卷叠模式包括TEE-Rollup为例。第二区块链系统的共享桥Bridge例如可以向Sequencer发送第二升级交易,第二升级交易中包括TEE-Rollup的标识信息。第二区块链系统的Sequencer执行第二升级交易时,对第二区块链系统的基础设施进行的第四升级操作,可以包括但不限于:在接收器中删除或禁用与TEE-Rollup对应的交易池TEE Txpool;对Sequencer进行重配置,使得进行重配置后的Sequencer不再处理TEE Txpool中的交易;以及,在第二区块链系统中删除用禁用TEE-Rollup所对应的证明器TEE Prover。Take the second rollup mode to be terminated including TEE-Rollup as an example. The shared bridge of the second blockchain system, for example, can send a second upgrade transaction to the Sequencer, and the second upgrade transaction includes the identification information of TEE-Rollup. When the Sequencer of the second blockchain system executes the second upgrade transaction, the fourth upgrade operation performed on the infrastructure of the second blockchain system may include but is not limited to: deleting or disabling the transaction pool TEE Txpool corresponding to TEE-Rollup in the receiver; reconfiguring the Sequencer so that the reconfigured Sequencer no longer processes transactions in TEE Txpool; and deleting the prover TEE Prover corresponding to the disabled TEE-Rollup in the second blockchain system.
在一种可能的实施方式中,依赖于第二卷叠模式对应的卷叠终止事件,第二区块链系统还可以接着执行步骤S1109和S1111,完成将属于第二卷叠模式并与任意账户(记为目标账户)对应的第一目标子账户所持有的第二目标资源,转移至属于第三卷叠模式并与目标账户对应的第二目标子账户中,目标账户是指注册在第一区块链系统中的外部账户。In a possible implementation, depending on the roll-up termination event corresponding to the second roll-up mode, the second blockchain system may further execute steps S1109 and S1111 to complete the transfer of the second target resource held by the first target sub-account belonging to the second roll-up mode and corresponding to any account (recorded as the target account) to the second target sub-account belonging to the third roll-up mode and corresponding to the target account, where the target account refers to an external account registered in the first blockchain system.
步骤S1109,第二区块链系统通过其中继器,根据卷叠终止事件,生成第六交易。Step S1109: The second blockchain system generates a sixth transaction through its repeater according to the wrap-up termination event.
第二升级交易可以是特殊交易,其可以并不打包到第二区块链系统所提交的打包交易中。示例性的,中继器所包括的Bridge可以通过对第六交易的发送方字段和接收方字段进行特殊设置,例如将From字段和To字段均设置为Null,并将与From字段对应的FR字段、与To字段对应的TR字段均设置为第二卷叠模式,使第二区块链系统的Sequencer能够准确获知第六交易为特殊交易,执行第六交易其期望执行的事务且并不 将其打包到batch中。The second upgrade transaction may be a special transaction, which may not be packaged into the packaged transaction submitted by the second blockchain system. Exemplarily, the Bridge included in the repeater can make special settings for the sender field and the receiver field of the sixth transaction, such as setting both the From field and the To field to Null, and setting the FR field corresponding to the From field and the TR field corresponding to the To field to the second folding mode, so that the Sequencer of the second blockchain system can accurately know that the sixth transaction is a special transaction, execute the sixth transaction, and not execute the transaction it expects to execute. Package it into batch.
步骤S1111,第二区块链系统通过其Sequencer执行第六交易,实现:对属于第二卷叠模式的任意第一目标子账户,将其持有的第二目标资源,转移至属于第三卷叠模式的第二目标子账户,第一目标子账户和第二目标子账户对应注册在第一区块链系统中的相同目标账户。In step S1111, the second blockchain system executes the sixth transaction through its Sequencer to achieve: for any first target sub-account belonging to the second cascading mode, the second target resource held by it is transferred to the second target sub-account belonging to the third cascading mode, and the first target sub-account and the second target sub-account correspond to the same target account registered in the first blockchain system.
参照图7所示,接续前文的举例,继续假设被终止的第二卷叠模式是TEE-Rollup,并且假设第三卷叠模式包括ZK-Rollup。则,账户TEE-A1所持有的第二目标资源,可以被转移到账户ZK-A1中,而账户TEE-A2所持有的第二目标资源,可以被转移到账户ZK-A2中。Referring to FIG. 7 , continuing with the previous example, assuming that the terminated second rollup mode is TEE-Rollup, and assuming that the third rollup mode includes ZK-Rollup, then the second target resource held by account TEE-A1 can be transferred to account ZK-A1, and the second target resource held by account TEE-A2 can be transferred to account ZK-A2.
当第二卷叠模式被终止的情况下,还可以通过除前述步骤S1109和步骤1111以外的其它方式,实现转移属于第二卷叠模式的任意第一目标子账户所持有的目标资源。例如第二区块链系统的中继器所包括的Bridge可以生成目标交易,目标交易用于调用第一区块链系统所部署Rollup Contract中的某个预设方法函数,第一区块链系统根据该目标交易执行预设函数时,对属于第二卷叠模式的任意第一目标子账户,根据其持有的第二目标资源的当前份额,从与第二区块链系统对应的中继账户,向注册在第一区块链系统中的目标账户转移第一目标资源。When the second rollup mode is terminated, the target resource held by any first target sub-account belonging to the second rollup mode can be transferred by other methods other than the aforementioned step S1109 and step 1111. For example, the Bridge included in the repeater of the second blockchain system can generate a target transaction, and the target transaction is used to call a preset method function in the Rollup Contract deployed by the first blockchain system. When the first blockchain system executes the preset function according to the target transaction, for any first target sub-account belonging to the second rollup mode, according to the current share of the second target resource held by it, the first target resource is transferred from the relay account corresponding to the second blockchain system to the target account registered in the first blockchain system.
图12为本说明书实施例中提供的一种区块链系统的资源管理方法的流程图之五。该方法示例性描述了在支持M中卷叠模式的第二区块链系统中,从属于第一卷叠模式并与第一账户对应的第一子账户,向属于第二卷叠模式并与第二账户对应的第二子账户转移资源的过程。Figure 12 is a flowchart of a resource management method for a blockchain system provided in an embodiment of this specification. The method exemplarily describes the process of transferring resources from a first sub-account belonging to a first cascading mode and corresponding to a first account to a second sub-account belonging to a second cascading mode and corresponding to a second account in a second blockchain system supporting the M-folding mode.
首先,在步骤S1201,第二区块链系统接收第七交易,第七交易的发送方字段和接收方字段分别包括第一账户和第二账户,第七交易中还包括资源转移份额、与发送方字段对应的第一卷叠模式和与接收方字段对应的第二卷叠模式。First, in step S1201, the second blockchain system receives the seventh transaction, the sender field and the receiver field of the seventh transaction include the first account and the second account respectively, and the seventh transaction also includes a resource transfer share, a first folding mode corresponding to the sender field, and a second folding mode corresponding to the receiver field.
下文主要以第一卷叠模式包括ZK-Rollup,第二卷叠模式包括TEE-Rollup,第一账户包括账户A1,第二账户包括账户A2,中继账户包括账户A,资源转移份额是T进行举例描述。The following mainly describes by example that the first rolling mode includes ZK-Rollup, the second rolling mode includes TEE-Rollup, the first account includes account A1, the second account includes account A2, the relay account includes account A, and the resource transfer share is T.
第七交易可以是持有账户A1的用户1通过第二区块链系统的客户端发起的。The seventh transaction may be initiated by user 1 holding account A1 through the client of the second blockchain system.
在前述示例的基础上,对于该第七交易:From字段(即发送方字段)可以包括账户A1,To字段(即接收方字段)可以包括账户A2,与From字段对应的FR字段可以包括ZK-Rollup,与To字段对应的TR字段可以包括TEE-Rollup,Data字段可以包括资源转移份额T。Based on the previous examples, for the seventh transaction: the From field (i.e., the sender field) may include account A1, the To field (i.e., the receiver field) may include account A2, the FR field corresponding to the From field may include ZK-Rollup, the TR field corresponding to the To field may include TEE-Rollup, and the Data field may include the resource transfer share T.
第二区块链系统不仅能够从其客户端接收到交易,其自身还可能通过中继器所包括的共享桥Bridge发起需要由第二区块链系统执行的交易,例如Bridge可能发起前述的ZK子交易以及TEE子交易等等。对于需要由第二区块链系统执行的交易,可以根据该交易中与From字段对应的FR字段下的字段值,将该交易加入到对应的交易池中。例如对于第七交易而言,与From字段对应的FR字段下的字段值是ZK-Rollup,可以将其加入到对应的ZK Txpool中。The second blockchain system can not only receive transactions from its client, but it can also initiate transactions that need to be executed by the second blockchain system through the shared bridge Bridge included in the repeater. For example, Bridge may initiate the aforementioned ZK sub-transaction and TEE sub-transaction, etc. For transactions that need to be executed by the second blockchain system, the transaction can be added to the corresponding transaction pool according to the field value under the FR field corresponding to the From field in the transaction. For example, for the seventh transaction, the field value under the FR field corresponding to the From field is ZK-Rollup, which can be added to the corresponding ZK Txpool.
第二区块链系统中的M种卷叠模式可以共用一条batch链,该batch链中包括顺序连接的多个batch。对属于相同batch的多个交易,其FR字段下所包括的卷叠模式 需要保持相同。任意batch的batch头中,除包括常规的Prev Hash、Nonce、Batch Num(batch序号)、Tx_Root、State_Root以及Receipt_Root等信息外,还可以包括该任意batch所对应的Rollup模式。参照图13所示,如果batch 1的batch头中包括ZK-Rollup,意味着对于batch 1所包括的多个交易中,与From字段对应的FR字段均为ZK-Rollup;如果batch 2的batch头中包括TEE-Rollup,意味着对于batch 2所包括的多个交易中,与From字段对应的FR字段均为TEE-Rollup。The M types of convolution modes in the second blockchain system can share a batch chain, which includes multiple batches connected in sequence. For multiple transactions belonging to the same batch, the convolution modes included in the FR field are Need to remain the same. In addition to the conventional Prev Hash, Nonce, Batch Num (batch number), Tx_Root, State_Root, and Receipt_Root information, the batch header of any batch can also include the Rollup mode corresponding to the batch. As shown in Figure 13, if the batch header of batch 1 includes ZK-Rollup, it means that for the multiple transactions included in batch 1, the FR field corresponding to the From field is all ZK-Rollup; if the batch header of batch 2 includes TEE-Rollup, it means that for the multiple transactions included in batch 2, the FR field corresponding to the From field is all TEE-Rollup.
需要注意的是,M种卷叠模式共用一条batch链时,batch头中的State_Root是基于M种卷叠模式各自对应的状态根,计算得到的第二区块链系统的整个世界状态的状态根,即Global state root,而并非某种卷叠模式所对应的子状态树的状态根。与之相应的,下文中所描述的前状态根和后状态均对应Global state root而非某个子状态树的状态根。It should be noted that when M kinds of convolution modes share a batch chain, the State_Root in the batch header is the state root of the entire world state of the second blockchain system calculated based on the state roots corresponding to each of the M convolution modes, that is, the Global state root, rather than the state root of the sub-state tree corresponding to a certain convolution mode. Correspondingly, the previous state root and the subsequent state described below correspond to the Global state root rather than the state root of a sub-state tree.
因M种卷叠模式共用相同的batch链,当第二区块链系统的Sequencer在开始执行下一个交易batch相关的事务前,则需要首先确定将要打包的下一个交易batch所对应的卷叠模式。Because the M convolution modes share the same batch chain, when the Sequencer of the second blockchain system starts to execute transactions related to the next transaction batch, it needs to first determine the convolution mode corresponding to the next transaction batch to be packaged.
相应的,第二区块链系统可能执行如下步骤S1203,确定将要打包的下一个batch所对应的目标卷叠模式,并在该目标卷叠模式为第一卷叠模式的情况下,从第一卷叠模式对应的交易池中拉取多个交易,对该多个交易排序并打包,该多个交易包括第七交易。Accordingly, the second blockchain system may execute the following step S1203, determine the target stacking mode corresponding to the next batch to be packaged, and when the target stacking mode is the first stacking mode, pull multiple transactions from the transaction pool corresponding to the first stacking mode, sort and package the multiple transactions, and the multiple transactions include the seventh transaction.
第二区块链系统的Sequencer可以根据以下各项信息中的至少一项,确定将要打包的下一个batch所对应的目标卷叠模式:M种卷叠模式各自对应的batch提交时间间隔、M种卷叠模式各自对应的batch所需包括交易的参考数量以及M个交易池各自缓存的交易数量。示例性的,Sequencer可以统计当前时刻下M个交易池中各自包括的交易数量,将交易数量最大的交易池所对应的卷叠模式确定为目标卷叠模式;再如,当交易池中的交易数量不小于对应的参考数量时,将该交易池对应的卷叠模式作为候选卷叠模式,进而按照batch提交时间间隔和/交易池中的交易数量,从若干候选卷叠模式中确定出目标卷叠模式。The Sequencer of the second blockchain system may determine the target rollup mode corresponding to the next batch to be packaged according to at least one of the following information: the batch submission time interval corresponding to each of the M rollup modes, the reference number of transactions required to be included in the batch corresponding to each of the M rollup modes, and the number of transactions cached in each of the M transaction pools. For example, the Sequencer may count the number of transactions included in each of the M transaction pools at the current moment, and determine the rollup mode corresponding to the transaction pool with the largest number of transactions as the target rollup mode; for another example, when the number of transactions in the transaction pool is not less than the corresponding reference number, the rollup mode corresponding to the transaction pool is used as a candidate rollup mode, and then the target rollup mode is determined from several candidate rollup modes according to the batch submission time interval and/or the number of transactions in the transaction pool.
下文中以第七交易被打包到batch k(即第一batch)为例进行示例性描述。The following description takes the seventh transaction being packaged into batch k (i.e., the first batch) as an example.
如果Sequencer确定将要打包的下一个batch(batch k)所对应的目标卷叠模式是ZK-Rollup,则Sequencer可能从ZK Txpool中拉去多个交易进行排序并打包,根据batch k的前一个batch所对应的世界状态,按排序结果顺序执行打包到batch k中的多个交易。If the Sequencer determines that the target rollup mode corresponding to the next batch to be packaged (batch k) is ZK-Rollup, the Sequencer may pull multiple transactions from the ZK Txpool for sorting and packaging, and execute the multiple transactions packaged into batch k in the order of the sorting results according to the world state corresponding to the previous batch of batch k.
当batch k中的多个交易包括第七交易的情况下,第二区块链系统则会执行步骤S1205。When multiple transactions in batch k include the seventh transaction, the second blockchain system will execute step S1205.
步骤S1205,执行第七交易,实现:根据资源转移份额,从属于第一卷叠模式并与第一账户对应的第一子账户,向属于第一卷叠模式并与中继账户对应的第一中继子账户转移第二目标资源,并生成跨模式转账事件。Step S1205, executing the seventh transaction, to achieve: according to the resource transfer share, transferring the second target resource from the first sub-account belonging to the first cascading mode and corresponding to the first account to the first relay sub-account belonging to the first cascading mode and corresponding to the relay account, and generating a cross-mode transfer event.
Sequencer执行第七交易的过程中,可以首先确定出属于第一卷叠模式并与第一账户对应的第一子账户,以及,根据预先配置的中继账户确定出属于第一卷叠模式并与该中继账户对应的第一中继子账户。其中,Sequencer例如可以通过前文所述的派生计 算或者映射关系表等方式,实现确定出第一子账户和第一中继子账户,此处不再赘述。During the process of executing the seventh transaction, the Sequencer may first determine the first sub-account that belongs to the first folding mode and corresponds to the first account, and determine the first relay sub-account that belongs to the first folding mode and corresponds to the relay account according to the pre-configured relay account. The first sub-account and the first relay sub-account are determined by calculation or mapping relationship table, which will not be described in detail here.
Sequencer执行第七交易的过程中,例如可以在确定出属于ZK-Rollup并与账户A1对应的第一子账户是账户ZK-A1,确定出属于ZK-Rollup并与账户A对应的第一中继子账户是账户ZK-AA之后,即可根据资源转移份额T,从账户ZK-A1向账户ZK-AA转移第二目标资源。During the process of the Sequencer executing the seventh transaction, for example, after determining that the first sub-account belonging to ZK-Rollup and corresponding to account A1 is account ZK-A1, and determining that the first relay sub-account belonging to ZK-Rollup and corresponding to account A is account ZK-AA, the second target resource can be transferred from account ZK-A1 to account ZK-AA according to the resource transfer share T.
前述跨模式转账事件中,其Data字段可以包括但不限于:第七交易中To字段下的第二账户,与To字段对应的TR字段下的第二卷叠模式,以及Data字段下的资源转移份额。In the aforementioned cross-mode transfer event, the Data field may include but is not limited to: the second account under the To field in the seventh transaction, the second rollup mode under the TR field corresponding to the To field, and the resource transfer share under the Data field.
Sequencer完成执行属于batch k的多个交易后,第二区块链系统的中继器所包括的共享桥Bridge可以监听到该跨模式转账事件,进而可以接着执行如下步骤S1207。After the Sequencer completes the execution of multiple transactions belonging to batch k, the shared bridge Bridge included in the repeater of the second blockchain system can monitor the cross-mode transfer event, and then can continue to execute the following step S1207.
步骤S1207,根据跨模式转账事件,生成第八交易,该第八交易的发送方字段和接收方字段分别包括中继账户和第二账户,第八交易中还包括资源转移份额和第二卷叠模式。Step S1207: Generate an eighth transaction according to the cross-mode transfer event. The sender field and the receiver field of the eighth transaction include the relay account and the second account respectively. The eighth transaction also includes a resource transfer share and a second roll-up mode.
接续前文的举例。该第八交易中:From字段例如可以包括账户A,To字段可以包括账户A2,与From字段对应的FR字段可以包括TEE-Rollup,与To字段对应的TR字段可以包括TEE-Rollup,Data字段例如可以包括资源转移份额。与之相应的,因第八交易中与From字段对应的FR字段下的字段值为TEE-Rollup,第八交易将会被加入到对应的TEE Txpool中。Continuing with the previous example. In the eighth transaction: the From field may include account A, the To field may include account A2, the FR field corresponding to the From field may include TEE-Rollup, the TR field corresponding to the To field may include TEE-Rollup, and the Data field may include resource transfer shares. Accordingly, since the field value under the FR field corresponding to the From field in the eighth transaction is TEE-Rollup, the eighth transaction will be added to the corresponding TEE Txpool.
Sequencer完成执行属于batch k的多个交易后,参照前文,Sequencer可以获得batch k所对应的前状态根(Pre State Root)、后状态根(Post State Root)、batch序号k、该多个交易组成的交易序列等卷叠数据。要注意的是,这里的Pre State Root指的是batch k中的多个交易被执行前,第二区块链系统的世界状态所对应的状态根(即Global state root);Post State Root指的是batch k中的多个交易被执行后,第二区块链系统的世界状态所对应的状态根。After the Sequencer completes the execution of multiple transactions belonging to batch k, referring to the previous text, the Sequencer can obtain the pre-state root (Pre State Root), post-state root (Post State Root), batch number k, and the transaction sequence composed of the multiple transactions corresponding to batch k. It should be noted that the Pre State Root here refers to the state root (i.e., Global state root) corresponding to the world state of the second blockchain system before the multiple transactions in batch k are executed; Post State Root refers to the state root corresponding to the world state of the second blockchain system after the multiple transactions in batch k are executed.
与之相应的,第二区块链系统还可以接着执行步骤S1209,向第一区块链系统发送第九交易,第九交易用于调用第一区块链系统所部署Rollup Contract合约中的第四方法函数,第九交易中包括第七交易所属第一batch的卷叠数据。Correspondingly, the second blockchain system may further execute step S1209 to send a ninth transaction to the first blockchain system, where the ninth transaction is used to call the fourth method function in the Rollup Contract deployed by the first blockchain system, and the ninth transaction includes the rolled-up data of the first batch to which the seventh transaction belongs.
Rollup Contract中的第四方法函数例如是前文所述的commitBatch()合约接口。The fourth method function in the Rollup Contract is, for example, the commitBatch() contract interface mentioned above.
与之相应的,第一区块链系统可以执行步骤S1211,根据第九交易执行Rollup Contract合约中的第四方法函数,实现对第七交易所属第一batch的卷叠数据进行处理。Correspondingly, the first blockchain system can execute step S1211, execute the fourth method function in the Rollup Contract according to the ninth transaction, and process the rolled data of the first batch belonging to the seventh transaction.
回溯前文,第一batch即batch k的卷叠数据可以包括:前状态根、后状态根、batch序号k、属于batch k的多个交易组成的交易序列等。对batch k的卷叠数据进行处理的过程可以包括:验证第九交易中的Pre State Root是否与Rollup Contract合约存储中的Current State Root相等,如果相等则将第九交易中的交易序列存入calldata中,并将合约存储中的Current State Root更新为Post State Root;以及根据batch序号k设置该交易序列在calldata中的位置索引。Looking back to the previous text, the convoluted data of the first batch, batch k, may include: pre-state root, post-state root, batch number k, transaction sequence consisting of multiple transactions belonging to batch k, etc. The process of processing the convoluted data of batch k may include: verifying whether the Pre State Root in the ninth transaction is equal to the Current State Root in the Rollup Contract contract storage, if they are equal, storing the transaction sequence in the ninth transaction in calldata, and updating the Current State Root in the contract storage to Post State Root; and setting the position index of the transaction sequence in calldata according to the batch number k.
回到第二区块链系统,第二区块链系统通过前述步骤S1209完成提交第一batch即batch k后,类似前述步骤S1203,Sequencer需要确定将要打包的下一个batch对应的目标卷叠模式。 Back to the second blockchain system, after the second blockchain system completes submitting the first batch, i.e., batch k, through the aforementioned step S1209, similar to the aforementioned step S1203, the Sequencer needs to determine the target convolution mode corresponding to the next batch to be packaged.
与之相应的,第二区块链系统可能执行步骤S1213,确定将要打包的下一个batch所对应的目标卷叠模式,并在该目标卷叠模式为第二卷叠模式的情况下,从第二卷叠模式对应的交易池中拉取多个交易,对该多个交易排序并打包,该多个交易包括第八交易。Correspondingly, the second blockchain system may execute step S1213, determine the target stacking mode corresponding to the next batch to be packaged, and when the target stacking mode is the second stacking mode, pull multiple transactions from the transaction pool corresponding to the second stacking mode, sort and package the multiple transactions, and the multiple transactions include the eighth transaction.
Batch k的下一个batch即batch k+1所对应的目标卷叠模式可能并非第二卷叠模式,而且即使batch k+1所对应的目标卷叠模式,也可能因第二卷叠模式所对应交易池中的交易数量较多,导致第八交易并不会被打包到batch k+1中。因此,第八交易实际所属的batch可能并非batch k+1,其实际上可能会被打包到batch序号大于k的某个第二batch中,然而本说明书实施例中为了方便描述,仍然将会以第二batch是batch k+1进行示例性描述。The target convolution mode corresponding to the next batch of batch k, i.e., batch k+1, may not be the second convolution mode. Even if the target convolution mode corresponding to batch k+1 is the same, the eighth transaction may not be packaged into batch k+1 because the number of transactions in the transaction pool corresponding to the second convolution mode is large. Therefore, the batch to which the eighth transaction actually belongs may not be batch k+1, and it may actually be packaged into a second batch whose batch number is greater than k. However, in the embodiments of this specification, for the convenience of description, the second batch will still be described as batch k+1 for example.
当第八交易被Sequencer打包到第二batch例如batch k+1后,第二区块链系统可以接着执行如下步骤S1215,执行第八交易,实现:根据资源转移份额,从属于第二卷叠模式并与中继账户对应的第二中继子账户,向属于第二卷叠模式并与第二账户对应的第二子账户转移第二目标资源。After the eighth transaction is packaged into the second batch, for example, batch k+1, by the Sequencer, the second blockchain system may then execute the following step S1215 to execute the eighth transaction, thereby realizing: according to the resource transfer share, the second target resource is transferred from the second relay sub-account belonging to the second cascading mode and corresponding to the relay account to the second sub-account belonging to the second cascading mode and corresponding to the second account.
Sequencer执行第八交易的过程中,可以首先确定出属于第二卷叠模式并与第二账户对应的第二子账户,以及属于第二卷叠模式并与中继账户对应的第二中继子账户。Sequencer确定第二子账户和第二中继子账户的方式,相同于确定第一子账户和第一中继子账户的方式,例如包括前文所述的派生计算或者映射关系表等方式,此处不再赘述。During the process of executing the eighth transaction, the Sequencer may first determine the second sub-account that belongs to the second folding mode and corresponds to the second account, and the second relay sub-account that belongs to the second folding mode and corresponds to the relay account. The manner in which the Sequencer determines the second sub-account and the second relay sub-account is the same as the manner in which the first sub-account and the first relay sub-account are determined, such as the derivative calculation or mapping relationship table described above, which will not be described in detail here.
Sequencer执行第八交易的过程中,例如可以在确定出属于TEE-Rollup并与账户A2对应的第二子账户是账户TEE-A2,确定出属于TEE-Rollup并与账户A对应的第二中继子账户是账户TEE-AA后,可根据资源转移份额,从账户TEE-AA向账户TEE-A2转移第二目标资源。During the process of Sequencer executing the eighth transaction, for example, after determining that the second subaccount belonging to TEE-Rollup and corresponding to account A2 is account TEE-A2, and determining that the second relay subaccount belonging to TEE-Rollup and corresponding to account A is account TEE-AA, the second target resource can be transferred from account TEE-AA to account TEE-A2 according to the resource transfer share.
Sequencer完成执行属于第二batch例如batch k+1的多个交易后,Sequencer则可以获得batch k+1所对应的前状态根、后状态根、batch序号k+1、该多个交易组成的交易序列等卷叠数据。类似于batch k,这里的前状态根指的是batch k+1中的多个交易被执行前,第二区块链系统的世界状态所对应的状态根;后状态根指的是batch k+1中的多个交易被执行后,第二区块链系统的世界状态所对应的状态根。进而,接着执行如下步骤S1217,完成提交第二batch。After the sequencer completes the execution of multiple transactions belonging to the second batch, such as batch k+1, the sequencer can obtain the previous state root, the next state root, the batch number k+1, the transaction sequence composed of the multiple transactions, and other concatenated data corresponding to batch k+1. Similar to batch k, the previous state root here refers to the state root corresponding to the world state of the second blockchain system before the multiple transactions in batch k+1 are executed; the next state root refers to the state root corresponding to the world state of the second blockchain system after the multiple transactions in batch k+1 are executed. Then, the following step S1217 is executed to complete the submission of the second batch.
步骤S1217,第二区块链系统向第一区块链系统发送第十一交易,该第十一交易用于调用第一区块链系统所部署RollupContract中的第四方法函数,该第十一交易包括第八交易所属第二batch的卷叠数据。Step S1217: The second blockchain system sends an eleventh transaction to the first blockchain system. The eleventh transaction is used to call the fourth method function in the RollupContract deployed by the first blockchain system. The eleventh transaction includes the rolled-up data of the second batch to which the eighth transaction belongs.
与之相应的,第一区块链系统可以执行步骤S1219,根据第十一交易执行Rollup Contract合约中的第四方法函数,实现对第八交易所属第二batch的卷叠数据进行处理。Correspondingly, the first blockchain system can execute step S1219, execute the fourth method function in the Rollup Contract according to the eleventh transaction, and process the rolled data of the second batch belonging to the eighth transaction.
对第二batch的卷叠数据进行处理的过程,相似于处理第一batch的卷叠数据,不再赘述。The process of processing the warped data of the second batch is similar to the process of processing the warped data of the first batch, and will not be described in detail.
前述方法实施例中,因M种卷叠模式对应相同的由多个batch顺序连接而成的batch链,在后提交的batch通过世界状态的状态根实现绑定,如果在先提交的位置相对靠前的batch因故回滚,则在后提交的位置相对靠后的batch必然需要回滚,因此无 需等待在先提交的batch已进入不可更改状态后才在该batch链中继续提交新的batch。In the above method embodiment, since the M types of concatenation modes correspond to the same batch chain formed by sequentially connecting multiple batches, the batch submitted later is bound through the state root of the world state. If the batch submitted earlier and at a relatively earlier position is rolled back for some reason, the batch submitted later and at a relatively later position must be rolled back. Therefore, there is no need to You need to wait until the previously submitted batch has entered an unchangeable state before submitting a new batch in the batch chain.
与之相应的,第七交易所属第一batch通过第九交易提交到第一区块链系统之后,第二区块链系统无需等待第一batch进入不可更改状态,即可继续在位于第一batch之后的某个第二batch中,完成执行与第七交易对应的第八交易,进而完成第七交易期望完成的资源转移事务,有利于在第二区块链系统中按照用户的期望快速的完成转移。Correspondingly, after the first batch to which the seventh transaction belongs is submitted to the first blockchain system through the ninth transaction, the second blockchain system can continue to execute the eighth transaction corresponding to the seventh transaction in a second batch located after the first batch without waiting for the first batch to enter an unchangeable state, thereby completing the resource transfer transaction that the seventh transaction expects to complete, which is conducive to quickly completing the transfer in the second blockchain system as expected by the user.
然而参照前文示例性描述的ZK-Rollup机制以及TEE-Rollup机制,第二区块链系统在完成向第一区块链系统提交相应batch之后,还需要向第一区块链系统提交该batch对应的证明数据。而且,还可能发生如下情况:第七交易所属第一batch已进入不可更改状态后,第八交易因某些原因而导致未能被成功执行,甚至因某些原因而导致并未成功生成与第七交易对应的第八交易,此种情况下则可能导致第七交易期望完成的资源转移事务并未被准确完成。However, referring to the ZK-Rollup mechanism and TEE-Rollup mechanism described in the previous example, after the second blockchain system completes submitting the corresponding batch to the first blockchain system, it also needs to submit the proof data corresponding to the batch to the first blockchain system. In addition, the following situation may also occur: after the first batch to which the seventh transaction belongs has entered an unchangeable state, the eighth transaction fails to be successfully executed for some reason, or even fails to successfully generate the eighth transaction corresponding to the seventh transaction for some reason. In this case, the resource transfer transaction expected to be completed by the seventh transaction may not be completed accurately.
鉴于此,在前述步骤S1201~步骤S1219的基础上,第一区块链系统和第二区块链系统还可以联合执行如下方法步骤S1221~步骤S1227。In view of this, on the basis of the aforementioned steps S1201 to S1219, the first blockchain system and the second blockchain system may also jointly execute the following method steps S1221 to S1227.
步骤S1221,第二区块链系统通过与第一卷叠模式对应的第一证明器,向第一区块链系统发送第十交易,第十交易用于调用第一区块链系统所部署Rollup Contract中的第五方法函数,第十交易中包括第一卷叠模式和第一batch对应的第一证明数据。In step S1221, the second blockchain system sends the tenth transaction to the first blockchain system through the first prover corresponding to the first rollup mode. The tenth transaction is used to call the fifth method function in the Rollup Contract deployed by the first blockchain system. The tenth transaction includes the first proof data corresponding to the first rollup mode and the first batch.
第一证明数据的数据结构可以参见前文有关Rollup机制的描述,此处不再赘述。The data structure of the first proof data can be found in the previous description of the Rollup mechanism and will not be repeated here.
步骤S1223,第一区块链系统根据第十交易执行第五方法函数,实现:根据与第一卷叠模式对应的验证方法,利用第一证明数据验证第一batch中的多个交易是否正确执行,并在验证通过的情况下生成与第七交易相对应的资产待转移事件。Step S1223, the first blockchain system executes the fifth method function according to the tenth transaction, to achieve: according to the verification method corresponding to the first roll-up mode, using the first proof data to verify whether the multiple transactions in the first batch are executed correctly, and generating an asset transfer event corresponding to the seventh transaction if the verification passes.
当第一卷叠模式包括ZK-Rollup模式时,Rollup Contract中的第五方法函数例如可以根据第十交易中所包括的ZK-Rollup,合约内调用ZK-Rollup所对应的验证方法ZK verifier,通过ZK verifier来处理第十交易中所包括的第一证明数据,完成验证第一batch中的多个交易是否正确执行。如果验证通过则第一batch进入不可更改状态;除此之外,第五方法函数自身或者通过合约内调用Bridge Contract,实现对某些特定数据格式的交易生成资产待转移事件,以及对某些特定数据格式的交易生成资产转移完成事件。When the first rollup mode includes the ZK-Rollup mode, the fifth method function in the Rollup Contract can, for example, call the verification method ZK verifier corresponding to the ZK-Rollup in the contract according to the ZK-Rollup included in the tenth transaction, and process the first proof data included in the tenth transaction through the ZK verifier to complete the verification of whether the multiple transactions in the first batch are correctly executed. If the verification is passed, the first batch enters an unchangeable state; in addition, the fifth method function itself or by calling the Bridge Contract in the contract can realize the generation of asset pending transfer events for transactions in certain specific data formats, and the generation of asset transfer completion events for transactions in certain specific data formats.
在一种示例性的规则中,如果一个交易中From字段下的账户并非中继账户,而且FR字段和TR字段所包括的卷叠模式不同,则可以对该交易生成资产待转移事件;如果一个交易中From字段下的账户是中继账户,则可以对该交易生成资产转移完成事件。基于该示例性的规则以及前述第七交易的数据结构,不难理解可以对第七交易生成资产待转移事件。In an exemplary rule, if the account under the From field in a transaction is not a relay account, and the FR field and the TR field have different wrapping modes, an asset pending transfer event can be generated for the transaction; if the account under the From field in a transaction is a relay account, an asset transfer completion event can be generated for the transaction. Based on this exemplary rule and the data structure of the seventh transaction, it is not difficult to understand that an asset pending transfer event can be generated for the seventh transaction.
Bridge Contract中还可以维护允许消费的事件集合。对于资产待转移事件,可以通过第五方法函数进行合约内调用,或者Bridge Contract可以通过启用对应的事件监听机制,最终实现将资产待转移事件加入到Bridge Contract中维护的事件集合中。The Bridge Contract can also maintain a collection of events that are allowed to be consumed. For asset transfer events, the fifth method function can be used to call the contract, or the Bridge Contract can enable the corresponding event monitoring mechanism to finally add the asset transfer event to the event collection maintained in the Bridge Contract.
典型示例中,参见图14所示,对与某个交易对应的资产待转移事件,Topic字段下通过字段值E1来指示该事件属于资产待转移事件。除此之外还可以在该资产待转移事件的Data字段下包括:子字段From,用于存放对应交易From字段下的账户;子字段To,用于存放对应交易中To字段下的账户;子字段FR,用于存放对应交易中FR 字段下的卷叠模式;子字段TR,用于存放对应交易中TR字段下的卷叠模式;以及,子字段FE,用于存放对应交易中Data字段下所包括的资源转移份额。In a typical example, as shown in Figure 14, for an asset pending transfer event corresponding to a transaction, the Topic field uses the field value E1 to indicate that the event belongs to an asset pending transfer event. In addition, the Data field of the asset pending transfer event may include: a subfield From, which is used to store the account under the From field of the corresponding transaction; a subfield To, which is used to store the account under the To field of the corresponding transaction; a subfield FR, which is used to store the FR field of the corresponding transaction. The subfield TR is used to store the folding mode under the TR field in the corresponding transaction; and the subfield FE is used to store the resource transfer share included in the Data field in the corresponding transaction.
参见图14所示,对与某个交易对应的资产转移完成事件,Topic字段下通过字段值E2来指示该事件属于资产转移完成事件。除此之外还可以在该资产转移完成事件的Data字段下包括:子字段To,用于存放对应交易中To字段下的账户;子字段TR,用于存放对应交易中TR字段下的卷叠模式;子字段FE,用于存放对应交易中Data字段下所包括的资源转移份额。As shown in FIG14 , for an asset transfer completion event corresponding to a transaction, the Topic field uses the field value E2 to indicate that the event belongs to an asset transfer completion event. In addition, the Data field of the asset transfer completion event may include: a subfield To, which is used to store the account under the To field in the corresponding transaction; a subfield TR, which is used to store the rollover mode under the TR field in the corresponding transaction; and a subfield FE, which is used to store the resource transfer share included in the Data field in the corresponding transaction.
资产转移完成事件用于支持Bridge Contract将其与事件集合中的资产待转移事件进行匹配,以便确认已完成资产待转移事件所对应的交易期望执行的资产转移事务。例如请继续参见图14所示的资产转移完成事件和资产待转移事件,如果通过两个事件的Data字段进行匹配发现,其各自的Data字段所包括的子字段中:子字段To字段下的账户相同、子字段TR字段下的卷叠模式相同,并且FE字段下所包括的资源转移份额均相同,则匹配成功。The asset transfer completion event is used to support Bridge Contract to match it with the asset pending transfer event in the event set, so as to confirm the asset transfer transaction that the transaction corresponding to the asset pending transfer event has completed. For example, please continue to refer to the asset transfer completion event and the asset pending transfer event shown in Figure 14. If the Data fields of the two events are matched and it is found that the subfields included in their respective Data fields are: the accounts under the subfield To field are the same, the folding mode under the subfield TR field is the same, and the resource transfer shares included under the FE field are the same, then the match is successful.
步骤S1225,第二区块链系统通过与第二卷叠模式对应的第二证明器,向第一区块链系统发送第十二交易,第十二交易用于调用第一区块链系统所部署Rollup Contract中的第五方法函数,第十二交易中包括第二卷叠模式和第二batch对应的第二证明数据。Step S1225: The second blockchain system sends the twelfth transaction to the first blockchain system through the second prover corresponding to the second rolling mode. The twelfth transaction is used to call the fifth method function in the Rollup Contract deployed by the first blockchain system. The twelfth transaction includes the second proof data corresponding to the second rolling mode and the second batch.
第二证明数据的数据结构可以参见前文有关Rollup机制的描述,此处不再赘述。The data structure of the second proof data can be found in the previous description of the Rollup mechanism and will not be repeated here.
步骤S1227,第一区块链系统根据第十二交易执行第五方法函数,实现:根据与第二卷叠模式对应的验证方法,利用第一证明数据验证第一batch中的多个交易是否正确执行,并在验证通过的情况下生成与第八交易相对应的资产转移完成事件。Step S1227, the first blockchain system executes the fifth method function according to the twelfth transaction, to achieve: according to the verification method corresponding to the second roll-up mode, using the first proof data to verify whether the multiple transactions in the first batch are executed correctly, and generating an asset transfer completion event corresponding to the eighth transaction if the verification passes.
当第二卷叠模式包括TEE-Rollup模式时,Rollup Contract中的第五方法函数例如可以根据第十二交易中所包括的TEE-Rollup,合约内调用TEE-Rollup所对应的验证方法TEE verifier,通过TEE verifier来处理第十二交易中所包括的第二证明数据,完成验证第二batch中的多个交易是否正确执行。如果验证通过则第二batch进入不可更改状态;同时,第五方法函数自身,或者通过合约内调用Bridge Contract,实现对某些特定数据格式的交易生成资产待转移事件,以及对某些特定数据格式的交易生成资产转移完成事件。When the second rollup mode includes the TEE-Rollup mode, the fifth method function in the Rollup Contract can, for example, call the verification method TEE verifier corresponding to the TEE-Rollup in the contract according to the TEE-Rollup included in the twelfth transaction, and process the second proof data included in the twelfth transaction through the TEE verifier to complete the verification of whether the multiple transactions in the second batch are correctly executed. If the verification is passed, the second batch enters an unchangeable state; at the same time, the fifth method function itself, or by calling the Bridge Contract in the contract, generates asset pending transfer events for transactions in certain specific data formats, and generates asset transfer completion events for transactions in certain specific data formats.
参照前述步骤S1223下的内容,对第八交易生成的资产转移完成事件,可以用于消费Bridge Contrac维护的事件集合中,与第七交易对应的资产待转移事件,从而确认第七交易期望完成的事务被成功执行。当第七交易被成功执行且第八交易被成功执行的情况下,则可以对应生成图14中所示的资产待转移事件和资产转移完成事件,该两个事件将会成功匹配。Referring to the content under the aforementioned step S1223, the asset transfer completion event generated for the eighth transaction can be used to consume the asset pending transfer event corresponding to the seventh transaction in the event set maintained by Bridge Contrac, thereby confirming that the transaction expected to be completed by the seventh transaction is successfully executed. When the seventh transaction is successfully executed and the eighth transaction is successfully executed, the asset pending transfer event and the asset transfer completion event shown in Figure 14 can be generated accordingly, and the two events will be successfully matched.
通过前述步骤S1221~S1227,对于前文所述第七交易被成功执行而第八交易未被成功执行的情况,事件集合中与第七交易对应的资产待转移事件无法被消费,管理成员可以通过查询事件集合,确认第七交易期望完成的资源转移事务未被成功执行,并基于第七交易对应的资产待转移事件,向属于第一卷叠模式并与第一账户对应的子账户,返还相应第二目标资源。Through the aforementioned steps S1221 to S1227, for the situation in which the seventh transaction is successfully executed but the eighth transaction is not successfully executed as mentioned above, the asset pending transfer event corresponding to the seventh transaction in the event set cannot be consumed, and the management member can confirm that the resource transfer transaction expected to be completed by the seventh transaction is not successfully executed by querying the event set, and based on the asset pending transfer event corresponding to the seventh transaction, return the corresponding second target resource to the sub-account belonging to the first cascading mode and corresponding to the first account.
前述方法步骤S1201~步骤S1227所描述的技术方案中,主要描述的是从属于第一 卷叠模式并与第一账户对应的第一子账户,向属于第二卷叠模式(不同于第一卷叠模式)并与第二账户对应的第二子账户转移资源的过程。然而在部分技术场景中,可能存在某些交易的FR字段和TR字段包括相同卷叠模式,此时可以通过其它方式完成该交易期望完成的事务。The technical solutions described in the above method steps S1201 to S1227 mainly describe the following aspects: The process of transferring resources from a first sub-account in a rollover mode and corresponding to a first account to a second sub-account in a second rollover mode (different from the first rollover mode) and corresponding to a second account. However, in some technical scenarios, the FR field and the TR field of some transactions may include the same rollover mode. In this case, the transaction that is expected to be completed can be completed by other means.
在一种可能的实施方式中,第二区块链系统可能接收到第十三交易,第十三交易的发送方字段和接收方字段分别包括第一账户和第二账户,第十三交易中还包括资源转移份额、与发送方字段对应的第一卷叠模式和与接收方字段对应的第一卷叠模式;此种情况下,当第二区块链系统将第十三交易打包到与第一卷叠模式对应的某个batch例如第四batch后,对第十三交易执行时,可以直接根据资源转移份额,从属于第一卷叠模式并与第一账户对应的第一子账户,向属于第一卷叠模式并与第二账户对应的第三子账户转移第二目标资源。In a possible implementation, the second blockchain system may receive the thirteenth transaction, the sender field and the receiver field of the thirteenth transaction include the first account and the second account respectively, and the thirteenth transaction also includes a resource transfer share, a first roll-up mode corresponding to the sender field, and a first roll-up mode corresponding to the receiver field; in this case, after the second blockchain system packages the thirteenth transaction into a batch corresponding to the first roll-up mode, such as the fourth batch, when executing the thirteenth transaction, the second target resource can be directly transferred from the first sub-account belonging to the first roll-up mode and corresponding to the first account to the third sub-account belonging to the first roll-up mode and corresponding to the second account according to the resource transfer share.
与之相应的,当第四batch通过第四方法函数被提交到第一区块链系统时,以及第四batch的证明数据通过第五方法函数提交到第一区块链系统时,均不需要生成相应资产转移事件。Correspondingly, when the fourth batch is submitted to the first blockchain system through the fourth method function, and when the proof data of the fourth batch is submitted to the first blockchain system through the fifth method function, there is no need to generate a corresponding asset transfer event.
与前述方法实施例基于相同的构思,本说明书实施例中还提供了第二区块链系统,所述第二区块链系统支持M种卷叠模式,所述第二区块链系统中包括打包交易batch链,所述batch链中包括顺序连接的多个batch。所述第二区块链相同包括:接收器,配置为接收第七交易,所述第七交易的发送方字段和接收方字段分别包括第一账户和第二账户,所述第七交易中还包括资源转移份额、与所述发送方字段对应的第一卷叠模式和与所述接收方字段对应的第二卷叠模式;排序器,配置为将所述第七交易打包到所述batch链中的第一batch,所述第一batch与所述第一卷叠模式对应,执行所述第七交易,实现:根据所述资源转移份额,从属于所述第一卷叠模式并与所述第一账户对应的第一子账户,向属于所述第一卷叠模式并与中继账户对应的第一中继子账户转移第二目标资源,并生成跨模式转账事件;共享桥,配置为根据所述跨模式转账事件,生成第八交易,所述第八交易的发送方字段和接收方字段分别包括所述中继账户和所述第二账户,所述第八交易中还包括所述资源转移份额和所述第二卷叠模式;所述排序器,配置为将所述第二交易打包到所述batch链中的第二batch,所述第二batch与所述第二卷叠模式对应,执行所述第八交易,实现:根据所述资源转移份额,从属于所述第二卷叠模式并与所述中继账户对应的第二中继子账户,向属于所述第二卷叠模式并与所述第二账户对应的第二子账户转移第二目标资源。Based on the same concept as the aforementioned method embodiment, a second blockchain system is also provided in the embodiment of the specification, wherein the second blockchain system supports M types of cascading modes, and the second blockchain system includes a packaged transaction batch chain, wherein the batch chain includes multiple batches connected in sequence. The second blockchain also includes: a receiver configured to receive a seventh transaction, wherein the sender field and the receiver field of the seventh transaction include a first account and a second account respectively, and the seventh transaction also includes a resource transfer share, a first cascading mode corresponding to the sender field, and a second cascading mode corresponding to the receiver field; a sorter configured to package the seventh transaction into the first batch in the batch chain, wherein the first batch corresponds to the first cascading mode, and execute the seventh transaction to achieve: according to the resource transfer share, the second target is transferred from the first subaccount belonging to the first cascading mode and corresponding to the first account to the first relay subaccount belonging to the first cascading mode and corresponding to the relay account resources, and generates a cross-mode transfer event; a shared bridge is configured to generate an eighth transaction according to the cross-mode transfer event, the sender field and the receiver field of the eighth transaction respectively include the relay account and the second account, and the eighth transaction also includes the resource transfer share and the second cascading mode; the sorter is configured to package the second transaction into a second batch in the batch chain, the second batch corresponds to the second cascading mode, execute the eighth transaction, and realize: according to the resource transfer share, the second relay sub-account belonging to the second cascading mode and corresponding to the relay account transfers the second target resource to the second sub-account belonging to the second cascading mode and corresponding to the second account.
本说明书实施例中还提供了一种计算机可读存储介质,其上存储有计算机程序/指令,当所述计算机程序/指令在计算机中执行时,令计算机执行前述各个实施例中由第一区块链相同或者第二区块链系统所执行的方法步骤。A computer-readable storage medium is also provided in an embodiment of the present specification, on which a computer program/instruction is stored. When the computer program/instruction is executed in a computer, the computer is caused to execute the method steps performed by the first blockchain system or the second blockchain system in the aforementioned embodiments.
本说明书实施例中还提供了一种计算设备,包括存储器和处理器,所述存储器中存储有计算机程序/指令,所述处理器执行所述计算机程序/指令时,实现前述各个实施例中由第一区块链相同或者第二区块链系统所执行的方法步骤。A computing device is also provided in an embodiment of the present specification, including a memory and a processor, wherein the memory stores a computer program/instruction, and when the processor executes the computer program/instruction, the method steps performed by the first blockchain system or the second blockchain system in the aforementioned embodiments are implemented.
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电 路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。In the 1990s, improvements to a technology could be clearly divided into hardware improvements (for example, improvements to circuit structures such as diodes, transistors, switches, etc.) and software improvements (improvements to method flows). However, with the development of technology, many improvements to method flows today can be considered hardware and software improvements. Direct improvement of the circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer readable medium storing a computer readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that in addition to implementing the controller in a purely computer readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the means for implementing various functions included therein may also be considered as a structure within the hardware component. Or even, the means for implementing various functions may be considered as both a software module for implementing the method and a structure within the hardware component.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本申请不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, the present application does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
虽然本说明书一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执 行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。Although one or more embodiments of this specification provide method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is only one way of executing the steps among many steps, and does not represent the only execution order. When the actual device or terminal product is executed, it can be executed in the order of the method shown in the embodiments or the drawings or in parallel. The terms "include", "comprising" or any other variation thereof are intended to cover non-exclusive inclusion, so that a process, method, product or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, product or device. In the absence of further restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device comprising the elements. For example, if the words first, second, etc. are used to represent names, they do not represent any particular order.
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and/or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
本发明是参照根据本发明实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to the flowchart and/or block diagram of the method, device (system), and computer program product according to the embodiment of the present invention. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the process and/or box in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读 存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only ROM, EEPROM, flash memory or other memory technology, CD-ROM, DVD or other optical storage, magnetic cassettes, magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, in the absence of mutual contradiction, a person skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
以上所述仅为本说明书一个或多个实施例的实施例而已,并不用于限制本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求范围之内。 The above description is only an example of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. For those skilled in the art, one or more embodiments of the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims.
Claims (16)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311869835.6A CN117745284A (en) | 2023-12-29 | 2023-12-29 | Blockchain system and its resource management method |
| CN202311869835.6 | 2023-12-29 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025139339A1 true WO2025139339A1 (en) | 2025-07-03 |
Family
ID=90279280
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/128765 Pending WO2025139339A1 (en) | 2023-12-29 | 2024-10-31 | Blockchain system and resource management method thereof |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN117745284A (en) |
| WO (1) | WO2025139339A1 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117745284A (en) * | 2023-12-29 | 2024-03-22 | 蚂蚁区块链科技(上海)有限公司 | Blockchain system and its resource management method |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112862612A (en) * | 2019-06-28 | 2021-05-28 | 创新先进技术有限公司 | Method and device for sending resources in cross-link mode |
| CN113269543A (en) * | 2021-05-24 | 2021-08-17 | 缀初网络技术(上海)有限公司 | Multilayer mixed transaction capacity expansion system and method for block chain |
| CN114529412A (en) * | 2022-02-23 | 2022-05-24 | 支付宝(杭州)信息技术有限公司 | Resource processing method and device based on block chain |
| CN117745284A (en) * | 2023-12-29 | 2024-03-22 | 蚂蚁区块链科技(上海)有限公司 | Blockchain system and its resource management method |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11336451B2 (en) * | 2019-06-28 | 2022-05-17 | Advanced New Technologies Co., Ltd. | Cross-blockchain resource transmission |
| CN114780640B (en) * | 2022-04-28 | 2025-07-29 | 蚂蚁区块链科技(上海)有限公司 | Data processing method in block chain and block chain link point equipment |
| CN115797070B (en) * | 2023-01-10 | 2023-09-15 | 中山大学 | A blockchain transaction method, device and system based on intermediary account incentives |
| KR102564233B1 (en) * | 2023-01-19 | 2023-08-08 | 주식회사 온더 | Blockchain network system expanded based on optimism bedrock and operation method thereof |
-
2023
- 2023-12-29 CN CN202311869835.6A patent/CN117745284A/en active Pending
-
2024
- 2024-10-31 WO PCT/CN2024/128765 patent/WO2025139339A1/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112862612A (en) * | 2019-06-28 | 2021-05-28 | 创新先进技术有限公司 | Method and device for sending resources in cross-link mode |
| CN113269543A (en) * | 2021-05-24 | 2021-08-17 | 缀初网络技术(上海)有限公司 | Multilayer mixed transaction capacity expansion system and method for block chain |
| CN114529412A (en) * | 2022-02-23 | 2022-05-24 | 支付宝(杭州)信息技术有限公司 | Resource processing method and device based on block chain |
| CN117745284A (en) * | 2023-12-29 | 2024-03-22 | 蚂蚁区块链科技(上海)有限公司 | Blockchain system and its resource management method |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117745284A (en) | 2024-03-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110602148B (en) | A method and device for generating a state tree of a block and verifying data on the chain | |
| US20210295321A1 (en) | Methods for decentralized digital asset transfer and smart contract state transition | |
| Chepurnoy et al. | Edrax: A cryptocurrency with stateless transaction validation | |
| CN112261159B (en) | Method and system for executing cross-slice transaction, main chain node and target slicing node | |
| CN112651724A (en) | Cross-chain interaction method, device and system | |
| CN110851537A (en) | Consensus method based on block chain fragmentation technology | |
| CN113259478B (en) | Method and device for executing transaction in blockchain system and blockchain system | |
| WO2025139339A1 (en) | Blockchain system and resource management method thereof | |
| CN111080298B (en) | Block generation and transaction verification method suitable for energy block chain | |
| CN112579261A (en) | Method and system for quitting cross-fragment transaction, main chain node and target fragment node | |
| WO2025139342A1 (en) | Blockchain system management method and blockchain node | |
| WO2025103147A1 (en) | Method for implementing rollup of layer-2 network, and layer-2 network | |
| CN113034137B (en) | Blockchain-based data processing method, device and related equipment | |
| WO2025103146A1 (en) | Method for implementing layer 2 network rollup, layer 2 network, and prover | |
| JP7584110B2 (en) | Blockchain system and method using a non-competitive consensus algorithm and microchain architecture to ensure transaction processing speed, scalability, and security useful for commercial services | |
| WO2025139340A1 (en) | Resource management method for blockchain system, blockchain node, and blockchain system | |
| WO2025139341A1 (en) | Resource management methods for blockchain system, and blockchain node and blockchain system | |
| WO2024244340A1 (en) | Transaction execution method in blockchain and blockchain node | |
| Rybakken et al. | Intmax2: A ZK-rollup with Minimal Onchain Data and Computation Costs Featuring Decentralized Aggregators | |
| WO2024198450A1 (en) | Method for deploying contract in blockchain, and blockchain node | |
| CN117745282B (en) | Resource management method of blockchain system, blockchain node and blockchain system | |
| CN114386967B (en) | Cross-chain asset transfer method, computer device, and storage medium | |
| WO2025139343A1 (en) | Blockchain system management method and blockchain node | |
| CN112269423B (en) | Method for locking global clock in blockchain system and blockchain system | |
| CN112261161B (en) | Method for locking partitioned blocks in block chain system and block chain system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24910277 Country of ref document: EP Kind code of ref document: A1 |