Smart Contract Transaction Security via Protection Condition Checks
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Smart contracts on blockchain are susceptible to security risks due to Transaction-Ordering Dependence (TOD), which can lead to unauthorized asset transfers and unexpected outcomes, as the ordering of transactions affects the state of the smart contract, and existing solutions like batch auction and pre-submission either sacrifice execution efficiency or require consensus from both parties.
Innovation Solution
Implementing a system that includes a protection condition associated with each transaction, where the current state of the smart contract is checked against this condition before execution, ensuring that transactions are only executed if the condition is met, and returning an execution exception if it is not, thereby preventing unauthorized transfers and maintaining execution efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If batch auction or pre-submission solutions are used to prevent TOD attacks, then security is improved, but execution efficiency is sacrificed
Solution Approach 1:
The system performs preliminary actions by checking execution conditions and determining transaction validity before transactions are executed on the blockchain. The node determines whether to execute a transaction based on protection conditions associated with the transaction and the current state of smart contracts, preventing TOD attacks without requiring batch auction or pre-submission mechanisms that sacrifice execution efficiency.
2Reliability
If transaction ordering is changed to prevent TOD attacks, then security is improved, but transaction processing complexity increases
Solution Approach 1:
Each transaction carries its own protection conditions that automatically determine its executability. The system evaluates these self-contained conditions without requiring complex reordering or consensus mechanisms. The transaction itself provides the information needed to determine its execution status, simplifying the processing complexity while maintaining security.
3Reliability
If protection conditions are checked for each transaction, then unauthorized transfers are prevented, but processing time increases
Solution Approach 1:
The system extracts and evaluates only the essential protection conditions associated with each transaction against the current smart contract state. By focusing on the specific conditions relevant to each transaction rather than comprehensive verification, the system prevents unauthorized transfers while minimizing processing time overhead.
Data Source
AI summary
A computer-implemented method for improving security of smart contract comprises: obtaining a first and a second transactions both invoking a smart contract, wherein the first transaction is associated with a protection condition; executing the second transaction and updating a current state of the smart contract; determining whether the updated current state of the smart contract satisfies the protection condition; in response to determining that the updated current state satisfies the protection condition, executing the first transaction, and recording the second and the first transactions into a data block for adding to a blockchain; and in response to determining that the updated current state does not satisfy the protection condition, recording the second transaction into another data block for adding to the blockchain, without executing the first transaction.


