Blockchain Block Content Editing via Secure Multi-Party Computing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current blockchain technologies face challenges in efficiently editing block content while maintaining tamper-resistance and privacy, particularly in scenarios where private data is recorded without encryption, leading to risks of privacy exposure and storage waste due to erroneous data.
Innovation Solution
A method and apparatus for block content editing in a blockchain network, where a blockchain node receives a block editing transaction, generates a new random number using secure multi-party computing involving node private keys, and updates the block content to ensure a consistent hash value, leveraging a smart contract to manage private key generation and secure random number calculation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If block content is edited directly in traditional blockchain, then editing flexibility is improved, but tamper-resistance and data integrity deteriorate
Solution Approach 1:
The block content is segmented into original content and editing information. The editing transaction separately stores the original block content, the edited content, and the random number used for hash calculation. This segmentation allows the blockchain to maintain the original immutable record while enabling controlled edits through separate editing transactions, thus preserving tamper-resistance while achieving editing flexibility.
Solution Approach 2:
A smart contract serves as an intermediary mechanism between the block editing transaction and the blockchain state. The smart contract validates the editing transaction, generates the random number, calculates the new hash value, and coordinates the state change. This intermediary ensures that edits are performed securely and consistently across all nodes, maintaining data integrity while enabling flexible content editing.
2Quantity of substance
If private data is stored without encryption in blockchain, then storage efficiency is improved, but privacy protection deteriorates
Solution Approach 1:
Different parts of the block content are treated differently regarding privacy protection. Public data can be stored in plain text for efficiency, while private data is encrypted before storage. The encryption/decryption mechanism is applied locally to sensitive fields only, rather than to the entire block content, thus maintaining storage efficiency for public data while protecting privacy for sensitive data.
3Quantity of substance
If erroneous data is stored in blockchain, then data completeness is improved, but storage waste increases
Solution Approach 1:
The system enables the discarding of erroneous data through the block editing transaction mechanism. When an error is detected, the system can generate an editing transaction that replaces the erroneous data with correct data. The original erroneous data remains in the blockchain history as a record of what was corrected, while the storage space is effectively recovered by overwriting the erroneous data with valid data, thus reducing storage waste while maintaining data completeness.
4Reliability
If multiple blockchain nodes participate in editing, then editing security is improved, but system complexity increases
Solution Approach 1:
The smart contract serves multiple functions: it validates the editing transaction, generates the random number, calculates the new hash value, and coordinates the state change across all nodes. This multi-functionality reduces the need for separate complex mechanisms at each node, thereby improving editing security through consensus while avoiding excessive system complexity by consolidating multiple functions into a single universal component.
Data Source
Figure 1~2
Figure 3~4
Figure 5~6
AI summary
One or more embodiments of the present specification provide a block content editing method, and apparatus of using the same. The method can include the following: a blockchain node Bi receives a block editing transaction, which is used to edit original block content m of a block Qi to target block content m', wherein a parent hash corresponding to block Qi is recorded in a block header of block Qi+1 and is generated through calculation using original block content m, public key H, and original random number r; blockchain node Bi executes a smart contract that generates a random number when determining that a consensus on the block editing transaction succeeds, wherein the smart contract is used to generate private key X through secure multi-party computing; and determine corresponding target random number r' based on original block content m, target block content m', original random number r, and private key X, wherein a hash value generated through calculation by using target block content m', public key H, and target random number r' is the same as the parent hash; and blockchain node Bi updates (m, r) to (m', r'),