CN110474762B - Method for constructing ring-type editable block chain - Google Patents

Method for constructing ring-type editable block chain Download PDF

Info

Publication number
CN110474762B
CN110474762B CN201910777120.5A CN201910777120A CN110474762B CN 110474762 B CN110474762 B CN 110474762B CN 201910777120 A CN201910777120 A CN 201910777120A CN 110474762 B CN110474762 B CN 110474762B
Authority
CN
China
Prior art keywords
block
new
editable
block chain
ring
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
Application number
CN201910777120.5A
Other languages
Chinese (zh)
Other versions
CN110474762A (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.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN201910777120.5A priority Critical patent/CN110474762B/en
Publication of CN110474762A publication Critical patent/CN110474762A/en
Application granted granted Critical
Publication of CN110474762B publication Critical patent/CN110474762B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds

Abstract

The invention relates to a method for constructing a ring-type editable block chain, which comprises the following steps: A. initialization: outputting a system public parameter and an initial block through a hash function according to the security parameter; B. and (3) generating a secret key: obtaining a private key x of a user according to system public parametersiAnd the public key yi(ii) a C. Generating a ring type editable block chain: recording the transaction information into blocks, arranging each block according to the generation time, and connecting the last block with the initial block to form a ring type editable block chain; obtaining a public key set according to the ring type editable block chain, wherein each block corresponds to a public key yiEach public key yiCorresponding to a private key xi. The invention realizes the efficient management and editing of the block chain, can carry out batch editing on the block chain, and also supports the batch deletion of the blocks on the block chain. And the loop structure of the block chain remains unchanged after the batch editing is performed.

Description

Method for constructing ring-type editable block chain
Technical Field
The invention relates to the field of network security, in particular to a method for constructing a ring-type editable block chain.
Background
The concept of blockchains was first formally proposed in 2008 and can be used to implement public ledgers and unalterable transaction records in a decentralized environment.
The conventional block chain adopts a chain structure, namely, a new block is inserted from the tail part of the chain. However, the block chain currently faces the problems of memory consumption and scalability. That is, the data content of the block chain is too large to be stored conveniently, and the block structure is single, so that further expansion cannot be performed from the chain structure, thereby supporting more diversified services and functions. In order to solve the problem, a plurality of research projects such as a lightning payment chain are available at present for solving the problems of slow payment and expandability of the block chain, and the research of an ether house is used for expanding the block chain to support more diversified designs and functions. But all current research is based on the chain structure of block chains.
Atenise et al in 2016 proposed a renewable Blockchain-or-reusing history in bitcoin and friends, which proposed an editable block chain technique based on chameleon hash function, allowing a block to re-edit the contents of a problem block (such as illegal information or illegal transactions) while keeping the hash value unchanged, thereby ensuring safe and reliable operation of the block chain. However, this solution does not specifically mention how to implement editing of tile content in a fully decentralized environment. Furthermore, the scheme is also based on a conventional chain of linked blocks, i.e. new blocks are inserted from the end of the chain. Therefore, once a certain block needs to be edited again, all blockchains after the block need to be traversed, and the calculation cost for editing is enormous (especially considering the length of the current blockchain, the traversal difficulty and complexity of tens of thousands of blockchains). In addition, the editable blockchain is based on a traditional chained blockchain, and cannot achieve better function expansion. Thus, for the reasons described above, the application prospects of editable blockchains are limited.
Disclosure of Invention
The invention provides a method for constructing a ring-type editable blockchain, which is used for safely and efficiently managing and editing the blockchain in a decentralized environment and providing a wider application scene for the blockchain through a ring-type structure.
The invention relates to a method for constructing a ring-type editable block chain, which comprises the following steps:
A. initialization: outputting a system public parameter P and an initial block B through a hash function according to a security parameter lambda1(Genesis Block); the security parameter lambda is a parameter which is input by an initialization party according to needs in a system initialization stage, and the parameter is widely embodied in the setting of any existing password schemeThe counter is a known parameter, and is typically the selected key length (e.g., 128256 bits, etc.). The initiator may be the system owner, or the user who needs to run the algorithm, etc.
B. And (3) generating a secret key: according to the system public parameter P, calculating to obtain the private key x of the useriAnd the public key yiWherein i is more than or equal to 1 and less than or equal to n, and n is the total number of blocks for generating the block chain; the users include any miners (who are responsible for transaction confirmation and data packaging in the blockchain) or any users who join the blockchain network.
C. Generating a ring type editable block chain: recording the transaction information into blocks, arranging the blocks according to the generation time, and arranging the last block and the initial block B1Connected to form a ring-type editable block chain RCn(ii) a According to the ring type editable block chain RCnGet the public key set L ═ { y ═ yi}1≤i≤nWherein each block BiCorresponding to one said public key yiEach public key yiCorresponding to one of said private keys xi
The invention can provide efficient management and editing for the block chain by combining a ring-type novel block chain structure with a chameleon hash function. Under the support of the ring structure, batch editing on the block chain can be realized, and batch deletion of blocks on the block chain is also supported. And the loop structure of the block chain remains unchanged after the batch editing is performed. A wider application scene is provided for the block chain through the ring structure. For example, application scenarios based on ring or group signatures can be implemented by being portable to block chains in a ring structure, such as ring signatures, group signatures, anonymous voting, and the like.
Furthermore, through the ring structure of the block chain, batch editing and deleting of the blocks are realized, and the method comprises the following steps:
D. verifying ring type editable block chains: calculating according to a verification formula of the block chain and then outputting a verification result;
E. add new blocks to the circular block chain: according to the ring type editable block chain RCnAnd need toBlock { B'i}n+1≤i≤n+kAnd outputting a new ring type editable block chain RC after calculationn+kOr adding a failed identifier, wherein k is the number of new blocks needing to be added;
F. editing a ring type block chain: according to the ring type editable block chain RCnAnd the user's private key set xi}1≤i≤nBy recalculating new chameleon random value r 'for each tile'iChanging the contents of each block to different chameleon hash values
Figure BDA0002175432960000021
The same, set the original blocks { B }i}1≤i≤nEdit as a new set of tiles { B'i}1≤i≤nOutput edited ring-type editable Block chain RC'n
G. Ring reconstruction: from said circular editable block chain RCnAfter d blocks are deleted, the reconstructed ring type editable block chain RC is outputn-dWherein d is a ring-type editable block chain RCnThe number of blocks to be deleted, and n-2>d。
Specifically, the step a comprises:
A1. selecting a group G with a generator G and a group order q according to a safety parameter lambda;
A2. the hash functions are set as follows: h1:{0,1}*→ G and H2:{0,1}*→ZqWherein H is1Is a first hash function, which is used to form a character string {0,1} of any length with 0 or 1*Mapping to an arbitrary element of the group G, representing the character string {0,1} as an arbitrary length, H2Is a second hash function, and is used for forming a character string {0,1} of any length by 0 or 1*Integer group Z mapped to q-th order composed of (0,1, …, q-1) elementsqIn the above, Z represents an integer group;
A3. output system public parameter P ═<G,q,g,H1,H2>;
A4. Generating an initial block B1Writing the system public parameter P intoStarting block B1
Specifically, the private key x of the user is calculated in the step BiAnd the public key yiComprises the following steps: selecting a random number according to the system public parameter P
Figure BDA0002175432960000031
As the private key x of the useriR represents an integer group Z of order qqIn randomly selecting an element xiAccording to said private key xiComputing public keys
Figure BDA00021754329600000315
Specifically, the step C includes: packaging the transaction information of the current time period, recording the transaction information into a block, and recording the block { B }i}1≤i≤nArranging according to the sequence of the generation time, and arranging the last block BnAnd the initial block B1Are connected to form B1||…||Bn||B1And then by calculating { Bi}1≤i≤nTo obtain a ring-type editable blockchain
Figure BDA0002175432960000032
Wherein, c1Is to initialize a block B1For the calculation parameters of the ring start, array { Bi,riiThe elements in the sequence represent the ith block BiThe chameleon random value and the normal random value, indicating that L is a public key set for generating the tile,
Figure BDA0002175432960000033
indicates that the binding is the latest block BnCorresponding private key xnWherein H ═ H1(L) passing the set of public keys L through a first hash function H1One element mapped onto group G, (u, v) is the calculation parameter for inserting a new block.
Specifically, the calculation { B }i}1≤i≤nThe hash value of (d) is:
C1. calculating H as H1(L) and
Figure BDA00021754329600000314
selecting two random numbers
Figure BDA0002175432960000034
Calculating an initial block B1Is calculated as a parameter
Figure BDA0002175432960000035
(u, v) are calculated parameters for inserting a new block;
C2. selecting two random numbers
Figure BDA0002175432960000036
Wherein i is (1, …, n-1), calculating chameleon random value
Figure BDA0002175432960000037
And chameleon hash value
Figure BDA0002175432960000038
Wherein B isiFor the content of the ith block, the block B is calculated againi+1Is calculated as a parameter
Figure BDA0002175432960000039
According to the characteristics of ring structure ending connection, c is obtainedn+1=c1
C3. Calculate the nth block BnRandom number alpha ofn=(u-xncnmod q),βn=(v-xncnmod q) to obtain the nth block BnChameleon random value of
Figure BDA00021754329600000310
When operating on the blockchain, step D comprises: for ring type editable block chain with length n
Figure BDA00021754329600000311
Wherein, c1Is an initial block B1The calculated parameter of (1), array { Bi,riiThe elements in the sequence represent the ith block BiThe chameleon random value and the normal random value, indicating that L is a public key set for generating the tile,
Figure BDA00021754329600000312
indicates that the binding is the latest block BnCorresponding private key xnWherein H ═ H1(L) passing the set of public keys L through a first hash function H1One element mapped onto group G, (u, v) is the calculation parameter for inserting a new block;
respectively setting a first hash function H1:{0,1}*→ G and a second hash function H2:{0,1}*→ZqQ is the group order, and H is calculated as H1(L), H represents passing the set of public keys L through a first hash function H1Mapping to an element of group G according to the ith block BiChameleon random value of
Figure BDA00021754329600000313
αi=(u-xicimod q),ciIs a block BiThe calculation parameters of (2); calculating a corresponding chameleon hash value
Figure BDA0002175432960000041
And block Bi+1Is calculated as a parameter
Figure BDA0002175432960000042
The equation is then verified:
Figure BDA0002175432960000043
and
Figure BDA0002175432960000044
and whether all the signals are true or not is judged, if yes, 1 is output, and if not, 0 is output.
Specifically, the step E includes:
E1. adding a new public key to a public key setCombining L to generate new public key set L' ═ L | { yi}n+1≤i≤n+kCalculating H ═ H1(L') and binding the newest tile Bn+kCorresponding private key xn+kNew parameters
Figure BDA0002175432960000045
Get block B1New calculation parameters
Figure BDA0002175432960000046
Figure BDA0002175432960000047
g is a generator;
E2. calculating a new chameleon hash value
Figure BDA0002175432960000048
αi=(u-xicimod q), i ═ 1, …, n, and then block B is computedi+1New calculation parameters
Figure BDA0002175432960000049
βi=(v-xicimod q);
E3. Selecting two random numbers
Figure BDA00021754329600000410
i ═ n +1, …, n + k), and chameleon random values were calculated
Figure BDA00021754329600000411
And a new chameleon hash value
Figure BDA00021754329600000412
BiIs the content of the ith block, and then the block B is obtainedi+1New calculation parameters
Figure BDA00021754329600000413
E4. For i n + k, block B is calculatedn+kCorresponding random number alphan+k=(u-xn+kc′n+kmod q) and its corresponding ordinary random value βn+k=(v-xn+kc′n+kmod q), and corresponding chameleon random values
Figure BDA00021754329600000414
E5. Verification equation
Figure BDA00021754329600000415
And
Figure BDA00021754329600000416
Figure BDA00021754329600000417
whether all the blocks are true or not, and if all the blocks are true, the new blocks { B'i}n+1≤i≤n+kSuccessfully added, and a new block { B 'is inserted into the output'i}n+1≤i≤n+kBack loop editable blockchains
Figure BDA00021754329600000418
Otherwise, outputting an insertion failure identifier.
Specifically, the step F includes: with the length of n and the block set as { Bi}1≤i≤nCircular editable blockchains
Figure BDA00021754329600000419
Figure BDA00021754329600000420
I is more than or equal to 1 and less than or equal to n according to the private key set { xi}1≤i≤nCalculating new chameleon random value
Figure BDA00021754329600000421
Make each new chameleon hash value
Figure BDA00021754329600000428
The same, namely:
Figure BDA00021754329600000422
then outputs a new block set of length n and new block set of { B'i}1≤i≤nCircular editable blockchains
Figure BDA00021754329600000423
Specifically, in step G, the ring-type editable blockchain with the length of n
Figure BDA00021754329600000424
Deleting d blocks, comprising the steps of:
G1. calculation loop type editable block chain RCnAfter d blocks are deleted, the public key set L ″ ═ L \ y { y } of the new ring-type editable block chain formed by the remaining blocksi}i≤|n-d|、h=H1(L') and
Figure BDA00021754329600000425
wherein x isn-d-1The private key corresponding to the most front end block of the new ring type editable block chain is represented,
Figure BDA00021754329600000426
denotes xn-d-1Corresponding parameters;
G2. according to H ″, H1(L') calculating parameters of the private key corresponding to the new ring-type editable block chain
Figure BDA00021754329600000427
And calculate
Figure BDA00021754329600000429
Where H "represents passing the public key set L" of the new ring-type editable block chain through the first hash function H1One element, c ", mapped to group G1For calculating parameters starting from one of the blocks in the new ring-type editable block chain, guRepresenting the calculation of a variable of a new ring type editable block chain, wherein u and v are random numbers for realizing a block chain ring type structure respectively;
G3. respectively calculating the hash values of the new chameleon
Figure BDA0002175432960000051
And
Figure BDA0002175432960000052
i is (1, …, n-d-2), and the random number alpha corresponding to the most front block of the new loop type editable block chain is calculatedn-d-1=(u-xn-d- 1c″n-d-1mod q), block Bn-d-1Corresponding ordinary random value betan-d-1=(v-xn-d-1c″n-d-1mod q) to obtain a block Bn-d-1Chameleon random value of
Figure BDA0002175432960000053
G4. Verification equation
Figure BDA0002175432960000054
And
Figure BDA0002175432960000055
if yes, representing block chain reconstruction engineering, and outputting reconstructed new ring type editable block chain
Figure BDA0002175432960000056
Otherwise, a failure flag is output.
The method for constructing the ring-type editable block chain can realize batch editing, adding or deleting of the blocks, effectively improve the editing efficiency of the block chain, reduce the editing difficulty, expand the application scene of the block chain and improve the expandability of the block chain by using automatic execution modes such as intelligent contract and the like.
The present invention will be described in further detail with reference to the following examples. This should not be understood as limiting the scope of the above-described subject matter of the present invention to the following examples. Various substitutions and alterations according to the general knowledge and conventional practice in the art are intended to be included within the scope of the present invention without departing from the technical spirit of the present invention as described above.
Drawings
FIG. 1 is a flowchart illustrating a method for constructing a chain of ring-type editable blocks according to the invention.
Detailed Description
As shown in fig. 1, the method for constructing a circular editable block chain according to the present invention includes:
A. initialization:
A1. selecting a group G with a generator G and a group order q according to a safety parameter lambda;
A2. the hash functions are set as follows: h1:{0,1}*→ G and H2:{0,1}*→ZqWherein H is1Is a first hash function, which is used to form a character string {0,1} of any length with 0 or 1*Mapping to an arbitrary element of the group G, representing the character string {0,1} as an arbitrary length, H2Is a second hash function, and is used for forming a character string {0,1} of any length by 0 or 1*Integer group Z mapped to q-th order composed of (0,1, …, q-1) elementsqIn the above, Z represents an integer group;
A3. output system public parameter P ═<G,q,g,H1,H2>;
A4. Generating an initial block B1(Genesis Block), writing the system disclosure parameter P into the initial Block B1
B. And (3) generating a secret key: computing a private key x of a useriAnd the public key yi: selecting a random number according to the system public parameter P
Figure BDA0002175432960000057
As the private key x of the useriR represents an integer group Z of order qqIn randomly selecting an element xiAccording to said private key xiComputing public keys
Figure BDA0002175432960000061
Wherein i is more than or equal to 1 and less than or equal to n, and n is the total number of blocks for generating the block chain; the users include any miners (responsible for transaction confirmation and data packaging in the blockchain) or any joiningUsers of a blockchain network.
C. Generating a ring type editable block chain: packaging the transaction information of the current time period, recording the transaction information into a block, and recording the block { B }i}1≤i≤n(n is more than or equal to 3, otherwise, the end-to-end rings cannot be formed) are arranged according to the sequence of the generation time, and the last block B to be arranged is arrangednAnd the initial block B1Are connected to form B1||…||Bn||B1And then by calculating { Bi}1≤i≤nTo obtain a ring-type editable blockchain
Figure BDA0002175432960000062
Wherein, c1Is to initialize a block B1For the calculation parameters of the ring start, array { Bi,riiThe elements in the sequence represent the ith block BiThe contents of (a), chameleon random values and normal random values,
Figure BDA0002175432960000063
indicates that the binding is the latest block BnCorresponding private key xnL ═ yi}1≤i≤nTo generate a set of public keys for a tile, each tile BiCorresponding to one said public key yiEach public key yiCorresponding to one of said private keys xi,h=H1(L) passing the set of public keys L through a first hash function H1One element mapped onto group G, (u, v) is the calculation parameter for inserting a new block. Wherein { B is calculatedi}1≤i≤nThe hash value of (d) is:
C1. calculating H as H1(L) and
Figure BDA0002175432960000064
selecting two random numbers
Figure BDA0002175432960000065
Calculating an initial block B1Is calculated as a parameter
Figure BDA0002175432960000066
(u, v) are calculated parameters for inserting a new block;
C2. selecting two random numbers
Figure BDA0002175432960000067
Wherein i is (1, …, n-1), calculating chameleon random value
Figure BDA0002175432960000068
And chameleon hash value
Figure BDA0002175432960000069
Wherein B isiFor the content of the ith block, the block B is calculated againi+1Is calculated as a parameter
Figure BDA00021754329600000610
According to the characteristics of ring structure ending connection, c is obtainedn+1=c1
C3. Calculate the nth block BnRandom number alpha ofn=(u-xncnmod q),βn=(v-xncnmod q) to obtain the nth block BnChameleon random value of
Figure BDA00021754329600000611
Through the ring type structure of the block chain, the batch editing and deleting of the blocks are realized, and the method comprises the following steps:
D. verifying ring type editable block chains: for ring type editable block chain with length n
Figure BDA00021754329600000612
Wherein, c1Is an initial block B1The calculated parameter of (1), array { Bi,riiThe elements in the sequence represent the ith block BiThe contents of (a), chameleon random values and normal random values,
Figure BDA00021754329600000613
indicating that the binding is up-to-dateBlock BnCorresponding private key xnL is the set of public keys for generating the block, H ═ H1(L) passing the set of public keys L through a first hash function H1One element mapped onto group G, (u, v) is the calculation parameter for inserting a new block;
respectively setting a first hash function H1:{0,1}*→ G and a second hash function H2:{0,1}*→ZqQ is the group order, and H is calculated as H1(L) passing the public key set L through a first hash function H1Mapping to group G according to ith block BiChameleon random value of
Figure BDA00021754329600000614
αi=(u-xicimod q),ciIs a block BiThe calculation parameters of (2); calculating a corresponding chameleon hash value
Figure BDA0002175432960000071
And block Bi+1Is calculated as a parameter
Figure BDA0002175432960000072
The equation is then verified:
Figure BDA0002175432960000073
and
Figure BDA0002175432960000074
and whether all the signals are true or not is judged, if yes, 1 is output, and if not, 0 is output.
E. Add new blocks to the circular block chain: ring-oriented editable block chain RCnAdding a new block { B'i}n+1≤i≤n+kWherein k is the number of new blocks to be added, and the steps are as follows:
E1. adding a new public key to the public key set L to generate a new public key set L' ═ L | { yi}n+1≤i≤n+kCalculating H ═ H1(L'), calculating the latest binding block Bn+kCorresponding private key xn+kNew parameters
Figure BDA0002175432960000075
Get block B1New calculation parameters
Figure BDA0002175432960000076
g is a generator;
E2. calculating a new chameleon hash value
Figure BDA0002175432960000077
αi=(u-xicimod q), i ═ 1, …, n, and then block B is computedi+1New calculation parameters
Figure BDA0002175432960000078
βi=(v-xicimod q);
E3. Selecting two random numbers
Figure BDA0002175432960000079
i ═ n +1, …, n + k), and chameleon random values were calculated
Figure BDA00021754329600000710
And a new chameleon hash value
Figure BDA00021754329600000711
BiIs the content of the ith block, and then the block B is obtainedi+1New calculation parameters
Figure BDA00021754329600000712
E4. For i n + k, block B is calculatedn+kCorresponding random number alphan+k=(u-xn+kc′n+kmod q) and its corresponding ordinary random value βn+k=(v-xn+kc′n+kmod q), and corresponding chameleon random values
Figure BDA00021754329600000713
E5. Verification equation
Figure BDA00021754329600000714
And
Figure BDA00021754329600000715
whether all the blocks are true or not, and if all the blocks are true, the new blocks { B'i}n+1≤i≤n+kSuccessfully added, and a new block { B 'is inserted into the output'i}n+1≤i≤n+kBack loop editable blockchains
Figure BDA00021754329600000716
Otherwise, outputting an insertion failure identifier 0.
F. Editing a ring type block chain: with the length of n and the block set as { Bi}1≤i≤nCircular editable blockchains
Figure BDA00021754329600000717
Figure BDA00021754329600000718
I is more than or equal to 1 and less than or equal to n according to the private key set { xi}1≤i≤nCalculating new chameleon random value
Figure BDA00021754329600000719
Make each new chameleon hash value
Figure BDA00021754329600000720
The same, namely:
Figure BDA00021754329600000721
therefore, the blocks can be edited on the premise of not influencing the consistency of the hash values of the blocks. Then outputs a new block set of length n and new block set of { B'i}1≤i≤nCircular editable blockchains
Figure BDA00021754329600000722
Figure BDA00021754329600000723
G. Ring reconstruction: from a ring of length n editable blockchains
Figure BDA00021754329600000724
N-2 blocks of medium deletion>d, the steps are as follows:
G1. calculation loop type editable block chain RCnAfter d blocks are deleted, the public key set L ″ ═ L \ y { y } of the new ring-type editable block chain formed by the remaining blocksi}i≤|n-d|、h=H1(L') and
Figure BDA00021754329600000725
wherein x isn-d-1The private key corresponding to the most front end block of the new ring type editable block chain is represented,
Figure BDA0002175432960000081
denotes xn-d-1Corresponding parameters;
G2. according to H ″, H1(L') calculating parameters of the private key corresponding to the new ring-type editable block chain
Figure BDA0002175432960000082
And calculate
Figure BDA0002175432960000083
Where H "represents passing the public key set L" of the new ring-type editable block chain through the first hash function H1One element, c ", mapped to group G1For calculating parameters starting from one of the blocks in the new ring-type editable block chain, guRepresenting the calculation of a variable of a new ring type editable block chain, wherein u and v are random numbers for realizing a block chain ring type structure respectively;
G3. respectively calculating the hash values of the new chameleon
Figure BDA0002175432960000084
And
Figure BDA0002175432960000085
i is (1, …, n-d-2), and the random number alpha corresponding to the most front block of the new loop type editable block chain is calculatedn-d-1=(u-xn-d- 1c″n-d-1mod q), block Bn-d-1Corresponding ordinary random value betan-d-1=(v-xn-d-1c″n-d-1mod q) to obtain a block Bn-d-1Chameleon random value of
Figure BDA0002175432960000086
G4. Verification equation
Figure BDA0002175432960000087
And
Figure BDA0002175432960000088
if yes, representing block chain reconstruction engineering, and outputting reconstructed new ring type editable block chain
Figure BDA0002175432960000089
Otherwise, outputting a failure identification.
Through a ring type block chain structure and a chameleon hash function, efficient management and editing of the block chain are achieved, batch editing can be performed on the block chain, and batch deletion of blocks on the block chain is supported. And the loop structure of the block chain remains unchanged after the batch editing is performed.

Claims (8)

1. The method for constructing the ring-type editable block chain is characterized by comprising the following steps:
A. initialization: according to security parameters
Figure DEST_PATH_IMAGE001
Outputting system public parameters through a hash functionPAnd an initial blockB 1
A1. According to security parameters
Figure DEST_PATH_IMAGE002
Select the generator as
Figure DEST_PATH_IMAGE003
And the group order is
Figure DEST_PATH_IMAGE004
Group (2)
Figure DEST_PATH_IMAGE005
A2. The hash functions are set as follows:
Figure DEST_PATH_IMAGE006
and
Figure DEST_PATH_IMAGE007
wherein, in the step (A),H 1is a first hash function, which is used to form a character string {0,1} of any length with 0 or 1*Mapping to a groupGIndicates that the character string 0,1 is of any length,H 2is a second hash function, and is used for forming a character string {0,1} of any length by 0 or 1*Mapping to a map of the data represented by (0,1, …,q-1) of elementsqInteger group of ordersZ q In the above-mentioned manner,Zrepresents an integer group;
A3. outputting system disclosure parameters
Figure DEST_PATH_IMAGE008
A4. Generating an initial blockB 1Exposing parameters of the systemPWriting to an initial blockB 1
B. And (3) generating a secret key: disclosing parameters according to the systemPCalculating to obtain the private key of the user
Figure DEST_PATH_IMAGE009
And public key
Figure DEST_PATH_IMAGE010
Wherein i is more than or equal to 1 and less than or equal to n, and n is the total number of blocks for generating the block chain;
C. generating a ring type editable block chain: recording the transaction information into blocks, arranging the blocks according to the generation time, and arranging the last block and the initial blockB 1Connected to form a ring-type editable block chain
Figure DEST_PATH_IMAGE011
(ii) a According to the ring type editable block chain
Figure 503567DEST_PATH_IMAGE011
Obtaining a public key set
Figure DEST_PATH_IMAGE012
Wherein each blockB i Corresponding to one of said public keysy i Each public keyy i Corresponding to one of said private keysx i
D. Verifying ring type editable block chains: calculating according to a verification formula of the block chain and then outputting a verification result;
E. add new blocks to the circular block chain: according to the ring type editable block chain
Figure 502266DEST_PATH_IMAGE011
And blocks that need to be newly added
Figure DEST_PATH_IMAGE013
Outputting new ring type editable block chain after calculation
Figure DEST_PATH_IMAGE014
Or an identification of a failure to add a new block, whereinkThe number of new blocks needing to be added;
F. editing a ring type block chain: editable blockchains according to ring type
Figure 265691DEST_PATH_IMAGE011
And a user's private key set
Figure DEST_PATH_IMAGE015
By recalculating new chameleon random values for each tile
Figure DEST_PATH_IMAGE016
Changing the contents of each block to different chameleon hash values
Figure DEST_PATH_IMAGE017
The same, the original blocks are collected
Figure DEST_PATH_IMAGE018
Editing into a new set of blocks
Figure DEST_PATH_IMAGE019
Outputting the edited ring-type editable block chain
Figure DEST_PATH_IMAGE020
G. Ring reconstruction: from said circular editable blockchain
Figure 320889DEST_PATH_IMAGE011
Deletion indAfter each block, outputting the reconstructed ring-type editable block chain
Figure DEST_PATH_IMAGE021
WhereindEditable blockchains in a ring form
Figure 837058DEST_PATH_IMAGE011
The number of blocks to be deleted, and
Figure DEST_PATH_IMAGE022
2. the method of claim 1, wherein the method comprises: calculating the private key of the user in the step B
Figure 853994DEST_PATH_IMAGE009
And public key
Figure 543864DEST_PATH_IMAGE010
Comprises the following steps: disclosing parameters according to the systemPSelecting a random number
Figure DEST_PATH_IMAGE023
As private key of user
Figure 178982DEST_PATH_IMAGE009
RRepresents fromqInteger group of ordersZ q In which an element is randomly selectedx i According to said private key
Figure 273627DEST_PATH_IMAGE009
Computing public keys
Figure DEST_PATH_IMAGE024
3. The method of claim 2, wherein the method comprises: the step C comprises the following steps: packaging the transaction information of the current time period, recording the transaction information into a block, and recording the block
Figure DEST_PATH_IMAGE025
Arranging in the order of generation time, and arranging the last blockB nAnd the initial blockB 1Are connected to form
Figure DEST_PATH_IMAGE026
End-to-end ring structures of, then by calculation
Figure 172051DEST_PATH_IMAGE025
To obtain a ring-type editable blockchain
Figure DEST_PATH_IMAGE027
Wherein, in the step (A),
Figure DEST_PATH_IMAGE028
is to start the blockB 1For calculating parameters of the ring start, array
Figure DEST_PATH_IMAGE029
The elements in (1) sequentially represent the ith blockB iThe contents of (a), chameleon random values and normal random values,Lto generate the set of public keys for the block,
Figure DEST_PATH_IMAGE030
indicating the latest binding blockB nCorresponding private keyx n Wherein
Figure DEST_PATH_IMAGE031
Denotes the aggregation of public keysLBy a first hash functionH 1Mapping to a groupGOne of the elements of (a) above,
Figure DEST_PATH_IMAGE032
are the calculated parameters for inserting a new block.
4. The method of claim 3, wherein the method comprises: the calculation
Figure 179844DEST_PATH_IMAGE025
The hash value of (d) is:
C1. computing
Figure DEST_PATH_IMAGE033
And
Figure DEST_PATH_IMAGE034
selecting two random numbers
Figure DEST_PATH_IMAGE035
Calculating an initial blockB 1Is calculated as a parameter
Figure DEST_PATH_IMAGE036
Figure DEST_PATH_IMAGE037
Is a calculation parameter for inserting a new block;
C2. selecting two random numbers
Figure DEST_PATH_IMAGE038
Wherein
Figure DEST_PATH_IMAGE039
Calculating chameleon random value
Figure DEST_PATH_IMAGE040
And chameleon hash value
Figure DEST_PATH_IMAGE041
Wherein
Figure DEST_PATH_IMAGE042
For the content of the ith block, the block is recalculatedB i+1Is calculated as a parameter
Figure DEST_PATH_IMAGE043
According to the characteristics of ring structure ending connection
Figure DEST_PATH_IMAGE044
C3. Calculating the nth blockB nRandom number of
Figure DEST_PATH_IMAGE045
mod
Figure DEST_PATH_IMAGE046
Figure DEST_PATH_IMAGE047
mod
Figure DEST_PATH_IMAGE048
To obtain the nth blockB nChameleon random value of
Figure DEST_PATH_IMAGE049
5. The method of claim 1, wherein the method comprises: the step D comprises the following steps: for ring type editable block chain with length n
Figure DEST_PATH_IMAGE050
Wherein, in the step (A),
Figure DEST_PATH_IMAGE051
is an initial blockB 1Of the calculation parameters, array
Figure DEST_PATH_IMAGE052
The elements in (1) sequentially represent the ith blockB iContent, chameleon random value and ordinary random value ofLTo generate the set of public keys for the block,
Figure DEST_PATH_IMAGE054
indicating the latest binding blockB nCorresponding private keyx n Wherein
Figure 795151DEST_PATH_IMAGE033
Denotes the aggregation of public keysLBy a first hash functionH 1Mapping to a groupGOne of the elements of (a) above,
Figure 239908DEST_PATH_IMAGE037
is a calculation parameter for inserting a new block;
respectively setting a first hash function:
Figure 948714DEST_PATH_IMAGE006
and a second hash function
Figure 347596DEST_PATH_IMAGE007
qFor the group order, calculate
Figure DEST_PATH_IMAGE055
hRepresenting a collection of public keysLBy a first hash functionH 1Mapping to a groupGAn element of (1), according to the ith blockB iChameleon random value of
Figure 595956DEST_PATH_IMAGE040
Figure DEST_PATH_IMAGE056
mod
Figure 580705DEST_PATH_IMAGE046
c i Is a blockB iThe calculation parameters of (2); calculating a corresponding chameleon hash value
Figure 197762DEST_PATH_IMAGE041
And the blockB i+1Is calculated as a parameter
Figure DEST_PATH_IMAGE057
The equation is then verified:
Figure DEST_PATH_IMAGE058
Figure DEST_PATH_IMAGE059
and, and
Figure DEST_PATH_IMAGE060
and whether all the signals are true or not is judged, if yes, 1 is output, and if not, 0 is output.
6. The method of claim 5, wherein: the step E comprises the following steps:
E1. adding a new public key to a public key setLGenerating a new public key set
Figure DEST_PATH_IMAGE061
Calculating
Figure DEST_PATH_IMAGE062
And binding the latest blockB n+kCorresponding private keyx n+k New parameters
Figure DEST_PATH_IMAGE063
Obtaining a blockB 1New calculation parameters
Figure DEST_PATH_IMAGE064
Figure 881945DEST_PATH_IMAGE003
To generate a primitive;
E2. calculating a new chameleon hash value
Figure DEST_PATH_IMAGE065
Figure DEST_PATH_IMAGE066
mod
Figure DEST_PATH_IMAGE067
Figure DEST_PATH_IMAGE068
Then calculate the blockB i+1New calculation parameters
Figure DEST_PATH_IMAGE069
Figure DEST_PATH_IMAGE070
mod
Figure DEST_PATH_IMAGE071
E3. Selecting two random numbers
Figure DEST_PATH_IMAGE072
Figure DEST_PATH_IMAGE073
Calculating chameleon random value
Figure DEST_PATH_IMAGE074
And a new chameleon hash value
Figure DEST_PATH_IMAGE075
B i Is the content of the ith block, and then the block is obtainedB i+1New calculation parameters
Figure 752355DEST_PATH_IMAGE069
E4. For i = n + k, the block is calculatedB n+k Corresponding random number
Figure DEST_PATH_IMAGE076
mod
Figure 686551DEST_PATH_IMAGE071
And its corresponding ordinary random value
Figure DEST_PATH_IMAGE077
mod
Figure 87226DEST_PATH_IMAGE071
And the corresponding chameleon random value
Figure DEST_PATH_IMAGE078
E5. Verification equation
Figure DEST_PATH_IMAGE079
Figure DEST_PATH_IMAGE080
And
Figure DEST_PATH_IMAGE081
if all are true, the new block is determined
Figure 448982DEST_PATH_IMAGE013
Successful joining, output insertion new block
Figure 488744DEST_PATH_IMAGE013
Back loop editable blockchains
Figure DEST_PATH_IMAGE082
Otherwise, outputting an insertion failure identifier.
7. The method of claim 6, wherein: the step F comprises the following steps: the block set with the length of n is
Figure DEST_PATH_IMAGE083
Circular editable blockchains
Figure DEST_PATH_IMAGE084
Figure DEST_PATH_IMAGE085
From a set of private keys
Figure DEST_PATH_IMAGE086
Calculating new chameleon random value
Figure DEST_PATH_IMAGE087
Make each new chameleon hash value
Figure DEST_PATH_IMAGE088
The same, namely:
Figure DEST_PATH_IMAGE089
then, a new block set with the length of n and a new block set with the length of n are output
Figure DEST_PATH_IMAGE090
Circular editable blockchains
Figure DEST_PATH_IMAGE091
8. The method of claim 7, wherein: in step G, the chain of editable blocks is formed from a circular chain of length n
Figure 471523DEST_PATH_IMAGE027
Deletion indA block comprising the steps of:
G1. computing endless editable blockchains
Figure DEST_PATH_IMAGE092
Delete itdAfter each block, the public key set of the new ring type editable block chain formed by the rest blocks
Figure DEST_PATH_IMAGE093
,、
Figure DEST_PATH_IMAGE094
And
Figure DEST_PATH_IMAGE095
wherein, in the step (A),
Figure DEST_PATH_IMAGE096
the private key corresponding to the most front end block of the new ring type editable block chain is represented,
Figure DEST_PATH_IMAGE097
to represent
Figure 903817DEST_PATH_IMAGE096
Corresponding parameters;
G2. according to
Figure DEST_PATH_IMAGE098
Calculating the parameters of the private key corresponding to the new ring type editable block chain
Figure DEST_PATH_IMAGE099
And calculate
Figure DEST_PATH_IMAGE100
Wherein
Figure DEST_PATH_IMAGE101
Public key set representing a chain of editable blocks with new ring types
Figure DEST_PATH_IMAGE102
By a first hash functionH 1Mapping to a groupGOne of the elements of (a) above,
Figure DEST_PATH_IMAGE103
to calculate parameters starting from one of the blocks in the new ring-type editable block chain,
Figure DEST_PATH_IMAGE104
a variable representing the calculation of a new ring-type editable block chain,uandvrespectively random numbers for realizing the block chain-ring structure;
G3. respectively calculating the hash values of the new chameleon
Figure DEST_PATH_IMAGE105
And are and
Figure DEST_PATH_IMAGE106
Figure DEST_PATH_IMAGE107
calculating the random number corresponding to the most front block of the new ring type editable block chain
Figure DEST_PATH_IMAGE108
mod q) Block, blockB n-d-1 Corresponding ordinary random value
Figure DEST_PATH_IMAGE109
mod
Figure DEST_PATH_IMAGE110
) Obtaining a blockB n-d-1 Chameleon random value of
Figure DEST_PATH_IMAGE111
G4. Verification equation
Figure DEST_PATH_IMAGE112
Figure DEST_PATH_IMAGE113
And
Figure DEST_PATH_IMAGE114
if yes, representing block chain reconstruction engineering and outputting reconstructionNew ring-style editable blockchains
Figure DEST_PATH_IMAGE115
Otherwise, outputting a failure identification.
CN201910777120.5A 2019-08-22 2019-08-22 Method for constructing ring-type editable block chain Active CN110474762B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910777120.5A CN110474762B (en) 2019-08-22 2019-08-22 Method for constructing ring-type editable block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910777120.5A CN110474762B (en) 2019-08-22 2019-08-22 Method for constructing ring-type editable block chain

Publications (2)

Publication Number Publication Date
CN110474762A CN110474762A (en) 2019-11-19
CN110474762B true CN110474762B (en) 2021-05-25

Family

ID=68513529

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910777120.5A Active CN110474762B (en) 2019-08-22 2019-08-22 Method for constructing ring-type editable block chain

Country Status (1)

Country Link
CN (1) CN110474762B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11323246B2 (en) 2019-12-11 2022-05-03 The Bank Of New York Mellon Ring chain architecture
CN111339185B (en) * 2020-02-13 2023-12-15 北京工业大学 Incomplete decentralization method based on block chain technology
CN112272092B (en) * 2020-08-30 2021-07-27 河南大学 Data editing method applied to block chain
CN112884477B (en) * 2020-11-10 2022-08-19 支付宝(杭州)信息技术有限公司 Block chain transaction initiating method and system
CN113225324B (en) * 2021-04-26 2022-10-04 安徽中科晶格技术有限公司 Block chain anonymous account creation method, system, device and storage medium
CN113536389B (en) * 2021-06-15 2022-05-20 复旦大学 Fine-grained controllable decentralized editable block chain construction method and system
CN114417429B (en) * 2022-04-02 2022-06-07 湖南宸瀚科技有限公司 Editable block chain system based on ring type verification

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109067547A (en) * 2018-09-21 2018-12-21 北京计算机技术及应用研究所 A kind of block chain method for secret protection based on disposable ring signatures
CN110061850A (en) * 2019-04-24 2019-07-26 电子科技大学 The collision calculation method and editable block chain building method of chameleon hash function
CN110071812A (en) * 2019-04-29 2019-07-30 电子科技大学 A kind of editable can link, the ring signatures method of non-repudiation

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9785369B1 (en) * 2016-05-23 2017-10-10 Accenture Global Solutions Limited Multiple-link blockchain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109067547A (en) * 2018-09-21 2018-12-21 北京计算机技术及应用研究所 A kind of block chain method for secret protection based on disposable ring signatures
CN110061850A (en) * 2019-04-24 2019-07-26 电子科技大学 The collision calculation method and editable block chain building method of chameleon hash function
CN110071812A (en) * 2019-04-29 2019-07-30 电子科技大学 A kind of editable can link, the ring signatures method of non-repudiation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
可更改区块链技术研究;李佩丽 等;《密码学报》;20181031;第5卷(第5期);全文 *

Also Published As

Publication number Publication date
CN110474762A (en) 2019-11-19

Similar Documents

Publication Publication Date Title
CN110474762B (en) Method for constructing ring-type editable block chain
JP6955026B2 (en) Systems and methods for parallel processing blockchain transactions
US10887096B2 (en) Methods and apparatus for a distributed database including anonymous entries
CN110061850B (en) Collision calculation method of chameleon hash function and editable block chain construction method
US11509482B2 (en) Parameterisable smart contracts
CN110046894B (en) Erasure code-based block chain establishing method capable of reconstructing groups
CN108615156A (en) A kind of data structure based on block chain
CN112862490B (en) Output consensus method under asynchronous network
CN109245878B (en) Method and device for generating new blocks of block chain and readable storage medium
TWI742586B (en) Methods and devices for providing traversable key-value data storage on blockchain
CN107181797A (en) The block compression method and system of a kind of block chain
CN110730963A (en) System and method for information protection
CN113726751A (en) Weight management method, device and equipment in block chain type account book
US20220044241A1 (en) Achieving Decentralized Blockchain Consensus Using A State Function Driven Protocol
Avin et al. Random preferential attachment hypergraph
CN114328518A (en) UTXO model-based low storage consumption method and system
CN111292190A (en) Transaction generation method, block creation method, related device and equipment
CN110365493B (en) Multi-form derivable annular block chain construction method
CN110162659B (en) Fixed-rhythm new music generation method based on pitch network
Azzolini et al. Modeling Bitcoin Protocols with Probabilistic Logic Programming.
CN111177263A (en) Block chain consensus method and node
CN112632187B (en) Attribute hiding and canceling method based on counting bloom filter
CN111414421A (en) Sectional type block chain storage method and storage device
CN113810185A (en) Anti-trapdoor leakage on-chain data restoration system and method
CN111597268A (en) Block chain expansion method, block chain node and block chain 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