| CPC G06Q 20/3829 (2013.01) [G06Q 20/389 (2013.01); H04L 9/3247 (2013.01); H04L 9/50 (2022.05)] | 29 Claims |

|
1. A method for preventing forking of a blockchain, characterized in that the method is realized by establishing a backlink for each block of the blockchain and making a determination according to a number of backlinks, comprising steps of:
S101, selecting s consecutive blocks Bn to Bn+s;
S102, generating, by a node An that creates the block Bn in the s consecutive blocks, a key pair for the block Bn, wherein the block Bn contains a public key PKn in the key pair, and a private key PK′n in the key pair is held individually by the node An;
S103, holding the node An active in a process of continuous generation of blocks Bn+1 to Bn+s in the blockchain until the block Bn+s in the s consecutive blocks becomes a tamper-proof block;
S104, in response to the block Bn+s in the s consecutive blocks becoming a tamper-proof block, using the private key PK′n to sign on the block Bn+s generating a signature;
S105, in response to the subsequent generation of a block Bm in the blockchain, placing the signature in the block Bm, where m>n+s;
S106, making nodes creating each of the s consecutive blocks Bn to Bn+s all execute steps S102 to S105, thereby forming a plurality of backlinks associated with a block size of the blockchain, wherein each block is proven by a preceding block to be present on a main chain of the blockchain; and
S107, when a new chain claiming to be on the legitimate main chain of the blockchain is received, determining by a newly added node whether the new chain forks according to the number of the backlinks, which comprises: in case that there are L backlinks in any s consecutive blocks of the new chain, in response to the condition that G>s/2 and L≥s/2, determining the new chain to be a main chain that does not fork; in response to the condition that 1≤G≤s/2 and L>s−G, determining the new chain to be a main chain that does not fork; in response to the condition that L<G, determining the new chain to be a forked chain; and in response to the condition that G≤L≤s−G, determining that it cannot be decided whether the new chain forks, wherein G represents a minimum number of trustworthy nodes in the s consecutive blocks.
|