Smart Contract Deployment via AoT Compilation and Trusted Accounts

Resolve Bottlenecks,
Find Innovative Solutions
Generate 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

VSEngineering 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

Engineering Contradiction:
Improveoperation efficiencyVSAvoidsecurity risks
Core Design Contradiction:
ProductivityVSObject-affected harmful factors

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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

Engineering Contradiction:
Improveoperational capabilitiesVSAvoidnode stability
Core Design Contradiction:
Adaptability or versatilityVSReliability

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.

Inventive Principle:
Principle #10Preliminary action

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Ease of operation

If any account can deploy smart contracts in machine code form, then deployment flexibility is improved, but security control deteriorates

Engineering Contradiction:
Improvedeployment flexibilityVSAvoidsecurity control
Core Design Contradiction:
Ease of operationVSReliability

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.

Inventive Principle:
Principle #24Intermediary (Mediator)

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.

Inventive Principle:
Principle #3Local quality

Data Source

PatentEP3961460B1Methods, blockchain nodes and storage media for deploying smart contract
Publication Date: 2023.08.30 ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
  • EP3961460B1 patent drawingFigure 1
  • EP3961460B1 patent drawingFigure 2~3
  • EP3961460B1 patent drawingFigure 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.