Smart Contract Code Sharding for Blockchain Deployment Limits
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing smart contract deployment methods on blockchain networks face limitations in applicability and efficiency due to block size constraints and manual installation errors.
Innovation Solution
A method involving splitting a smart contract's intermediate code into multiple byte arrays, generating program shards, and transmitting them to blockchain nodes for chaining and assembly, allowing for decentralized deployment without manual installation and errors.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the block size is limited to ensure security and reach consensus quickly, then the security and consensus efficiency are improved, but the smart contract deployment applicability deteriorates
Solution Approach 1:
The patent divides the smart contract code into multiple program shards that are distributed across different blocks. Each block contains only a portion of the contract code, allowing the full contract to be deployed across multiple blocks without exceeding individual block size limits. This segmentation enables large smart contracts to be deployed while maintaining the security and consensus efficiency of the blockchain.
2Manufacturing precision
If manual verification of program packages is performed, then the installation accuracy is improved, but the installation efficiency deteriorates and manual errors occur
Solution Approach 1:
The patent implements automatic verification where the blockchain node automatically verifies the validity of program packages without manual intervention. The system includes automatic code hashing, comparison with stored hashes, and automated deployment execution. This self-service mechanism eliminates manual verification errors while maintaining high accuracy and significantly improving installation efficiency.
Solution Approach 2:
The patent incorporates feedback mechanisms where the blockchain node automatically checks the validity of program packages by comparing hashes and verifying against stored records. This feedback loop ensures accuracy through automated validation while eliminating manual verification steps, thereby improving both precision and efficiency.
3Ease of operation
If the smart contract code is packaged as a single block, then the deployment simplicity is improved, but the storage capacity requirement increases
Solution Approach 1:
The patent segments the smart contract code into multiple program shards distributed across different blocks. This allows the contract to be deployed without requiring a single large block, thereby reducing individual block storage requirements while maintaining deployment simplicity through automated shard distribution and assembly.
Solution Approach 2:
The patent transitions from a single-block deployment model to a multi-block distributed model. Instead of increasing single-block capacity, the system distributes code across multiple blocks in a temporal and spatial dimension, enabling large contracts without exceeding individual block storage limits.
Data Source
Figure 1
Figure 2
Figure 3~4
AI summary
A data processing method based on a blockchain, and a device and a readable storage medium. The method comprises: performing sharding processing on an intermediate code corresponding to a smart contract, so as to obtain A byte arrays, wherein A is a positive integer greater than 1 (S101); generating A program shards on the basis of the serial number of each byte array, the total number A of shards and each byte array, wherein each byte array corresponds to one program shard (S102); and sending the A program shards to a blockchain network, such that blockchain nodes in the blockchain network upload the A program shards to a chain, wherein the A program shards, which have been uploaded to the chain, are used for being assembled to generate a complete intermediate code (S103). The present method can improve the applicability of smart contract deployment, can improve the efficiency of smart contract installation, and can also avoid manual approval errors.