CN109102284A - A kind of optimization method of block chain tamper-resistance techniques - Google Patents

A kind of optimization method of block chain tamper-resistance techniques Download PDF

Info

Publication number
CN109102284A
CN109102284A CN201810851191.0A CN201810851191A CN109102284A CN 109102284 A CN109102284 A CN 109102284A CN 201810851191 A CN201810851191 A CN 201810851191A CN 109102284 A CN109102284 A CN 109102284A
Authority
CN
China
Prior art keywords
block
file
tampered
data
node
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.)
Granted
Application number
CN201810851191.0A
Other languages
Chinese (zh)
Other versions
CN109102284B (en
Inventor
黄芸芸
蒲军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN201810851191.0A priority Critical patent/CN109102284B/en
Publication of CN109102284A publication Critical patent/CN109102284A/en
Application granted granted Critical
Publication of CN109102284B publication Critical patent/CN109102284B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention proposes the methods that the account book data that some node on a kind of discovery block chain is stored are tampered, this method is traversed in the block chain stored in verifying node first except whether all blocks of the last one block are tampered, the block for existing in node and being tampered such as is verified, then records pre_H for restoring data.When block newly is added in the node block chain, the pre_H of new time zone block storage and the private key of data node are signed respectively, and are individually stored.When detection by the pre_H stored in newest block and data in the signature that is stored pre_H and data be compared respectively, so that whether the data for verifying new time zone block are tampered, and position and restore the data that front has been tampered in block.

Description

A kind of optimization method of block chain tamper-resistance techniques
Technical field
The present invention relates to block chain technical fields, and in particular to a kind of optimization method of block chain tamper-resistance techniques.
Background technique
Block chain is the Floor layer Technology of the digital virtuals currency such as bit coin, by the data record of decentralization, by the whole network All nodes safeguard data jointly, realize safely storing data, have unforgeable, can not tamper, trackability, The features such as anonymity.
The decentralization technical solution of block chain is managed and storing data using block as basic unit.Block is by two Partial data structure composition, respectively block head and Mei Keer tree construction.The head of block includes that miner can modify Provisional random number, timestamp, digs the data such as mine disaster degree, the tree root that transaction is set at the cryptographic Hash of preamble block.Another part of block It is Mei Keer tree, for storing effective transaction.When the block comprising transaction data orderly links, it is formed block Chain.
It can be seen that block chain is a distributed account book, each node maintenance portion account book data, each account book data Include all historical transactional informations, is connected between account book by Hash pointer.Under normal circumstances, the whole network safeguards common area The data of block chain data, individual node storage are consistent with the data of the whole network.But if there is attacker attempts to tamper with the node The initial data of historical data, account book is destroyed, and is accurately gone through then intelligent contract can not just be obtained by the account book of the node History transaction data, all applications based on account book historical data will be affected.How the safety of node deposited account book is guaranteed Property, it is ensured that node account book data and the validity of application become technical problem urgently to be resolved.
Summary of the invention
The invention proposes the methods that the account book data that some node on a kind of discovery block chain is stored are tampered.
In order to solve the above technical problems, the invention adopts the following technical scheme:
By the cryptographic Hash of each block on the detection node, its immediate the latter block head is stored the present invention Preamble block cryptographic Hash pre_H compare, if there is inconsistent, illustrate that the node account book data are tampered.
The above method is achieved through the following steps:
A kind of optimization method of block chain tamper-resistance techniques, includes the following steps:
1, it examines whether all blocks in node in addition to the last one block are tampered, and positions the block being tampered:
1.1) in each node, by block at first, traversal verifying institute's memory block chain block cryptographic Hash with It is whether consistent close to subsequent block pre_H value, think that this block has been tampered if there is inconsistent, and record this block Pre_H restores for data, if the cryptographic Hash of all blocks is consistent with the pre_H close to subsequent block, needs according to subsequent Step judges whether the block is tampered;
1.2) while whether the cryptographic Hash that traversal verifies all blocks is consistent with close to subsequent block pre_H value, root According to the timestamp of each block, all blocks on the same day are stored in same file, previous file last The cryptographic Hash of a block, the Hash pointer of first block as the latter file, is per diem split block chain with this, if It does not find that the cryptographic Hash of previous block is different from close to subsequent block pre_H in file on the same day, then calculates this document Cryptographic Hash H, and H is stored in temporary folder;
2, the last one block in node is examined, and is positioned according to inspection result and restores the area being tampered in block chain Block:
2.1) for the pre_H and data of the last one block storage in node, the block of node is hung up in the block It is signed when chain with the private key of node, and individually stored respectively.When node block chain newly hangs block, storage dynamic updates For the pre_H of newest block storage and the signature of data;
2.2) data stored in the last one block are compared with the data in the signature individually stored, it is such as consistent Then think that the data of the last one block are not tampered with.If inconsistent, illustrate that the data of newest block are tampered, at this time to neighbour Nearly node inquires newest block and restores data.
The pre_H stored in the last one block is compared with the pre_H in the signature individually stored, is verified with this Whether the pre_H value of block is modified.If inconsistent, by successively being ask since nearest block on the net to other nodes It asks acquisition block, orients the block being tampered by comparing, and restore data.
Using the pre_H in step 1.1) as ID, the block by inquiring other nodes pre_H on the net is (inconsistent Pre_H is verified after obtaining block as the ID for requesting other nodes to find block), so as to find preamble block. With block of the same method before available, by comparing, to position and restore the data being tampered.
For the file being not tampered with, the file formally stored is labeled as to the H of the file of temporary file underedge storage and is breathed out Uncommon value calculates the formal storage file cryptographic Hash of affiliated file after restoring for the data being tampered.
3, whether fast verification block chain is correct:
It after detection is completed for the first time, checks whether to be tampered again, directly progress file detection:
3.1) the cryptographic Hash file_hash of the file of every day in block chain is recalculated;
3.2) compare the file H formally stored in file_hash and step 2;
3.3) if file_hash is identical as H, then it is assumed that data are not tampered with, and otherwise repeat to walk for the block in file Rapid 1 and 2, for there are n times to distort high-risk piece of (N >=1) of experience, it is arranged and records the high-risk parameter identification r of file, r is The weighting number that block in this document is tampered,Wherein k is the number being tampered, and m is that correspondence is tampered k times Block number.For the block of r > 0, it is separately provided in per unit time (as every other week) scanning r times, as scanning frequency Rate.High-risk parameter identification is updated after scanning through every time, calculates the time of this document scanning next time, timed task is arranged.
The invention adopts the above technical scheme compared with prior art, has following technical effect that
1, can judge to repair block chain data while whether the block chain of single node is tampered.
2, verifying number is less, and verification efficiency is high.
Detailed description of the invention
Fig. 1 is the data structure diagram of block;
Fig. 2 is the schematic diagram that file is daily divided into file;
Fig. 3 is block chain structure schematic diagram;
Fig. 4 is the block chain schematic diagram for not distorting a last block;
Fig. 5 is to store to the signature of the last one block;
Schematic diagram when Fig. 6 is checking file cryptographic Hash;
Fig. 7 is to complete the block chain schematic diagram after file divides;
Fig. 8 is the flow chart of embodiment.
Specific embodiment
Technical solution of the present invention is described in further detail with reference to the accompanying drawing:
Assuming that node A safeguards a block chain as shown in Figure 3, each piece, according to time stamp T, passes through the Kazakhstan of preamble block Uncommon value is interconnected, and currently has n block, and each block content includes: the data D of block and the Hash pointer of a upper block pre_H。
Hash pointer on block chain can simplify are as follows:
Pre_H (1)=hash (D (1))
Pre_H (2)=hash (pre_H (1) | | D (1))
……
Pre_H (n-2)=hash (pre_H (n-3) | | D (n-2))
Pre_H (n-1)=hash (pre_H (n-2) | | D (n-1))
Pre_H (n)=hash (pre_H (n-1) | | D (n))
Anti-tamper testing mechanism following steps:
1, start to detect for the first time, pre_H contrasting detection mainly carrying out block to entire block chain, as shown in Figure 1, such as Fruit pre_H (m)=hash (pre_H (m-1) | | D (m)), then this time detection passes through;Otherwise it detects and does not pass through, and will be problematic Pre_H (m) is recorded, and is restored for subsequent data.
2, while pre_H contrasting detection between carrying out block, the timestamp of each block is counted, it will section at the same time Block be divided into a file, file is divided as unit of day.Assuming that the timestamp of block 1,2,3 belongs to file 1 These three blocks are attributed to file 1, as shown in Figure 2 by period 2018-6-1.
Wherein file_H1=hash (D1 | | pre_H1 | | D2 | | pre_H2 | | D3), when all blocks for belonging to file 1 all After the completion of statistics, the file cryptographic Hash file_H1 of calculation document 1, and this document cryptographic Hash is stored in temporary file underedge.
3, if there is interpolater distorts the data D (m) in block m, and interpolater does not distort last block storage Pre_H (n), then compare according to technical solution first method, total energy find the cryptographic Hash of some block with close to The value of the pre_H of postorder block storage is different.As shown in figure 4, leading to if D (m), pre_H (m), pre_H (m+1) are modified The cryptographic Hash and pre_H (m+2) of comparison block m+2 are crossed, because inconsistent to find that data are tampered.
4, by inquiring the block of other nodes pre_H (m+2) that (pre_H (m+2) is sought as other nodes of request on the net The ID of block is looked for, and is verified after obtaining block), so as to find block m+2.With same method, block m+1 and block are found M is compared by veritifying, is tampered to orient data D (m), and restore data.
5, node is veritified after new block passes through, and while chaining, node increases a job, it may be assumed that for this newly into The pre_H of the storage of block and the private key of data node are signed, and are individually stored.In this way, node is newest in order to verify The pre_H that block stores need to only be compared with the pre_H in the signature deposited, verify block with this by the pre_H of block Whether pre_H value is modified.It, can be by comparing the signature of data, together if what interpolater modified is the data of newest block Sample, which is can be found that, to be distorted.As shown in Figure 5.
If 6, pre_H (n-1) value comparison result is different in step 5, newest block is inquired to other nodes, by step 4 It can position and distort block and revert to original correct data.If data value comparison result is different in step 5, to other nodes It inquires newest block, restores the data of the last one block.
7, when detecting for the first time, step as above is carried out, for the file being not tampered with, step 2 temporary file underedge is deposited The H of the file of storage is marked, and the cryptographic Hash of file is recalculated after restoring for the data being tampered, later detection can be straight The cryptographic Hash file_H of detection file was connected, to improve scan efficiency, as shown in Figure 6.
8, entire block chain completes detection and file division between block, it is assumed that the block chain of present node A is complete by three File and the same day be not classified as also file remaining block composition, as shown in Figure 7.
9, after positioning the block being specifically tampered in detection process, which is stamped to the label being tampered, and each It is secondary to be found to distort rear accumulative frequency.For there are n times to distort high-risk piece of (N >=1) of experience, it is arranged and records the height of file Endanger parameter identification r, and r is the weighting number that the block in this document is tampered,Wherein k is the number being tampered, m For the corresponding block number for being tampered k times.In some file, there is 1 to be distorted by 3 times by block that 2 times are distorted and 2 Block, the label of this document are 2 * 2=8 times of * 1+3 times.It is separately provided in per unit time (as every other week) scanning r times, As scan frequency.High-risk parameter identification is updated after scanning through every time, calculates the time of this document scanning next time, setting timing Task.

Claims (1)

1. a kind of optimization method of block chain tamper-resistance techniques, includes the following steps:
1, it examines whether all blocks in node in addition to the last one block are tampered, and positions the block being tampered:
1.1) in each node, by block at first, traversal verifying institute's memory block chain block cryptographic Hash with close to Whether subsequent block pre_H value is consistent, thinks that this block has been tampered if there is inconsistent, and record the pre_H of this block, Restore for data, if the cryptographic Hash of all blocks is consistent with the pre_H close to subsequent block, needs to be sentenced according to subsequent step Whether the block that breaks is tampered;
1.2) while whether the cryptographic Hash that traversal verifies all blocks is consistent with close to subsequent block pre_H value, according to every All blocks on the same day are stored in same file, the last one area of previous file by the timestamp of a block The cryptographic Hash of block, the Hash pointer of first block as the latter file, is per diem split block chain with this, if same It does not find that the cryptographic Hash of previous block is different from close to subsequent block pre_H in file in it, then calculates the Kazakhstan of this document Uncommon value H, and H is stored in temporary folder;
2, the last one block in node is examined, and is positioned according to inspection result and restores the block being tampered in block chain:
2.1) for the pre_H and data of the last one block storage in node, when the block is hung up the block chain of node It is signed with the private key of node, and individually stored respectively.When node block chain newly hangs block, storage dynamic is updated to most The pre_H of new block storage and the signature of data;
2.2) data stored in the last one block are compared with the data in the signature individually stored, are recognized if consistent It is not tampered with for the data of the last one block.If inconsistent, illustrate that the data of newest block are tampered, at this time to neighbouring section Point inquires newest block and restores data.
The pre_H stored in the last one block is compared with the pre_H in the signature individually stored, block is verified with this Pre_H value whether be modified.If inconsistent, obtained by successively being inquired since nearest block on the net to other nodes Block is taken, orients the block being tampered by comparing, and restore data.
Using the pre_H in step 1.1) as ID, by block (the inconsistent pre_H for inquiring other nodes pre_H on the net As the ID for requesting other nodes to find block, and verified after obtaining block), so as to find preamble block.With same Block before the method for sample is available, by comparing, to position and restore the data being tampered.
For the file being not tampered with, the file cryptographic Hash formally stored is labeled as to the H of the file of temporary file underedge storage, The formal storage file cryptographic Hash of file belonging to being calculated after restoring for the data being tampered.
3, whether fast verification block chain is correct:
It after detection is completed for the first time, checks whether to be tampered again, directly progress file detection:
3.1) the cryptographic Hash file_hash of the file of every day in block chain is recalculated;
3.2) compare the file H formally stored in file_hash and step 2;
3.3) if file_hash is identical as H, then it is assumed that data are not tampered with, otherwise for the block in file repeat step 1 and 2, for there are n times to distort high-risk piece of (N >=1) of experience, it is arranged and records the high-risk parameter identification r of file, r is this document The weighting number that interior block is tampered,Wherein k is the number being tampered, and m is the corresponding block for being tampered k times Number.For the block of r > 0, it is separately provided in per unit time (as every other week) scanning r times, as scan frequency.Every time High-risk parameter identification is updated after scanning through, and calculates the time of this document scanning next time, timed task is set.
CN201810851191.0A 2018-07-30 2018-07-30 Optimization method of block chain tamper-proof technology Active CN109102284B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810851191.0A CN109102284B (en) 2018-07-30 2018-07-30 Optimization method of block chain tamper-proof technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810851191.0A CN109102284B (en) 2018-07-30 2018-07-30 Optimization method of block chain tamper-proof technology

Publications (2)

Publication Number Publication Date
CN109102284A true CN109102284A (en) 2018-12-28
CN109102284B CN109102284B (en) 2021-07-27

Family

ID=64848008

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810851191.0A Active CN109102284B (en) 2018-07-30 2018-07-30 Optimization method of block chain tamper-proof technology

Country Status (1)

Country Link
CN (1) CN109102284B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110535967A (en) * 2019-09-06 2019-12-03 江苏物联网研究发展中心 A kind of vehicle transport data judge system
CN114025355A (en) * 2021-08-05 2022-02-08 成都西加云杉科技有限公司 Pseudo AP (access point) identification method, device, equipment and storage medium
CN114237987A (en) * 2022-02-22 2022-03-25 南京金宁汇科技有限公司 Block chain-based unstructured data self-repairing method
CN115618426B (en) * 2022-11-17 2023-04-28 山东区块链研究院 Block chain data tamper-proof method and system based on check points
CN116883027A (en) * 2023-09-06 2023-10-13 南通汉迪自动化设备有限公司 Material import and export clearance networking supervisory systems

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170109735A1 (en) * 2015-07-14 2017-04-20 Fmr Llc Computationally Efficient Transfer Processing and Auditing Apparatuses, Methods and Systems
CN106796524A (en) * 2016-12-27 2017-05-31 深圳前海达闼云端智能科技有限公司 The method of records application program configuration information, device and electronic equipment
CN107135661A (en) * 2016-12-26 2017-09-05 深圳前海达闼云端智能科技有限公司 Data processing method, device, system and information collecting device
CN107257336A (en) * 2017-06-15 2017-10-17 北京汇通金财信息科技有限公司 A kind of user authen method and system
CN107659410A (en) * 2017-08-30 2018-02-02 湖南众享政联科技有限公司 Based on the anti-tamper official document transmission of block chain and storage method
CN107909369A (en) * 2017-10-13 2018-04-13 布比(北京)网络技术有限公司 Based on the common recognition method, apparatus merchandised across chain and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170109735A1 (en) * 2015-07-14 2017-04-20 Fmr Llc Computationally Efficient Transfer Processing and Auditing Apparatuses, Methods and Systems
CN107135661A (en) * 2016-12-26 2017-09-05 深圳前海达闼云端智能科技有限公司 Data processing method, device, system and information collecting device
CN106796524A (en) * 2016-12-27 2017-05-31 深圳前海达闼云端智能科技有限公司 The method of records application program configuration information, device and electronic equipment
CN107257336A (en) * 2017-06-15 2017-10-17 北京汇通金财信息科技有限公司 A kind of user authen method and system
CN107659410A (en) * 2017-08-30 2018-02-02 湖南众享政联科技有限公司 Based on the anti-tamper official document transmission of block chain and storage method
CN107909369A (en) * 2017-10-13 2018-04-13 布比(北京)网络技术有限公司 Based on the common recognition method, apparatus merchandised across chain and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
何蒲 等: "区块链技术与应用前瞻综述", 《计算机科学》 *
黄天开: "区块链与大数据结合既安全又高效——区块链与大数据结合的研究", 《电子制作》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110535967A (en) * 2019-09-06 2019-12-03 江苏物联网研究发展中心 A kind of vehicle transport data judge system
CN110535967B (en) * 2019-09-06 2022-08-23 江苏物联网研究发展中心 Vehicle transportation data judgment system
CN114025355A (en) * 2021-08-05 2022-02-08 成都西加云杉科技有限公司 Pseudo AP (access point) identification method, device, equipment and storage medium
CN114237987A (en) * 2022-02-22 2022-03-25 南京金宁汇科技有限公司 Block chain-based unstructured data self-repairing method
CN115618426B (en) * 2022-11-17 2023-04-28 山东区块链研究院 Block chain data tamper-proof method and system based on check points
CN116883027A (en) * 2023-09-06 2023-10-13 南通汉迪自动化设备有限公司 Material import and export clearance networking supervisory systems
CN116883027B (en) * 2023-09-06 2023-12-19 南通汉迪自动化设备有限公司 Material import and export clearance networking supervisory systems

Also Published As

Publication number Publication date
CN109102284B (en) 2021-07-27

Similar Documents

Publication Publication Date Title
CN109102284A (en) A kind of optimization method of block chain tamper-resistance techniques
CN108053239B (en) Sensor network sharing method based on block chain
CN110650321B (en) Block chain technology-based video content tamper-proof, loss-proof and recovery method
CN107171812A (en) It is a kind of based on block chain without key signature infrastructure construction method
CN110827028B (en) Block chain-based data acquisition transaction system and method
CN108009445B (en) Semi-centralized trusted data management system
CN107122682B (en) Data processing method and system based on the storage of block chain
CN107562883B (en) A kind of method and system that data synchronize
CN109100785B (en) Quality control method and device for continuous recording data
CN107526775A (en) A kind of method of block chain data filing
CN104679777A (en) Method and system for detecting fraudulent trading
CN109658099B (en) Account book accounting method based on block chain
CN109101830A (en) Real time data safety protecting method and system based on block chain
KR101911863B1 (en) Smart meter and remote metering system
Xu et al. Blockchain technology and smart contract for civil structural health monitoring system
KR102010571B1 (en) Method for storing smart grid heterogeneous data security using block chain
CN109547407A (en) A kind of the overall process method for tracing and block chain node of environmental monitoring data
CN104778123A (en) Method and device for detecting system performance
CN106650496A (en) Data processing method and device
KR101937090B1 (en) Method of verifying block based on block chain
CN109492432A (en) Real time data safety protecting method and system based on block chain
CN111711192A (en) Real-time line loss analysis method and system for lean management of line loss of support station area
CN109872159B (en) Block chain consensus method and architecture
CN103944874B (en) Highly reusable cloud storage data storage verification method and system
CN108596615B (en) Block chain-based certificate-storing and security-preserving notarization method and system

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