Techniques for executing acceleration instructions in blockchain system
By introducing accelerated instructions and virtual machine running smart contracts into the blockchain network, the high fuel fee problem caused by the operation of complex algorithms in the blockchain system is solved, and the fuel fee reduction and service expansion are achieved.
Patent Information
- Application Number
- CN202311589916.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-11-08
- Filing Date
- 2023-11-24
- Publication Date
- 2025-05-09
AI Technical Summary
Running complex algorithms such as zero-knowledge proof, homomorphic encryption, and deep learning in blockchain systems leads to high fuel costs, limiting the expansion of services and the application of new algorithms.
By introducing acceleration instructions into the blockchain network, using a virtual machine to run smart contracts, and calling the related second smart contract to request child nodes or side chain nodes to run acceleration instructions-related algorithms, thereby reducing fuel costs.
It realizes the reduction in fuel fees when running smart contracts in blockchain systems, reduces costs to users, improves the price competitiveness of services, and supports the application of more complex algorithms.
Smart Images

Figure CN119960898A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a technology for executing accelerated instructions in a blockchain system. Background Art
[0002] Smart contracts are a function that allows you to run programs on the blockchain. If you run a smart contract on the blockchain, you will need to pay a gas fee. The gas fee varies depending on what instructions are run. The more instructions you run, the more gas fees you will have to pay.
[0003] If you want to provide blockchain services through smart contracts, it is extremely important to reduce gas fees. Gas fees are ultimately paid by the end user, so if the gas fee is too high, the price competitiveness will decrease, making it difficult to be selected by users.
[0004] Recently, the development of services using zero-knowledge proofs has been in full swing. The zero-knowledge proof services developed so far have problems with complex algorithms and high fuel costs. Not only zero-knowledge proofs, but also homomorphic encryption and deep learning are algorithms that have attracted much attention. When these algorithms are run in the blockchain, high fuel costs are generated, and high fuel costs have become a huge obstacle to expanding services. In addition, there is a possibility that new algorithms with higher fuel costs will be introduced in the future. Summary of the invention
[0005] Technical issues
[0006] Therefore, the present disclosure aims to disclose a solution for solving the aforementioned problems.
[0007] Technical Solution
[0008] In order to solve the aforementioned technical problems, a method for running an acceleration instruction in a blockchain system is disclosed. The method may include: a step in which a virtual machine on a blockchain network runs a first smart contract; a step in which the first smart contract calls a second smart contract related to the acceleration instruction; a step in which the second smart contract requests one or more child nodes to run a first algorithm related to the acceleration instruction; a step in which the second smart contract obtains the running result of the first algorithm from one or more child nodes; and a step in which the second smart contract returns the running result of the first algorithm to the first smart contract.
[0009] A first smart contract may include instructions to call a second smart contract.
[0010] The transaction between the second smart contract and the one or more sub-nodes may be an off-chain transaction of the blockchain network.
[0011] The one or more sub-nodes may include one or more virtual machines for running the first algorithm, and the one or more virtual machines may provide the running results of the first algorithm to the second smart contract.
[0012] The second smart contract can return the running results of the first algorithm provided by the largest number of child nodes to the first smart contract.
[0013] More than one child node can deposit assets. For a child node whose running result of the first algorithm is wrong among more than one child node, the deposited assets will be slashed.
[0014] The one or more child nodes may request multiple side chain nodes constituting one or more side chains to run the first algorithm, the multiple side chain nodes may include virtual machines for running the first algorithm, and the one or more child nodes may obtain the running results of the first algorithm from the multiple side chain nodes.
[0015] Transactions related to the execution of the first algorithm may be recorded in the one or more side chains.
[0016] The second smart contract can return the running result of the first algorithm provided by the largest number of side chain nodes to the first smart contract.
[0017] More than one side chain node can deposit assets. For side chain nodes with errors in the running results of the first algorithm among more than one side chain nodes, the deposited assets will be slashed.
[0018] In order to solve the above technical problems, a blockchain system for running acceleration instructions is disclosed. The blockchain system may include: a blockchain network, which stores one or more transactions in one or more blocks; one or more virtual machines, which run instructions related to the one or more transactions; and one or more sub-nodes, which are connected to the blockchain network; wherein the virtual machine on the blockchain network can run a first smart contract, the first smart contract can call a second smart contract related to the acceleration instruction, the second smart contract can request one or more sub-nodes to run a first algorithm related to the acceleration instruction, the second smart contract can obtain the running result of the first algorithm from one or more sub-nodes, and the second smart contract can return the running result of the first algorithm to the first smart contract.
[0019] Beneficial Effects
[0020] According to a disclosure of this specification, fuel fees can be reduced when running smart contracts in a blockchain system. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a diagram showing an example of the blockchain system disclosed in the present invention.
[0022] Figure 2 This is a diagram showing an example of the blockchain system disclosed in the present invention.
[0023] Figure 3 This is an example of a flowchart of a method for executing acceleration instructions disclosed herein.
[0024] Figure 4 A diagram describing an example of asset confiscation in the blockchain system of the present disclosure.
[0025] Figure 5 This is an example of a flowchart of a method for executing acceleration instructions disclosed herein.
[0026] Figure 6 A diagram describing an example of asset confiscation in the blockchain system of the present disclosure.
[0027] Figure 7 A block diagram of a computer device of the present disclosure. DETAILED DESCRIPTION
[0028] Specific structural and procedural descriptions are provided for the embodiments based on the concepts of the present disclosure disclosed in this specification or application. This is merely illustrative for the purpose of describing the embodiments based on the concepts of the present disclosure. The embodiments based on the concepts of the present disclosure may be implemented in various forms and shall not be construed as being limited to the embodiments described in this specification or application.
[0029] The embodiments based on the concepts of the present disclosure may be subjected to various changes and may have various forms, so specific embodiments will be exemplified in the drawings and described in detail in this specification or application. However, this is not intended to limit the embodiments based on the concepts of the present disclosure to specific disclosed forms, and should be understood to include all changes, equivalents and even substitutes included in the ideas and technical scope of the present disclosure.
[0030] The terms "first" and "second" can be used to describe various components, but the components shall not be limited by the terms. The terms are only used to distinguish one component from other components. For example, within the scope of the rights based on the concept of the present disclosure, the first component can be named as the second component, and similarly, the second component can also be named as the first component.
[0031] When a certain constituent element is mentioned as being “connected” or “connected to” another constituent element, it should be understood that it can be directly connected to or connected to the other constituent element, or other constituent elements may be present in between. On the contrary, when a certain constituent element is mentioned as being “directly connected to” or “directly connected to” another constituent element, it should be understood that other constituent elements do not exist in between. Other expressions of the relationship between constituent elements, namely, “between”, “directly between”, “adjacent to” and “directly adjacent to”, etc., should also be interpreted in the same way.
[0032] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the meaning of the present disclosure. Unless the context clearly indicates otherwise, singular expressions include plural expressions. In this specification, terms such as "including" or "having" should be understood to specify the presence of the described features, numbers, steps, actions, constituent elements, parts or combinations thereof, and do not preclude the presence or additional possibility of one or more other features or numbers, steps, actions, constituent elements, parts or combinations thereof.
[0033] Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as those generally understood by a person of ordinary skill in the art to which the present disclosure belongs. Terms that are the same as those defined in a commonly used dictionary should be interpreted as having the same meaning as that in the context of the relevant art, and should not be interpreted excessively or excessively as formal meanings unless explicitly defined in this specification.
[0034] In describing the embodiments, descriptions of technical contents that are well known in the technical field to which the present disclosure belongs and are not directly related to the present disclosure are omitted. This is to convey the gist of the present disclosure more clearly without confusion by omitting unnecessary descriptions.
[0035] 1. Acceleration instructions
[0036] Smart contract developers can optimize the algorithm itself to reduce gas costs. Developers can reduce gas costs by reducing the number of instructions that need to be executed according to the algorithm or using instructions with lower gas costs. One way to achieve this through instructions with lower gas costs is to use accelerated instructions for specific operations.
[0037] A typical example is the KECCAK256 instruction of the EVM (Ethereum Virtual Machine). EVM is a virtual machine that runs smart contracts in Ethereum. This virtual machine runs assembly instructions in sequence like a processor. The KECCAK256 instruction is an instruction that executes the hash algorithm commonly used in smart contracts as one instruction. If this instruction is not available, the algorithm must be implemented through basic addition and multiplication instructions. In this case, more fuel fees must be paid than when running through the KECCAK256 instruction. Therefore, if acceleration instructions for executing algorithms with higher fuel costs are added to the EVM, the fuel fees associated with the operation of the corresponding algorithm can be greatly reduced.
[0038] In order to add new instructions to the EVM of the mainnet, all nodes of the blockchain network need to be updated. For most algorithms used in smart contracts, such as hash functions, it is worth updating all nodes. However, as with zero-knowledge proofs, it would be a waste of resources to update all nodes for algorithms that are only used in specific applications. In addition, it would be difficult to update all nodes in order to add acceleration instructions related to new algorithms whenever new algorithms appear in the future.
[0039] 2. Proposed method
[0040] Figure 1 This is a diagram showing an example of a blockchain system disclosed in the present invention.
[0041] In this disclosure, Figure 1 As shown, a side chain consisting of nodes with added acceleration instructions is proposed.
[0042] Reference Figure 1 The blockchain system 10 for running the acceleration instruction may include a plurality of nodes 110 constituting a blockchain network, one or more subnodes (bridges) 210 connected to the blockchain network, and a plurality of sidechain nodes 220 constituting a sidechain network. One or more subnodes 210 may connect the main network and the sidechain of the blockchain network to each other.
[0043] In the present disclosure, an acceleration instruction means an instruction for executing a specific algorithm including multiple instructions. The acceleration instruction can be executed by a virtual machine. When the acceleration instruction is executed, less fuel fee can be paid compared to running the specific algorithm through multiple instructions.
[0044] The sidechain network is independent of the main network, and is connected to the main network through a bridge (sub-node) 210. A virtual machine is provided at all nodes 220 of the sidechain, and the virtual machine has added an instruction that can run a specific algorithm as an instruction.
[0045] The smart contract A of the main network does not use the main network directly, but executes the algorithm F including specific instructions according to the following process.
[0046] (1-1) Smart contract A calls smart contract B on the main network that executes a specific algorithm F.
[0047] (1-2) The called smart contract B requests the bridge 210 to run the algorithm F.
[0048] (1-3) If the bridge 210 generates a transaction on the side chain, the side chain node 220 runs the algorithm F using the acceleration instruction.
[0049] (1-4) Smart contract B of the main network reads the running result from bridge 210 and returns the running result to smart contract A.
[0050] If the same algorithm has been run with the same input, the running result of the corresponding algorithm will be recorded in the side chain, so in step (1-3), the bridge 210 can also directly return the result.
[0051] If the above process is used, there is no need to modify the main network. New acceleration instructions can be added by only updating a few side chain nodes 220 or forming a new side chain.
[0052] In this configuration, fuel costs are incurred between the bridge 210 and the side chain, and the main network needs to pay the additional fuel costs required to run smart contract B. This configuration is effective when the reduction in fuel costs due to the acceleration instruction is greater than the additional costs. It is preferred that when designing a side chain dedicated to the acceleration instruction, the commission of the side chain is set to be lower than that of directly running the acceleration instruction-related algorithm in the main network.
[0053] If the fuel fee paid to the acceleration instruction dedicated sidechain node 220 is too low, there will be no nodes participating in the sidechain. Therefore, even in the acceleration instruction dedicated sidechain, it is preferable to set the payment to be equal to or higher than the main network. This condition can be met when the fuel fee when running algorithm F in the main network is sufficiently large.
[0054] 3. Various implementation methods
[0055] Describe several methods for implementing the proposed approach. There are multiple implementations because there are multiple ways to solve the trust problem. Sidechains can be made up of fewer nodes than the mainnet, which raises the question of trust in the results of operations. The level of trust required will vary depending on the algorithm and application to be accelerated and the gas cost to be saved by the acceleration.
[0056] 3-1. Incentives
[0057] A sidechain is also a blockchain, so even though it is a minority, there are still multiple nodes participating and executing the consensus algorithm. Recently, the Proof-of-stake (PoS) algorithm is being used a lot. In order to participate as a PoS node, you need to deposit assets above a certain amount. If a node has a problem, some or all of the deposited assets will be lost (forfeited). This can give participating nodes an incentive to perform operations honestly.
[0058] A similar approach can be used in the sidechain dedicated to acceleration instructions. Participating nodes can be allowed to deposit assets, and if problems are found in the calculation results of participating nodes, the deposited assets of the corresponding participating nodes can be confiscated. The inputs and results used to perform accelerated calculations are all permanently recorded on the main network and sidechain, so it is possible to confirm who performed abnormal calculations in the future.
[0059] 3-2.Layer 2
[0060] Layer 2 technology is a technology that adds a mechanism to confirm the results of sidechain operations to Layer 1 to ensure trust. By adding verification to the mainnet corresponding to Layer 1, the trust level can be raised to the level of the mainnet. Optimistic Rollup and zk Rollup are the most typical technologies of Layer 2 technology.
[0061] Optimistic Rollup is a method of collecting Layer 2 transactions and uploading the results to the main network, setting a dispute period and performing post-verification during that period. If the problem is confirmed during the dispute period, the node that raised the problem will be rewarded, and the node with the wrong calculation will be punished. Although this method has a small amount of calculation, it takes a long time to determine the calculation result because it requires waiting during the dispute period.
[0062] Zk Rollup is a method of collecting transactions to generate zero-knowledge proofs and upload them to the mainnet. Since the validity can be verified through zero-knowledge proofs, the confirmation time is short, but there is a disadvantage that generating zero-knowledge proofs requires a lot of calculations.
[0063] Layer 2 technology can also be applied to a dedicated sidechain for accelerated instructions. If this technology is used, additional calculations are required, and thus higher rewards are required for participating nodes.
[0064] 3-3. Acceleration Node
[0065] Sidechains and Layer 2 both have the common disadvantage of centralized bridges. Since bridges are centralized, they are relatively weak in security, and a large number of hacker attack victims have been reported.
[0066] Figure 2 This is a diagram showing an example of the blockchain system disclosed in the present invention.
[0067] In order to solve the centralization problem of the bridge and further reduce the commission, a Figure 2 The blockchain system shown.
[0068] In this method, there is no side chain. That is, transactions in the side chain are not stored independently, and the consensus algorithm between the side chain nodes is not executed. Instead, multiple bridges (sub-nodes) 230 are connected to the main network. Among them, the bridge 230 does not play a role in connecting to the side chain, so it is called an acceleration node (sub-node) below. A virtual machine that can run acceleration instructions is set in the acceleration node.
[0069] The mainnet’s smart contract A can run a specific algorithm F according to the following process.
[0070] (2-1) Smart contract A calls smart contract B on the main network that executes algorithm F.
[0071] (2-2) Smart contract B requests acceleration node 230 to execute algorithm F.
[0072] (2-3) After the results appear on each acceleration node 230, smart contract B determines the result through voting and returns it to smart contract A.
[0073] (2-4) If there is an acceleration node 230 that returns a result different from the final result, the deposited assets of the acceleration node 230 with the different result will be confiscated and returned.
[0074] In steps (2-3) and (2-4), the communication between smart contract B and acceleration node 230 is off-chain and not recorded on the chain. Therefore, no fuel fee is incurred. If it is not recorded on the chain, the record cannot be confirmed later. Therefore, for the problematic acceleration node 230, in step (2-4), the penalty is immediately executed after voting.
[0075] According to this process, the centralization problem of the bridge can be solved. In addition, the fuel cost of the side chain is not incurred, and the acceleration node is composed of a simple function, which has the advantage of further reducing the overall fuel cost. In addition, it provides a similar level of trust as the incentives and Layer 2 technology described above. The following compares it with the Ethereum node to describe the reason.
[0076] If you want to participate as an Ethereum node, you need to deposit assets above a certain amount, and if a problem occurs, the assets will be confiscated. In this structure, if you want to participate as an acceleration node, you need to deposit assets, and if a problem occurs, the assets of the corresponding acceleration node will be confiscated. Therefore, the acceleration node is given an incentive to perform operations honestly.
[0077] In Ethereum, a randomly selected node becomes a block proposer and proposes a block candidate, and blocks are generated through voting by different nodes. The block proposer aggregates the voting results. In this method, the mainnet's smart contract B performs functions similar to the block proposer. The participating acceleration nodes only perform verification according to the request of smart contract B. Smart contract B runs in the mainnet, so the trust level of the mainnet can be guaranteed.
[0078] The block proposer of Ethereum collects multiple transactions and selects transactions when proposing a block so as to maximize the benefits. The smart contract B of this method only processes one transaction at a time (for example, algorithm F).
[0079] An Ethereum node is composed of an execution client including an EVM and a consensus client that executes a consensus algorithm. The acceleration node disclosed in the present invention can be composed of an execution client including a virtual machine that can run acceleration instructions and a simplified consensus client. The execution client disclosed in the present invention can only include a virtual machine that can run acceleration instructions. In addition, the consensus client only needs to vote and does not need to keep blocks. Therefore, the operation is performed by a client with a simpler structure than the Ethereum node, thereby further reducing the fuel fee.
[0080] Figure 3 This is an example of a flowchart of a method for executing acceleration instructions disclosed herein.
[0081] Figure 3 The method shown is Figure 1 An example of an accelerated instruction execution method executed by the blockchain network system shown.
[0082] Reference Figure 3 , the virtual machine on the blockchain network can run the first smart contract (step S110). The virtual machine can be driven in one or more nodes 110 constituting the blockchain network. The first smart contract may include an instruction to call the second smart contract.
[0083] The first smart contract may call a second smart contract associated with the acceleration instruction (step S120). The second smart contract may include instructions for running a first algorithm associated with the acceleration instruction.
[0084] The second smart contract may request one or more subnodes 210 to run the first algorithm related to the acceleration instruction (step S130). The one or more subnodes 210 may be connected to the blockchain network. Transactions between the blockchain network and the one or more subnodes 210 are off-chain transactions.
[0085] One or more subnodes 210 may generate transactions related to the first algorithm in the side chain (step S140).
[0086] One or more nodes 220 of the side chain may run the first algorithm through a virtual machine (step S150).
[0087] One or more child nodes 210 may obtain the running result of the first algorithm from the side chain (step S160 ).
[0088] The second smart contract can obtain the running result of the first algorithm from one or more child nodes 210 (step S170).
[0089] The second smart contract may return the running result of the first algorithm to the first smart contract (step S180).
[0090] according to Figure 3 The method shown can run acceleration instructions with less fuel cost by utilizing a side chain dedicated to acceleration instructions.
[0091] Figure 4 A diagram describing an example of asset confiscation in the blockchain system of the present disclosure.
[0092] Figure 4 describe Figure 1 The asset confiscation of sidechain nodes in the blockchain system shown.
[0093] If more than one child node 210 generates transactions related to the first algorithm in the side chain, multiple side chain nodes (A, B, C, D, E, F) 220 can run the first algorithm through a virtual machine.
[0094] Sidechain node A may provide Y as the operation result of the first algorithm, sidechain nodes B to E may provide X as the operation result of the first algorithm, and sidechain node F may provide Z as the operation result of the first algorithm. In this case, the operation result X provided by the most sidechain nodes may be determined as the operation result of the first algorithm.
[0095] For sidechain nodes A and F that provide operation results Y and Z that are different from operation result X, their assets will be confiscated as a penalty. This structure can improve the trust in transactions between multiple sidechain nodes.
[0096] Figure 5 This is an example of a flowchart of a method for executing acceleration instructions disclosed herein.
[0097] Figure 5 The method shown is Figure 2 An example of an accelerated instruction execution method executed by the blockchain network system shown.
[0098] Reference Figure 5, the virtual machine on the blockchain network can run the first smart contract (step S210). The virtual machine can be driven by one or more nodes 110 constituting the blockchain network. The first smart contract may include an instruction to call the second smart contract.
[0099] The first smart contract may call a second smart contract associated with the acceleration instruction (step S220). The second smart contract may include instructions for running a first algorithm associated with the acceleration instruction.
[0100] The second smart contract may request one or more subnodes 230 to run the first algorithm related to the acceleration instruction (step S230). The one or more subnodes 230 may be connected to the blockchain network. Transactions between the blockchain network and the one or more subnodes 230 are off-chain transactions.
[0101] One or more child nodes 230 may utilize the virtual machine to obtain the running result of the first algorithm (step S240 ).
[0102] The second smart contract can obtain the running result of the first algorithm from one or more child nodes 230 (step S250).
[0103] The second smart contract may return the running result of the first algorithm to the first smart contract (step S260).
[0104] according to Figure 5 The method shown can run the acceleration instruction with less fuel cost by utilizing the acceleration instruction dedicated sub-node 230.
[0105] Figure 6 A diagram describing an example of asset confiscation in the blockchain system of the present disclosure.
[0106] Figure 6 describe Figure 2 The asset confiscation of more than one child node 230 in the blockchain system is shown.
[0107] If the second smart contract requests one or more child nodes 230 to run the first algorithm related to the acceleration instruction, the one or more child nodes (A, B, C, D, E, F) 230 can run the first algorithm through the virtual machine.
[0108] The child nodes A to E may provide X as the operation result of the first algorithm, and the child node F may provide Y as the operation result of the first algorithm. In this case, the operation result X provided from the most child nodes may be determined as the operation result of the first algorithm.
[0109] The assets of the child node F that provides an operation result Y different from the operation result X may be confiscated as a penalty. According to this configuration, the reliability of the calculation results of one or more child nodes 230 can be improved.
[0110] Figure 7 A block diagram of a computer device of the present disclosure.
[0111] Figure 1 and Figure 2 The one or more blockchain nodes 110 , the one or more child nodes 210 , the side chain node 220 and the one or more child nodes 230 shown may be implemented by a computer device 300 .
[0112] The computer device 300 may include a memory 310, a processor 320, a communication interface 330, and an input / output interface 340. The memory 310, as a computer-readable recording medium, may include a RAM (random access memory), a ROM (read only memory), and a non-volatile large-capacity recording device such as a disk drive. Among them, a non-volatile large-capacity recording device such as a ROM and a disk drive may also be included in the computer device 300 as an independent permanent storage device different from the memory 310. In addition, an operating system and at least one program code may be stored in the memory 310. Such software components may be loaded into the memory 310 from a computer-readable recording medium independent of the memory 310. Such an independent computer-readable recording medium may include a computer-readable recording medium such as a floppy disk drive, a disk, a tape, a DVD / CD-ROM drive, a memory card, etc. In another embodiment, the software components may also be loaded into the memory 310 through a communication interface 330 that is not a computer-readable recording medium. For example, the software components may be loaded into the memory 310 of the computer device 300 based on a computer program installed from a file received via the network 360 .
[0113] The processor 320 may be configured to perform basic arithmetic, logic, and input / output operations to process instructions of a computer program. Instructions may be provided to the processor 320 by the memory 310 or the communication interface 330. For example, the processor 320 may be configured to execute received instructions according to program codes stored in a recording device such as the memory 310.
[0114] The communication interface 330 may provide a function for the computer device 300 to communicate with other devices through the network 360. As an example, a request or instruction, data, file, etc. generated by the processor 320 of the computer device 300 according to the program code stored in the recording device such as the memory 310 may be transmitted to other devices through the network 360 according to the control of the communication interface 330. Conversely, a signal or instruction, data, file, etc. from other devices may be received by the computer device 300 through the communication interface 330 of the computer device 300 via the network 360. The signal or instruction, data, etc. received through the communication interface 330 may be transmitted to the processor 320 or the memory 310, and the file, etc. may be stored in a storage medium (the above-mentioned permanent storage device) that the computer device 300 may further include.
[0115] The input / output interface 340 may be a means for connecting to an input / output device (I / O device) 350. For example, the input device may include a microphone, a keyboard, or a mouse, and the output device may include a display, a speaker, or other devices. As another example, the input / output interface 340 may also be a means for connecting to a device that integrates the functions required for input and output into one, such as a touch screen. The input / output device 350 may also be configured as one device with the computer device 300.
[0116] In addition, in another embodiment, the computer device 300 may also include Figure 7 However, it is not necessary to clearly show most of the components of the prior art. For example, the computer device 300 can also be implemented to include at least a part of the above-mentioned input and output device 350, or also include other components such as a transceiver, a database, etc.
[0117] The examples of the present disclosure shown in this specification and the drawings are only specific examples disclosed for the purpose of easily describing the technical content of the present disclosure and helping the understanding of the present disclosure, and are not intended to limit the scope of the present invention. It is self-evident to those skilled in the art that other variations may be implemented in addition to the examples described above.
[0118] The claims described in this specification can be combined in various ways. For example, the technical features of the method claims of this specification can be combined and implemented as a device, and the technical features of the device claims of this specification can be combined and implemented as a method. In addition, the technical features of the method claims of this specification and the technical features of the device claims can be combined and implemented as a device, and the technical features of the method claims of this specification and the technical features of the device claims can be combined and implemented as a method.
Claims
1. A method for running an acceleration instruction in a blockchain system, comprising: The virtual machine on the blockchain network runs the first smart contract step; The first smart contract calls a second smart contract associated with the acceleration instruction; The second smart contract requests one or more sub-nodes to execute the steps of the first algorithm associated with the acceleration instruction; The second smart contract obtains the running result of the first algorithm from one or more child nodes; and The second smart contract returns the running result of the first algorithm to the first smart contract.
2. The method according to claim 1, wherein: The first smart contract includes instructions for calling the second smart contract.
3. The method according to claim 1, wherein: The transaction between the second smart contract and the one or more sub-nodes is an off-chain transaction of the blockchain network.
4. The method according to claim 1, wherein: The one or more child nodes include one or more virtual machines for running the first algorithm, One or more virtual machines provide the running result of the first algorithm to the second smart contract.
5. The method according to claim 1, wherein: The second smart contract returns the running result of the first algorithm provided by the largest number of child nodes to the first smart contract.
6. The method according to claim 1, wherein: More than one child node deposits assets, For one or more subnodes whose running results of the first algorithm are incorrect, the deposited assets will be confiscated.
7. The method according to claim 1, wherein: The one or more sub-nodes request a plurality of side chain nodes constituting one or more side chains to run the first algorithm, The plurality of side chain nodes include a virtual machine for running a first algorithm, The one or more child nodes obtain the running results of the first algorithm from the multiple side chain nodes.
8. The method according to claim 7, wherein: Transactions related to the execution of the first algorithm are recorded in the one or more side chains.
9. The method according to claim 7, wherein: The second smart contract returns the running result of the first algorithm provided by the largest number of side chain nodes to the first smart contract.
10. The method according to claim 7, wherein: Deposit assets into more than one sidechain node. For side chain nodes whose running results of the first algorithm are incorrect among more than one side chain nodes, the deposited assets will be confiscated.
11. A blockchain system, the blockchain system being used to run an acceleration instruction, comprising: A blockchain network storing one or more transactions in one or more blocks; One or more virtual machines, the one or more virtual machines executing instructions related to the one or more transactions; and One or more sub-nodes, wherein the one or more sub-nodes are connected to the blockchain network, Among them, the virtual machine on the blockchain network runs the first smart contract. The first smart contract calls a second smart contract related to the acceleration instruction, The second smart contract requests one or more sub-nodes to execute the first algorithm related to the acceleration instruction, The second smart contract obtains the running result of the first algorithm from one or more child nodes. The second smart contract returns the running result of the first algorithm to the first smart contract.