A Novel GLS Consensus Algorithm for Alliance Chain in Edge Computing Environment

Edge computing devices are widely deployed. An important issue that arises is in that these devices suffer from security attacks. To deal with it, we turn to the blockchain technologies. The note in the alliance chain need rules to limit write permissions. Alliance chain can provide security management functions, using these functions to meet the management between the members, certification, authorization, monitoring and auditing. This article mainly analyzes some requirements realization which applies to the alliance chain, and introduces a new consensus algorithm, generalized Legendre sequence (GLS) consensus algorithm, for alliance chain. GLS algorithms inherit the recognition and verification efficiency of binary sequence ciphers in computer communication and can solve a large number of nodes verification of key distribution issues. In the alliance chain, GLS consensus algorithm can complete node address hiding, automatic task sorting, task automatic grouping, task node scope confirmation, task address binding and stamp timestamp. Moreover, the GLS consensus algorithm increases the difficulty of network malicious attack.

attacks [Su, Lin, Zhou et al. (2015); Hui, Zhou, Xu et al. (2020)]. To deal with this security problem, the blockchain is a suitable choice. The rise of digital currency represented by Bitcoin has caused widespread concern in blockchain technology [Biryukov and Pustogarov (2015); Groth and Kohlweiss (2015)]. Blockchain is the core technology for decentralized digital currency, but also applicable to other areas. The essence of blockchain is a decentralized secure data storage technology. It has solved the technical difficulties of data storage interaction as open, secure, trusted and distributed sharing. Blockchain is essentially a secure, trusted distributed database, or can be defined as a shared and unchangeable distributed accounting system. The blockchain combines several mature computer technologies, such as data encryption, time stamping and distributed consensus, to recognize the distributed and decentralized peer-to-peer transaction, coordination and collaboration between untrusted nodes. The technical feature of the blockchain is a secure distributed storage database. For a large number of well-established database systems in current business applications, such as Oracle and MySQL, the data application that the blockchain needs to solve is to ensure the spontaneity, security, anonymity, and traceability of data interaction under the condition that the write rights are peer at each node and mutual supervision are needed [Moore and Christin (2013); Wijaya, Liu, Steinfeld et al. (2016)]. The blockchain is divided into the public chain, the private chain and the coalition chain according to the conditions and business requirements of the nodes [Reid and Harrigan (2013)]. The participating nodes of the public chain are arbitrary nodes of the whole network. Any computer and computing server can participate voluntarily and can be regarded as a node of the public chain. The Bitcoin system is a public chain blockchain system based on the Proof of Work (POW) consensus protocol [Nakamoto (2008)]. Bitcoin's POW consensus protocol is considered a waste of resources and other public chain consensus protocols such as Proof of Stake (POS) and Delegated Proof of Stake (DPOS) are proposed [King and Nadal (2012); Duong, Lei and Zhou (2016)]. These protocols are capable of saving computing energy, while the cost of attack by the destroyer has become very small, and the security is far less than the POW [Gervais, Karame, Wüst et al. (2016)]. Furthermore, they are based on the size of the equity to determine the size of accounting opportunities of the blockchain nodes, which is lack of fairness. The private chain is an application of a small range of blockchain, and nodes on the private chain are only set according to private organization rules [Forte, Romano and Schmid (2016)]. At present, the application scenarios of the private chain are generally defined within the enterprise or the government [Chen, Feng, Zhang et al. (2019); Xia, Tan, Wang et al. (2019)]. Some database management and auditing tasks are solved. The security requirements of the private blockchain are relatively low, and more demands are spontaneous data reading and writing and interaction. The core value of the private chain is to provide the function that data is securely traceable and cannot be altered. Most of the enterprises and departments now use the alliance chain, which is written by the nodes participating in the alliance members. Compared with the private chain, the participants of the alliance chain are the interactive writing between different departments while that of the private chain are the interactive writing within the department. They are different in management and supervision. The rules for reading and writing permissions on the alliance chain are based on the agreement between the members of the alliance. The nodes participating in the alliance chain need to reach a rule agreement, and the data reading, writing and interaction of the blockchain are completed according to the rule agreement. Currently, the alliance chain that has been formed and put into use includes R3, which is participated by many banks, and hyperledger, which is supported by the Linux Foundation [Juan, Kiayias and Nikos (2015)]. The public chain, private chain, and alliance chain must be implemented according to the consensus algorithm in business implementation [Kiayias and Panagiotakos (2015)]. This paper mainly introduces a generalized Legendre sequence (GLS) [Wang, Wen and Zhang (2013)] consensus algorithm for the alliance chain. The GLS consensus algorithm can implement address hiding, automatic task sorting, task automatic grouping, task node range confirmation, task address binding and time stamping in the alliance chain. (GLS consensus algorithm can complete node address hiding, automatic task sorting, task automatic grouping, task node scope confirmation, task address binding, stamp timestamp). Section 1 introduces the blockchain and briefly introduces the concepts of the public chain, private chain, and alliance chain. Section 2 introduces the basics of designing and validating GLS algorithms and introduces the definition and nature of GLS sequences. GLS algorithms operate the 2-adic ring, which is a finite ring that can correspond to any bit string in a finite field. When designing with this theoretical basis, it can inherit the recognition and verification efficiency of binary sequence ciphers in computer communication and can solve a large number of nodes verification of key distribution issues. Section 3 mainly introduces a new type of GLS consensus algorithm of the alliance chain consensus agreement. The GLS consensus tests the validity and delay using the data block size of the blockchain and the latency of the consensus algorithm. For the specific attacks that blockchains are vulnerable to, such as Distributed Denial of Service (DDOS), link attacks, drop attacks, and false information write attacks, we analyze and verify the resistance of the GLS consensus algorithm in this paper. Section 4 mainly summarizes and proposes ideas for the areas that need to be improved and explores future research directions.

Preliminary
This paper mainly introduces the GLS consensus algorithm, whose main theoretical source is the cryptographic anti-attack property of the GLS sequence. The GLS sequence is a Legendre transformed sequence, the generalized Legendre sequence (GLS). The sequence is transformed based on the original sequence on the ring and has an Arithmetic Cross-correlation ]. The GLS sequence inherits a high level of anti-attack capability and can generate a large number of bearer attack sequences. This extended nature provides a large number of authentication passwords for the consensus protocol. Since the GLS sequence is generated on the ring and can realize multidimensional operations, the GLS consensus algorithm can realize address hiding, task node range confirmation, task address binding, and time stamping between nodes in the alliance chain. Next, we introduce some basic knowledge of GLS consensus protocol design and verification. Since this chapter deals with a large number of Finite Ring knowledge, interested readers can refer to Wang et al. [Wang, Wen and Zhang (2013)]. The distribution password of the GLS consensus protocol is mainly derived from the GLS sequence, and the GLS sequence is mainly generated from the Legendre transformation of the primitive sequence / ( ) e Z p over ring. The period of the N-th order The GLS consensus algorithm mainly uses an important anti-attack property of the GLS sequence, the Arithmetic Cross-correlation. Due to the importance of this property in this paper, we describe it in detail here.

2-adic integer and arithmetic cross-correlation
we denote the sequence s as an eventually periodic sequence, if 0 0 t = we denote the sequence s as a strictly periodic sequence.
A 2-adic integer is a formal power series The set 2 Z of the 2-adic integers forms a ring under the operations of addition and multiplication with carry. We denote the string 000… as merely, and the string 100… as 1. Besides, we define that 2 1 2 2 1 + + + = −  ; that is, the infinite string 111… is a base-2 expansion of a negative integer -1. Specifically, addition of the 2 Z integers is given by If there are carry integers 0 1 2 , , , d d d  , such that 0 0 d = , and for all 0 t ≥ , we have Similarly, the multiplication of the 2 Z integers is given by If there are carry integers 0 1 2 , , , d d d  , such that 0 0 d = , and for all 0 0 d = , we have Note that in 2 Z , as 1000 1111 0000 We define that 2 1 2 2 1 Then the corresponding subtraction of 2-adic numbers is It follows that 2 Z contains all the integers. (1 2 2 2 )(1 2 2 2 ) r r q q q q − = + + + + + + + +   In 2 Z , the formal power series q − has a unique(multiplicative) inverse Thus the ring 2 Z contains every rational number h q provided q is odd.
Proposition 1 ]: There is a one-to-one correspondence between rational numbers h q ϖ = (where q is an odd number) and eventually periodic binary sequences s , which associates to each rational number ϖ and the bit sequence (0), (1), (2), s s s s =  of its 2 adic − expansion. The sequence s is strictly periodic if and only if 0 ϖ ≤ and | | 1 ϖ < .
In this correspondence, we use the operations in 2 Z to introduce the arithmetic crosscorrelation. Recall that the ordinary cross-correlation with shift τ of two strictly sequences 1 s and 2 s of period T can be defined either as the sum

GLS sequences
We introduce the nature of the GLS sequence, the detailed proof, please refer to Wang et al. [Wang, Wen and Zhang (2013)]. For each integer n, p is satisfied (   The quadratic residue of the element on the ring is for the element a, exist an element e r Z p ∈ , Satisfying 2 mod e r p a = ; Non-quadratic residual means that no element exists e r Z p ∈ , Satisfying 2 mod e r p a = . The GLS sequences generated by the largest periodic sequence of integers n in the ring ( ) e Z p form a binary periodic sequence set. The largest periodic sequence of these binary periodic sequences make up the set Any binary periodic sequence corresponds to a 2-adic correlation number ], for any two binary periodic sequence 1 s , 2 s corresponds to two 2-adic numbers 1 τ , 2 τ , 1 2 -τ τ get another correlation number 3 τ , 3 τ corresponds to the binary periodic sequence in a cycle 0, 1 number difference recorded as

GLS consensus algorithm
In the last section, we make a detailed analysis of the consensus algorithm applied to the affiliate chain. In this section, we introduce a new affiliate chain consensus algorithm-GLS consensus algorithm based on GLS. The GLS sequence set represents a class of Legendre sequences that satisfy some properties by themselves and can fulfill some of the consensus conditions in the coalition chain. The GLS consensus algorithm can realize the function of address concealment, task automatic sorting, task automatic grouping, task node scope confirmation, task address binding, time stamping and so on.

GLS consensus algorithm
In the application scenario of the federation chain, the nodes involved in the task are generally based on the trust. Each node can design a list of the tasks to be completed according to the actual situation, and dynamically allocate a large Prime P. GLS consensus algorithm has the following steps (Fig. 1).
Step 1: The requesting node applies for completing the task P, and the requesting node broadcasts to all the nodes in the network. Each node receives the task invitation, and if it agrees to participate in the task, the following steps are performed, and does not participate in the task to abandon the subsequent verification; Step 2: Participate in the task node i, according to the local address to generate unique characters i n , and add the consent to perform the task password i e to generate character pairs e i i n ( , ) ; Step 3: Node i generates a GLS set 1 i e p n S ( , ) according to the task P and the generated character pair e i i n ( , ) , and randomly selects a binary sequence i s of the whole network to broadcast; Step 4: Receive the sequence sent by another participating node; Step 5 Step 6: Through the periodicity of the sequence j s , verify that the periodic rule of P and j T are consistent with the GLS sequence, and discard the verification if it does not meet the condition. If the match is satisfied, the node i obtains the received sequence by the prime number P; Step 7: Confirm j j e n ( , ) whether it is legal, if the task cooperation.
The GLS consensus algorithm proves process is as follows: Proof: The initiator of the execution task chooses a large prime P to form the task number. Broadcast alliance chain members and add a timestamp. Agree to join node i, calculate pairs If the operation is established, we can get an integer, then the sequence j s can be identified as a task sequence sent by the node j, and get the node address and password j ,e j n ( ) .
Node i can receive all the time-stamped sequence, and filter out the task node, get the address and password of the participating node. Node i can automatically arrange the order of tasks, and get other nodes to participate in mission proof. The GLS consensus algorithm can achieve the following consensus: Hidden addresses: nodes involved in the task address can be hidden, the use of the algorithm is the address corresponding to the character n, the receiving node can only verify that n is legal, and cannot restore the real address.

Figure 1: The flow chart of GLS consensus algorithm
Automatic sorting: If the task needs to be sorted to complete the task, GLS consensus algorithm can complete the random order. The address character n task P binding operation, according to the address of each node after the size of the characters are sorted.
Confirm the scope of the task: Node i can receive the entire network to send the sequence of each node, and through the verification get the number of participating nodes, and automatically generate node list. The tasks are automatically grouped: The whole network can perform multiple tasks at the same time. The whole network nodes are automatically grouped by using GLS. When node i chooses to participate in task P, after receiving the sequence sent by other nodes, the algorithm verifies whether the sequence satisfies task P (Step 6), If satisfied, then grouped into a group, if not, then for other task nodes, not grouped in a group, to achieve automatic task grouping.
Task binding plus timestamp: The node can be a simple task P, signature generated signature e, e contains timestamps and nodes to agree to the task of tampering with the  agreement, through the GLS algorithm to generate a sequence of network broadcasts, other nodes across the network receive sequence at the same time, also receive e, that is involved in the signature of the task node.  The Block generation process (Fig. 2) is as follows: • The choice of write nodes: you can write a random number distribution algorithm, the participating nodes randomly distributed within the prime number N P , node generated address corresponding code i e , modulus N P , the number of i e is greater than a certain number of K, This node i is set as a write node (which may be multiple); • The task is completed to form a task cycle, the task process and results written into the node selected in the previous step, similar to Ethereum in the fragment; • Each write node to form a block, according to the task to complete the time to connect the previous block.

Functional verification of the GLS consensus algorithm
The process of the GLS Consensus Protocol validity is as follows.
The GLS consensus tests the validity and delay using the data block size of the blockchain and the latency of the consensus algorithm. Transaction Per Second (TPS) and consensus algorithm delay determines the block generation time and the number of verifications per second of the consensus algorithm. The simulation environment of the GLS consensus algorithm is written in Java language, and simulates one data generation process and nine consensus execution processes in a single machine environment. System operating environment: Intel Core m7-6Y75 1.51 GHz CPU, 8G memory and the Ethereum environment. During the simulation experiment, the data generation module continuously sends requests to the consensus module, which executes the GLS consensus algorithm. The Practical Byzantine Fault Tolerance (PBFT) and GLS consensus algorithm can provide a large number of data verification functions. Compared with the PBFT algorithm, the write rate of the GLS consensus algorithm can reach the general blockchain throughput level, as shown in Fig. 3. For the specific attacks that blockchains are vulnerable to, such as Distributed Denial of Service (DDOS), link attacks, drop attacks, and false information write attacks, we analyze and verify the resistance of the GLS consensus algorithm. DDOS: The GLS consensus algorithm can provide a large number of verification keys, and each of the n nodes can generate e-1 n ( 1) ( 1) p p p − − verification keys with very little verification time on the ring, as shown in Fig. 3. DDOS attacks require a lot of computational power, and the GLS consensus algorithm increases the difficulty of DDOS attacks. Link attack: Link attack means that the attacker writes the blockchain into the node and uses the same ID link to find the real identity corresponding to the anonymous node. For this attack, the GLS consensus algorithm can generate dynamic verification factors based on addresses, which is extremely resistant to link attacks. Drop attack: A drop attack is an attack that attempts to get a special node and discard or modify other member information. The GLS consensus randomly sets the random number P of the node. After the random number is generated, the permissions of each node are the same, and the attack environment is not provided for the drop attack. False information writing: Information writing between nodes can increase the node verification factor for encryption, bind information and nodes, and find problems in time to isolate problem nodes, which can improve resistance.

Conclusion
The widespread concern of blockchain technology in edge computing has led many departments and industries to consider using blockchain to solve some data security problems, but the development of blockchain is not yet mature. Blockchain now the main problem is the calculation of the data stored in the process of communication problems. Due to the design of blockchain security and the limitation of open source code writing of the original bitcoin system, the currently applicable blockchain can only store data hash. On the other hand, blockchain has some problems in practical application and deployment. Some code on the participating nodes also has some problems, mainly because the blockchain code is difficult to develop and skilled architects are needed in the deployment of blockchain Operate. This article mainly analyzes some consensus algorithms in the coalition chain, and proposes a new consensus algorithm for the coalition chain. As more and more applications of the blockchain, the blockchain consensus algorithm will be more perfect for the more applications of the blockchain.
Funding Statement: We gratefully acknowledge anonymous reviewers who read drafts and made many helpful suggestions. This work is supported by the National Key Research and Development Program No. 2018YFC0807002.

Conflicts of Interest:
The authors declare that they have no conflicts of interest to report regarding the present study.  Computer Science, vol. 25, no. 10, pp. 1240-1260