CN108985934B - Block chain modification method and device - Google Patents
Block chain modification method and device Download PDFInfo
- Publication number
- CN108985934B CN108985934B CN201810734333.5A CN201810734333A CN108985934B CN 108985934 B CN108985934 B CN 108985934B CN 201810734333 A CN201810734333 A CN 201810734333A CN 108985934 B CN108985934 B CN 108985934B
- Authority
- CN
- China
- Prior art keywords
- data
- block
- storage area
- chain
- preset
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Engineering & Computer Science (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Storage Device Security (AREA)
Abstract
The invention discloses a block chain modification method and a block chain modification device, and belongs to the technical field of communication networks. The method comprises the following steps: acquiring the type of data on a data Block; wherein the types of data on the Block comprise immutable data and variable data; when the type of the data on the Block is immutable data, storing the data on the Block in a preset first-layer storage area; and when the type of the data on the Block is variable data, storing the data on the Block in a preset second-layer storage area. The device comprises: the device comprises an acquisition module, a first storage module and a second storage module. The method can set variable data according to the needs, can modify the variable data without extreme conditions, and can greatly enhance the flexibility of the block chain technology and greatly expand the use scene of the block chain technology.
Description
Technical Field
The present invention relates to the field of communications network technologies, and in particular, to a method and an apparatus for modifying a block chain.
Background
The block chain technology (BT), also called distributed ledger technology, is an internet database technology and is characterized by decentralization, openness and transparency, so that everyone can participate in database recording. The technology is the basic technology of the bitcoin at first, is researched all over the world at present, and can be widely applied to various fields such as finance and the like. The basic concept of blockchains includes: (1) transaction (Transaction): an operation, resulting in a change of the state of the ledger, such as adding a record; (2) data Block (Block): recording the transaction and state results occurring within a period of time, which is a consensus on the current ledger state; (3) chain (Chain): the system is formed by serially connecting blocks according to the occurrence sequence and is a log record of the whole state change.
In the original blockchain technique, each data block cannot be changed after being generated, because the hash value (hash) of the current data block is recorded in the following data block. If any one byte (bit) is altered, this will result in a change in its hash value, which will be rejected by the entire network. The irreparable modification of the original blockchain technology brings confidence to the blockchain. However, in many scenarios, the irreparable modification of the blockchain brings many troubles to the application, so that the application range of the blockchain is greatly limited. For this reason, some block chain modification techniques have been proposed.
At present, there are the following block chain modification techniques: 1) the block chain is forked, for example, the ether house network becomes two chains after being forked. 2) Leaving a portion of the data area on the data block that does not participate in the verify operation.
However, in the process of implementing the present invention, the inventor finds that the prior art has at least the following problems:
the bifurcated approach only occurs in extreme cases (e.g., when a stolen digital asset is recovered). The data in the data area which is not involved in the check operation may be changed frequently and cannot be controlled.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for modifying a block chain. The technical scheme is as follows:
in one aspect, a method for modifying a block chain is provided, where the method includes:
acquiring the type of data on a data Block; wherein the types of data on the Block comprise immutable data and variable data;
when the type of the data on the Block is immutable data, storing the data on the Block in a preset first-layer storage area;
and when the type of the data is variable data, storing the data on the Block in a preset second-layer storage area.
Further, the preset first layer storage area is arranged on the Block.
Further, the preset second-layer storage area is arranged in an interplanetary file system IPFS or a preset hardware storage device.
Further, the immutable data includes: a variable data storage location and a public key of a variable data owner.
Further, the variable data exists in the form of a child chain, wherein all variable data in the child chain adopt the same signature.
Further, the method further comprises:
when a data retrieval instruction is acquired, retrieving and positioning a subchain on the Block;
searching variable data on the sub-chain, and verifying the signature;
and when the signature verification is passed, obtaining variable data on the sub-chain.
In another aspect, an apparatus for modifying a block chain is provided, the apparatus including:
the acquisition module is used for acquiring the type of the data on the data Block; wherein the types of data on the Block comprise immutable data and variable data;
the first storage module is used for storing the data on the Block in a preset first-layer storage area when the type of the data on the Block is the immutable data;
and the second storage module is used for storing the data on the Block in a preset second-layer storage area when the type of the data on the Block is variable data.
Further, the preset first layer storage area is arranged on the Block.
Further, the preset second-layer storage area is arranged in an interplanetary file system IPFS or a preset hardware storage device.
Further, the immutable data includes: a variable data storage location and a public key of a variable data owner.
Further, the variable data exists in the form of a child chain, wherein all variable data in the child chain adopt the same signature.
Further, the apparatus further comprises:
the positioning module is used for positioning the retrieval to the sub-chain on the Block when a data retrieval instruction is acquired;
the processing module is used for searching variable data on the sub-chain and verifying the signature;
and the acquisition module is used for acquiring the variable data on the sub-chain after the signature verification is passed.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
the data on the data Block Block can be stored in a layered mode according to needs, so that the data needing to be modified can be stored in a preset second layer storage area as variable data, modification is convenient, the variable data can be set according to needs, modification is not needed under extreme conditions, and the flexibility of the Block chain technology can be greatly enhanced, and the use scene of the Block chain technology is greatly expanded. The immutable data is stored on the Block and needs to participate in the Block verification process, so that the situation of changing the Block is avoided. All variable data in the sub-chain adopt the same signature, thereby preventing malicious modification and being convenient for control.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a block chain modification method according to an embodiment of the present invention;
fig. 2 is a flowchart of a block chain modification method according to a second embodiment of the present invention;
fig. 3 is a flowchart of another block chain modification method according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a block chain modification apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of another block chain modification apparatus according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Example one
An embodiment of the present invention provides a block chain modification method, and referring to fig. 1, the method includes:
101: acquiring the type of data on a data Block; the type of data on the Block comprises immutable data and variable data.
102: and when the type of the data on the Block is the immutable data, storing the data on the Block in a preset first-layer storage area.
103: and when the type of the data on the Block is variable data, storing the data on the Block in a preset second-layer storage area.
Further, the preset first-layer storage area is arranged on the Block.
Further, the preset second-layer storage area is arranged in the interplanetary file system IPFS or in a preset hardware storage device.
Further, the immutable data includes: a variable data storage location and a public key of a variable data owner.
Further, the variable data exists in the form of a child chain, wherein all variable data in the child chain adopt the same signature.
Further, when a data retrieval instruction is acquired, retrieving and positioning a sub chain on Block;
variable data on the sub chain is searched, and the signature is verified;
when the signature verification passes, variable data on the child chain is obtained.
The Block chain modification method provided by the embodiment of the invention can be used for setting the invariable part (fixed part) and the variable part of the data as required and storing the data on the data Block in a layered manner, so that the data to be modified can be stored in the preset second-layer storage area as the variable data, the modification is convenient, the variable data can be set as required and can be modified without extreme conditions, the flexibility of the Block chain technology can be greatly enhanced, and the use scene of the Block chain technology can be greatly expanded. The immutable data is stored on the Block and needs to participate in the Block verification process, so that the situation of changing the Block is avoided. All variable data in the sub-chain adopt the same signature, thereby preventing malicious modification and being convenient for control.
Example two
An embodiment of the present invention provides a block chain modification method, and referring to fig. 2, the method includes:
201: acquiring the type of data on a data Block; the type of data on the Block comprises immutable data and variable data.
Specifically, the immutable data includes: a variable data storage location and a public key of a variable data owner (owner).
In particular, the variable data exists in the form of a child chain, wherein all variable data in the child chain employ the same signature. The variable data itself is a child chain, which is signed by owner, and all data of this child chain must adopt the same signature.
202: and when the type of the data on the Block is the immutable data, storing the data on the Block in a preset first-layer storage area.
Specifically, the preset first-layer storage area is arranged on a Block, and is generally arranged on a public chain.
203: and when the type of the data on the Block is variable data, storing the data on the Block in a preset second-layer storage area.
Specifically, the preset second layer storage area is arranged in an interplanetary File System (IPFS) or a preset hardware storage device (for example, in a computer). The preset second-layer storage area is arranged at other places outside the Block, the verification of the Block is not influenced by data modification, and the data modification can be realized.
Further, referring to fig. 3, the embodiment of the present invention further includes:
204: when a data retrieval instruction is acquired, the retrieval is positioned to a child chain on Block.
When data is retrieved from the main chain, the subchain is located on each block, the latest data on the subchain is searched, and meanwhile, the signature is verified to obtain the latest variable data.
205: and searching variable data on the sub chain and verifying the signature.
206: when the signature verification passes, variable data on the child chain is obtained.
To facilitate understanding, further description is given of scenarios in which the present invention may be applied:
for example, for a citizen digital identity authentication block chain, the name, sex and identity card of the citizen are all unchangeable. However, a need for modification exists. For example, when the data is linked up, the logging is wrong, and the citizen needs to change the name. For the entire blockchain ecosystem, the PIN is a trend and is one of the underlying supporting data chains for the entire ecosystem. The implementation of such a digital identity chain may be hampered if the modification of the data is not supported. By the method, the data related to the identity card to be modified can be stored in other places (such as an interplanetary file system IPFS or a preset hardware storage device) as variable data, and the storage position of the data related to the identity card and the public key of the owner are stored in a public chain.
The Block chain modification method provided by the embodiment of the invention can be used for setting the invariable part (fixed part) and the variable part of the data as required and storing the data on the data Block in a layered manner, so that the data to be modified can be stored in the preset second-layer storage area as the variable data, the modification is convenient, the variable data can be set as required and can be modified without extreme conditions, the flexibility of the Block chain technology can be greatly enhanced, and the use scene of the Block chain technology can be greatly expanded. The immutable data is stored on the Block and needs to participate in the Block verification process, so that the situation of changing the Block is avoided. All variable data in the sub-chain adopt the same signature, thereby preventing malicious modification and being convenient for control.
EXAMPLE III
Referring to fig. 4, an embodiment of the present invention provides a block chain modification apparatus, including:
an obtaining module 301, configured to obtain a type of data on a data Block; the types of the data on the Block comprise immutable data and variable data;
a first storage module 302, configured to store the data on Block in a preset first-layer storage area when the type of the data on Block is immutable data;
and a second storage module 303, configured to store the data on Block in a preset second layer storage area when the type of the data on Block is variable data.
Further, the preset first-layer storage area is arranged on the Block.
Further, the preset second-layer storage area is arranged in the interplanetary file system IPFS or in a preset hardware storage device.
Further, the immutable data includes: a variable data storage location and a public key of a variable data owner.
Further, the variable data exists in the form of a child chain, wherein all variable data in the child chain adopt the same signature.
Further, referring to fig. 5, the apparatus further includes:
a positioning module 304, configured to, when a data retrieval instruction is obtained, position a retrieval to a child chain on Block;
a processing module 305, configured to search variable data on the child chain, and verify a signature;
an obtaining module 306, configured to obtain variable data on the child chain after the signature verification passes.
The Block chain modification device provided by the embodiment of the invention can set the invariable part (fixed part) and the variable part of the data as required, and store the data on the data Block in a layered manner, so that the data to be modified can be stored in a preset second layer storage area as variable data, the modification is convenient, the variable data can be set as required, the modification can be carried out without extreme conditions, the flexibility of the Block chain technology can be greatly enhanced, and the use scene of the Block chain technology can be greatly expanded. All variable data in the sub-chain adopt the same signature, thereby preventing malicious modification and being convenient for control.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (8)
1. A method for modifying a block chain, the method comprising:
acquiring the type of data on a data Block; wherein the types of data on the Block comprise immutable data and variable data;
when the type of the data on the Block is immutable data, storing the data on the Block in a preset first-layer storage area;
when the type of the data on the Block is variable data, storing the data on the Block in a preset second-layer storage area;
the preset first-layer storage area is arranged on the Block, and data in the first-layer storage area needs to participate in a Block verification process and cannot be modified;
the preset second-layer storage area is arranged in an interplanetary file system IPFS or a preset hardware storage device, and data in the second-layer storage area can be modified.
2. The method of claim 1, wherein the immutable data comprises: a variable data storage location and a public key of a variable data owner.
3. The method of claim 1, wherein the variable data exists in a child chain, wherein all variable data in the child chain is signed with the same signature.
4. The method of claim 3, further comprising:
when a data retrieval instruction is acquired, retrieving and positioning a subchain on the Block;
searching variable data on the sub-chain, and verifying the signature;
and when the signature verification is passed, obtaining variable data on the sub-chain.
5. An apparatus for modifying a blockchain, the apparatus comprising:
the acquisition module is used for acquiring the type of the data on the data Block; wherein the types of data on the Block comprise immutable data and variable data;
the first storage module is used for storing the data on the Block in a preset first-layer storage area when the type of the data on the Block is the immutable data;
the second storage module is used for storing the data on the Block in a preset second-layer storage area when the type of the data on the Block is variable data;
the preset first-layer storage area is arranged on the Block, and data in the first-layer storage area needs to participate in a Block verification process and cannot be modified;
the preset second-layer storage area is arranged in an interplanetary file system IPFS or a preset hardware storage device, and data in the second-layer storage area can be modified.
6. The apparatus of claim 5, wherein the immutable data comprises: a variable data storage location and a public key of a variable data owner.
7. The apparatus of claim 5, wherein the variable data exists in a child chain, wherein all variable data in the child chain is signed with the same signature.
8. The apparatus of claim 7, further comprising:
the positioning module is used for positioning the retrieval to the sub-chain on the Block when a data retrieval instruction is acquired;
the processing module is used for searching variable data on the sub-chain and verifying the signature;
and the acquisition module is used for acquiring the variable data on the sub-chain after the signature verification is passed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810734333.5A CN108985934B (en) | 2018-07-06 | 2018-07-06 | Block chain modification method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810734333.5A CN108985934B (en) | 2018-07-06 | 2018-07-06 | Block chain modification method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108985934A CN108985934A (en) | 2018-12-11 |
CN108985934B true CN108985934B (en) | 2021-12-17 |
Family
ID=64536334
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810734333.5A Active CN108985934B (en) | 2018-07-06 | 2018-07-06 | Block chain modification method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108985934B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109754251B (en) * | 2018-12-27 | 2022-02-01 | 石更箭数据科技(上海)有限公司 | Data processing method and device, medium and terminal thereof |
CN113312362B (en) * | 2020-02-26 | 2024-07-19 | 百度在线网络技术(北京)有限公司 | Block chain data modification method, device, equipment and storage medium |
CN112037057B (en) * | 2020-04-10 | 2022-03-01 | 支付宝(杭州)信息技术有限公司 | Correction method and device for block chain data |
SG11202103063PA (en) | 2020-06-08 | 2021-04-29 | Alipay Labs Singapore Pte Ltd | Managing user authorizations for blockchain-based custom clearance services |
SG11202102366SA (en) | 2020-06-08 | 2021-04-29 | Alipay Labs Singapore Pte Ltd | User management of blockchain-based custom clearance service platform |
CN111989663B (en) | 2020-06-08 | 2024-07-16 | 支付宝实验室(新加坡)有限公司 | Intelligent contract pool based on block chain |
SG11202103081RA (en) * | 2020-06-08 | 2021-04-29 | Alipay Labs Singapore Pte Ltd | Distributed storage of custom clearance data |
EP3844699A4 (en) | 2020-06-08 | 2021-08-18 | Alipay Labs (Singapore) Pte. Ltd. | Blockchain-based import custom clearance data processing |
WO2020169125A2 (en) | 2020-06-08 | 2020-08-27 | Alipay Labs (singapore) Pte. Ltd. | Blockchain-based document registration for custom clearance |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106775619A (en) * | 2016-11-12 | 2017-05-31 | 杭州复杂美科技有限公司 | Flexible block chain framework |
CN107391557A (en) * | 2017-03-24 | 2017-11-24 | 北京瑞卓喜投科技发展有限公司 | Block chain Series poll method and system for setting errata outside chain |
CN107391291A (en) * | 2017-03-24 | 2017-11-24 | 北京瑞卓喜投科技发展有限公司 | Modification block chain is the block chain corrigenda method and system for having block volume data |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8266365B2 (en) * | 2008-12-17 | 2012-09-11 | Sandisk Il Ltd. | Ruggedized memory device |
US10121019B2 (en) * | 2015-06-02 | 2018-11-06 | ALTR Solutions, Inc. | Storing differentials of files in a distributed blockchain |
-
2018
- 2018-07-06 CN CN201810734333.5A patent/CN108985934B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106775619A (en) * | 2016-11-12 | 2017-05-31 | 杭州复杂美科技有限公司 | Flexible block chain framework |
CN107391557A (en) * | 2017-03-24 | 2017-11-24 | 北京瑞卓喜投科技发展有限公司 | Block chain Series poll method and system for setting errata outside chain |
CN107391291A (en) * | 2017-03-24 | 2017-11-24 | 北京瑞卓喜投科技发展有限公司 | Modification block chain is the block chain corrigenda method and system for having block volume data |
Also Published As
Publication number | Publication date |
---|---|
CN108985934A (en) | 2018-12-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108985934B (en) | Block chain modification method and device | |
EP3678346B1 (en) | Blockchain smart contract verification method and apparatus, and storage medium | |
CN108389129B (en) | Transaction execution method and device based on block chain and electronic equipment | |
KR102226257B1 (en) | Method and device for writing service data to a blockchain system | |
CN111971931B (en) | Method for verifying transactions in a blockchain network and nodes constituting the network | |
CN109543942A (en) | Data verification method, device, computer equipment and storage medium | |
CN112286939B (en) | Method, device and equipment for generating hash of global state in block chain type account book | |
CN110602239A (en) | Block chain information storage method and related equipment | |
CN111444192B (en) | Method, device and equipment for generating Hash of global state in block chain type account book | |
CN107580032B (en) | Data processing method, device and equipment | |
CN111324577A (en) | Method and device for reading and writing Yml file | |
CN112559529A (en) | Data storage method and device, computer equipment and storage medium | |
CN111461751A (en) | Block chain-based house property information chain organization method, historical state tracing method and device | |
CN108616361B (en) | Method and device for identifying uniqueness of equipment | |
CN112015806A (en) | Method and device for storing data by block chain | |
CN115391188A (en) | Scene test case generation method, device, equipment and storage medium | |
CN115421968A (en) | Data recovery method and electronic equipment | |
EP3343395B1 (en) | Data storage method and apparatus for mobile terminal | |
CN113361236A (en) | Method and device for editing document | |
CN112286457B (en) | Object deduplication method and device, electronic equipment and machine-readable storage medium | |
CN111831744B (en) | System, method and medium for searching data on DAPP chain | |
CN108241705A (en) | A kind of data insertion method and device | |
US11074294B2 (en) | System and method for Directed Acyclic Graph (DAG) encoding into hash linked blocks | |
CN114741066A (en) | Block chain application generation method and system | |
CN113536047A (en) | Graph database data deleting method, system, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230411 Address after: 518000 Qiancheng Commercial Center, No. 5 Haicheng Road, Mabu Community, Xixiang Street, Bao'an District, Shenzhen City, Guangdong Province, China, 1003-1 Patentee after: Shenzhen Mustard Dimensional Technology Co.,Ltd. Address before: 518052 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.) Patentee before: SHENZHEN YUANMA INTELLIGENT TECHNOLOGY Co.,Ltd. |
|
TR01 | Transfer of patent right |