Smart Contract Deployment via AoT Compilation and Trusted Accounts
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In the context of blockchain technologies, deploying smart contracts involves risks due to the increased operational capabilities of machine code compared to bytecode, which can lead to data leakage and instability in blockchain nodes, especially when non-trusted accounts can arbitrarily deploy smart contracts in machine code form.
Innovation Solution
The method involves converting smart contract bytecode into machine code through AoT compilation before deployment, and restricting the initiator account to a predefined trusted account to prevent unauthorized deployment, thereby enhancing security and stability by ensuring only trusted accounts can deploy the smart contract in machine code form.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If smart contract bytecode is converted to machine code through AoT compilation for deployment, then operation efficiency is improved, but security risks increase due to enhanced operational capabilities
Solution Approach 1:
The patent applies preliminary action by performing AoT compilation before smart contract deployment to convert bytecode into machine code in advance. This pre-processing enables the smart contract to execute more operations efficiently when deployed, while the compilation results are stored and reused across multiple invocations, improving overall system productivity without repeatedly facing the security risks of interpretation execution.
Solution Approach 2:
The patent introduces an intermediary mechanism through the introduction account concept. When a smart contract is invoked, the system checks whether the caller is an introduction account that has permission to invoke machine code形式的 smart contracts. This intermediary security check acts as a mediator between the enhanced operational capabilities of machine code and the security risks, allowing efficient execution only for authorized accounts while preventing unauthorized access.
2Adaptability or versatility
If machine code is deployed on blockchain nodes, then operational capabilities are enhanced, but risks of data leakage and node instability increase
Solution Approach 1:
The patent applies preliminary action by performing AoT compilation before smart contract deployment to convert bytecode into machine code in advance. This pre-processing enables the smart contract to execute more operations efficiently when deployed, while the compilation results are stored and reused across multiple invocations, improving overall system productivity without repeatedly facing the security risks of interpretation execution.
Solution Approach 2:
The patent introduces an intermediary mechanism through the introduction account concept. When a smart contract is invoked, the system checks whether the caller is an introduction account that has permission to invoke machine code形式的 smart contracts. This intermediary security check acts as a mediator between the enhanced operational capabilities of machine code and the security risks, allowing efficient execution only for authorized accounts while preventing unauthorized access.
3Ease of operation
If any account can deploy smart contracts in machine code form, then deployment flexibility is improved, but security control deteriorates
Solution Approach 1:
The patent introduces an intermediary mechanism through the introduction account concept. When a smart contract is invoked, the system checks whether the caller is an introduction account that has permission to invoke machine code形式的 smart contracts. This intermediary security check acts as a mediator between the enhanced operational capabilities of machine code and the security risks, allowing efficient execution only for authorized accounts while preventing unauthorized access.
Solution Approach 2:
The patent applies local quality by differentiating permissions for different accounts. Introduction accounts are granted special permissions to invoke machine code形式的 smart contracts, while ordinary accounts are restricted to bytecode form only. This localized permission assignment maintains security control by applying different rules to different account types, allowing flexible deployment for authorized users while maintaining security constraints for others.
Data Source
Figure 1
Figure 2~3
Figure 4~5
AI summary
Provided in one or more embodiments of the present specification are methods and blockchain nodes for deploying a smart contract, and storage media. Embodiments of a method for deploying a smart contract include: receiving, by a blockchain node, a transaction for creating the smart contract, wherein the transaction includes a machine code of the smart contract, and the machine code is obtained by AoT compilation of a bytecode of the smart contract; completing, by the blockchain node, a deployment of the smart contract in response to determining that an initiator account of the transaction is a predefined trusted account.