1. Introduction
Alliance chain is a type of blockchain that provides decentralization and node manageability, making it widely used in industries including finance, supply chain management, and healthcare [
1]. However, as the number of nodes increases, communication congestion and throughput drop become significant scalability obstacles for alliance chain [
2]. This situation arises because all transactions within the blockchain structure require nodes to utilize their computational and storage resources [
3,
4], resulting in substantial wastage of time and space [
5]. The manifestation is the bottleneck of low throughput and high latency caused by the blockchain’s difficulty bearing the cost of consensus process and ledger storage [
6]. Researchers have suggested various strategies to tackle performance issues and fulfill the practical requirement of enhancing blockchain resources to manage the rising volume of transactions [
7]. Existing solutions to achieve blockchain scaling are classified into two categories: off-chain and on-chain [
8]. Off-chain solutions adopt a layered system to simplify the blockchain architecture by aggregating the transfer of resources generated by fine-grained payments managed separately in multiple asynchronous subsystems. Only the net result is stored in the blockchain, thus avoiding the high computational cost of traditional blockchain systems [
9]. In practical applications, the off-chain payment network requires frequent opening and closing channels to achieve consensus on all completed transactions on the blockchain [
10,
11]. This process appreciably impacts the throughput of the blockchain, thus limiting the advantages provided by off-chain solutions [
12,
13]. On-chain solutions enhance the functionality and data processing capabilities of the blockchain by improving its protocols and mechanisms [
14]. Increasing the block size is typical of on-chain solutions, as it allows for higher transfer limits and reduces costs associated with transfers compared to traditional methods [
8]. This approach can have negative implications for block propagation efficiency in terms of time and increase the risk of blockchain forks, leading to a higher probability of orphan blocks and increased maintenance costs [
15]. The inefficiency of consensus protocols is the primary cause of blockchain scalability issues [
16]. The research community has made significant efforts to address this problem by exploring various innovative consensus methods, yielding remarkable results [
17,
18,
19]. There is no need to coordinate or manage various subsystems, and the recording, verifying, and retaining all transactions are characteristics of on-chain solutions. These features make on-chain solutions a mainstream choice for scaling blockchain in environments with varying network bandwidth and computing resources [
20].
Sharding protocol is commonly used in distributed databases and cloud infrastructures, which can divide an enormous database into small data fragments and store these fragments on different servers for fast and efficient data management [
21]. Elastico [
22] pioneered the combination of the sharding protocol with the blockchain in 2016, avoiding the mandatory duplication of communication and computing overhead for each participating node. The sharding protocol has been comprehensively researched and verified in academic papers [
23,
24,
25,
26,
27,
28,
29], confirming its effectiveness in enhancing throughput, reducing costs, and preserving decentralization. It has emerged as a prevailing solution for on-chain scaling [
30]. During the initial stage of the sharding protocol’s development in blockchain, it effectively addressed the resource-intensive challenges public blockchain face [
31]. As alliance chain encountered scalability challenges similar to public blockchain in the use process [
32], researchers applied sharding protocol to alliance chain, offering valuable assistance in achieving efficient transaction processing [
33]. The Atomix protocol and ByzCoinX in OmniLedger [
34] enhance cross-shard and intra-shard communication and resource management. Nevertheless, client dependency of OmniLedger cause communication overhead to become the limiting factor [
29]. RapidChain [
35] utilizes a lightweight reconstruction protocol and reduces the data transmitted in each transaction, which mitigates the bottleneck issue of transaction communication overhead in early sharding protocols. Dang proposed AHL (Attested HyperLedger) [
36] to promote the sharding protocol to applications in permissioned environments beyond cryptocurrencies. The optimization of BFT (Byzantine Fault Tolerance) consensus in AHL reduces the maximum number of nodes required for a single shard to improve the throughput of large-scale permissioned chains, but the actual application is limited by insufficient scalability and an unbalanced workload [
37]. Amiri proposes Sharper [
7], which uses a hash-based sharding strategy and a BFT-based algorithm to ensure fast transaction distribution processing and process cross-shard transactions through non-overlapping committees in parallel computing, showing excellent scalability and load balancing. Sharper still faces challenges in the complexity of node election and consensus algorithms and issues related to data access efficiency [
38]. FleetChain [
39] utilizes FBFT (Fast byzantine fault tolerance) to improve communication and processing efficiency and employs RSTP (Responsive sharded transaction processing) for improved cross-shard consensus via multi-signature aggregation. Sharding protocol has improved the scalability of the alliance chain, but there are still insufficient performance problems in transaction verification and consensus processing. As the number of members increases, the communication bandwidth and time required for broadcasting and message collection consume a significant amount of resources, thereby reducing protocol efficiency.
This paper proposes a dynamic sharding protocol for transaction confirmation. During the shard configuration phase, a random function is utilized to elect a Master node to preside over the epoch, ensuring the impartiality of the consensus process. Subsequently, each node is randomly assigned to a specific committee based on its identity information. The protocol employs a dynamic transaction confirmation consensus mechanism, which enhances the efficiency of consensus within the shard, appreciably improving the performance of the alliance chain system. Once consensus within the shard is achieved, the Leader node encapsulates the microblocks to reduce communication overhead. The protocol includes a review mechanism and a reputation model to constrain node behavior. In general, the protocol markedly improves the performance and scalability of the alliance chain.
Simulation results show that in the alliance chain with the same number of nodes, the proposed protocol increases the transaction throughput by 20% compared with the current mainstream permissioned chain sharding protocol and exceeds the high-performance Fleetchain by 19%. As the network scale expands, the alliance chain system based on the protocol maintains a constant performance advantage.
3. Dynamic Transaction Confirmation Sharding Protocol
The protocol adopts a dynamic transaction confirmation algorithm to achieve consensus on transactions within shards. It utilizes microblocks to transfer transaction information between shards, thereby directly improving the transaction verification efficiency of the alliance chain. Additionally, random node selection and shard configuration are implemented along with a review system and reputation model to drive nodes to maintain the validity of consensus processes.
3.1. Network Infrastructure
The protocol design incorporates three types of validator nodes: consensus, Leader, and Master nodes. Each subcommittee comprises all consensus nodes and Leader nodes in a single shard, and the only consensus committee comprises all Leader nodes and Master nodes. Consensus nodes validate transactions and submit the final consensus result to the Leader node within their respective subcommittee. The Leader node packages the transactions completed in consensus into microblock and submits microblock to the unique Master node for each epoch. The Master node organizes the validation of microblocks within the consensus committee and packages the validated microblocks for upload to the alliance chain. After the status of all validator nodes is synchronized, each Leader node will randomly generate a string. The Master node merges this set of strings, adds the latest block hash, and finally performs a secure hash algorithm(i.e., SHA256) calculation on the result to get epochRandomness. The Master node broadcasts the obtained epochRandomness to the whole network, and then the system executes the view replacement protocol to transition to the next epoch.
At the beginning of the epoch, all nodes combine the (
IP,
PK) identity information group (representing their internet protocol address and public key respectively) and the epochRandomness sent by the system to calculate their identity
ID. The calculation method is provided in Equation (2).
Each node in the system executes a modulo operation using its
ID and the total number of shards. The result of this modulo operation corresponds to the number of the committee to which the node belongs (in the range of [0, 1, 2, …, (total number of shards) − 1]). In each subcommittee, the node with the smallest ID will become the Leader node. Each Leader node uses the private key (hereinafter referred to as SK) as input to execute VRF (verifiable random function), judges whether it is the Master node according to the output result, and broadcasts verifiable selection information contained in the result if it judges itself as the Master node. Node state transitions are depicted in
Figure 1. Algorithm 1 describes the node assignment and selection algorithm step-by-step using pseudocode.
It is crucial to record node information in the shard during the implementation process. This information is directly linked to subsequent node selection and message sending.
Figure 2 shows the key codes.
Algorithm 1 Node assignment and selection |
- Input:
, , - Output:
, , - 1:
k = total number of shards - 2:
- 3:
Identity computing: - 4:
Node receives the broadcast - 5:
- 6:
Node assignment: - 7:
- 8:
Node selection: - 9:
if is the smallest in the shard then - 10:
- 11:
if then - 12:
= Master node - 13:
broadcast - 14:
else - 15:
= Leader node - 16:
end if - 17:
else - 18:
= consensus node - 19:
end if - 20:
return , ,
|
3.2. Transaction Consensus and Review Mechanism
The client broadcasts the transaction request message to the entire nodes. The remainder r obtained by the node according to the hash value of the transaction modulo k (the number of shards) is the serial number of the shard that processes the transaction. The Leader node sends the transaction confirmation threshold (hereinafter referred to as ) to the consensus nodes in the shard.
The consensus node verifies the transaction information, adds the correct transaction to the transaction pool, and broadcasts a confirmation message. After the Leader node receives
confirmation messages, it queues the transaction into the encapsulation queue. When the epoch time is reached, the Leader node will encapsulate the transactions in the queue into a microblock and send the microblock information to the Master node.
Figure 3 depicts the intra-shard consensus.
After receiving a microblock, the Master node will verify the microblock and its internal transactions with all Leader nodes using the PBFT algorithm. On the premise that the consensus of k microblocks is completed, the whole network nodes adopt the bigblock synchronization state composed of all microblocks. Algorithm 2 uses pseudocode to describe the consensus steps of transactions in the subcommittee and consensus committee.
The validator nodes receive a bigblock sent by the Master node and compare the content of the bigblock with the already verified transactions through their local transaction pool. If a validator node discovers a transaction submitted by a Leader node but has not been verified, the validator node will send a challenge message (including the microblock information to be reviewed and the position of the transaction to be reviewed) to the Master node. The Master node forwards the received challenge message to the other
k − 1 shards (excluding the initially processed shard) for verification. The Master node reaches a consensus on the verification results of the
k − 1 shards in the consensus committee. If more than
of the shards in the verification result consider the transaction incorrect, the Master node packages the challenge message and review result into a block and uploads the block to the alliance chain. During the implementation process, it is crucial for nodes to monitor the messages and blocks within the alliance chain network. This function plays a critical role in transaction consensus and on-chain blockchain operations.
Figure 4 shows these key codes.
Algorithm 2 Transaction consensus |
- Input:
- Output:
- 1:
consensus nodes ← Leader node sends - 2:
if consensus node is not to receive ← message then - 3:
broadcast -no message - 4:
while -no messages >2 do - 5:
Replace the Leader node - 6:
Leader node sends - 7:
Node that has not received broadcast -no message - 8:
end while - 9:
end if - 10:
Client sends - 11:
transaction assignment: - 12:
- 13:
the r shard ← - 14:
nodes within the shard receive and verify - 15:
if
then - 16:
forward message - 17:
transaction pool - 18:
end if - 19:
if
then - 20:
if >= then - 21:
transaction queue← messages and - 22:
transaction pool - 23:
end if - 24:
if end of epoch time then - 25:
← transaction queue - 26:
Master node← - 27:
end if - 28:
end if - 29:
Leader nodes← Master node broadcasts - 30:
if Leader node receives then - 31:
Leader nodes← massage - 32:
end if - 33:
if >= then - 34:
Leader nodes← massage - 35:
end if - 36:
if >= then - 37:
← - 38:
if then - 39:
all nodes← - 40:
end if - 41:
end if - 42:
return
|
3.3. Reputation Model
In the PBFT-based intra-shard consensus, the consistency of the alliance chain is ensured through the two state synchronizations. The intra-shard consensus of the dynamic transaction confirmation sharding protocol only performs state synchronization once. Therefore, in addition to the confirmation mechanism, a reputation model must be used to force nodes to maintain system security jointly and distinguish malicious nodes from normal nodes. Alliance chain nodes can have a one-to-one mapping relationship with enterprise entities, so economic games can be used to motivate all nodes to maintain system security. Reputation is obtained by recording and calculating behavioral information, which is used to evaluate the reliability of nodes and verify their right to speak. The reputation incentive and penalty model is shown in
Figure 5.
In order to increase the cost of malicious behavior, a node malfeasance counter is used in the model. Nodes are assigned a reputation score of
S when they join the system, which will be subject to changes and retained throughout subsequent activities. When a node actively maintains system security, it receives an incentive reputation score of
P. Conversely, if a node’s malicious behavior is detected, its reputation score will be deducted by an amount represented as
Q. The relationship between reputation
S, incentive cases
P, deduction cases
Q, and the number of misoperations
T is shown in Equation (3).
For example, a Leader node has an initial reputation score S of 100 (nodes below this reputation score will be removed from the network). In each epoch, completing a normal transaction consensus will get an incentive reputation score P of 100, while an incorrect consensus and sending a transaction whose verification does not meet the (Hereinafter referred to as failed transaction) will deduct a reputation score Q of 50 and 30, respectively.
In the first epoch, the node completes the consensus, , .
In the second epoch, the node completed the consensus but sent a failed transaction, , .
In the third epoch, the node had a incorrect consensus, , , and sent failed transaction, , . Therefore, the node is removed from the network. The amount of reputation lost for doing evil is proportional to the number of times doing evil. When a node’s reputation drops below a specified value, the node will be removed from the network.
3.4. Adjustment of Transaction Confirmation Threshold
In the intra-shard transaction consensus stage, the transactions confirmed by consensus nodes will be encapsulated into microblocks and delivered to the consensus committee. Therefore, the time and security of transaction confirmation are directly affected by . Increasing will improve the required degree of consensus and security for transaction completion. However, if the node is unable to send confirmation messages in unstable network conditions, it will cause network congestion and eventually fail to reach consensus. Declining reduces the number of validators needed to confirm fraudulent transactions. Even if the fraudulent transaction is challenged, it will harm the alliance chain throughput, communication, and storage. The dynamically adjusted can balance the performance, security, and stability of the alliance chain, providing flexibility to meet different application scenarios.
The modification of by the Leader node will affect the alliance chain’s attributes, which gives the Leader node higher authority than the consensus node. The reputation model has no direct precautions to prevent the leader node from changing in reverse.
The protocol sets to be adjustable only once during the tenure of any Leader node, and there is a configurable range for this adjustment. An attacker would require multiple consecutive malicious Leader nodes to impact the system negatively, thus increasing the cost of malicious operations.
5. Experimental Design
The experiment involves comparing the performance of the sharding protocol with mainstream sharding protocols in the alliance chain and testing the impact of the transaction confirmation threshold and block size on system performance. The simulated alliance chain has a consistent system architecture and network model, and any differences are controlled within the scope of the protocol as much as possible.
5.1. Experiment and Configuration
The clients and nodes are simulated using a simulation system written in C++ and utilizing multi-threading technology. Transactions are transmitted by the clients in this test, and each shard consists of multiple consensus nodes and a Leader node. The system is divided into the transaction module and the consensus module. The system’s performance and scalability will be evaluated based on its throughput and transaction latency. The detailed configuration is shown in
Table 1.
5.2. Experimental Testing
The performance compares the throughput and transaction confirmation latency of different sharding protocols for one epoch in the alliance chain with a shard configuration of 4 or 6 nodes. The performance expands the alliance chain by increasing the number of shards from 4 to 8 to evaluate the impact of different network sizes on protocol performance.
According to the data in
Figure 6a and
Figure 7a, this protocol has a throughput difference of more than 66% compared to traditional Elastico. Compared to Sharper and AHL sharding protocols for permissioned chain, this protocol increases throughput by 20% and 27%, respectively. Compared with high-performance Fleetchain, the throughput of this protocol has increased by 19%. With the expansion of network scale, this protocol maintains performance advantages compared with other sharding protocols, highlighting its superior scalability.
Figure 6b and
Figure 7b describe the transaction confirmation latency comparison between this protocol and mainstream sharding protocols as the number of nodes in each shard increases. Although the performance gap between this protocol and Fleetchain has narrowed, it still achieves a 12% reduction in latency over the latter. An overview of the above results shows that the system performance advantage of this protocol remains stable as the number of shards increases.
Next, test whether
affects system performance. Set up a client to send transactions to alliance chain with different shard configurations (4 shards, each with 8 or 9 nodes) and adjust
simultaneously. Measure the performance of the alliance chain under different
and average the results, as shown in the
Figure 8 and
Figure 9.
Experimental results show that does not affect the system throughput or transaction confirmation latency in the absence of erroneous transactions. Therefore, at the initial stage of system operation, should be set within the range of to of the number of shard nodes to ensure stability.
This experiment tests the effect of the total amount of transactions in an epoch on the performance of the protocol. Control the shard configuration and
, only adjust the size of the bigblock, and take the average value of the performance of multiple measurement systems, as shown in
Figure 10.
Increasing the block size can achieve the goal of enhancing the throughput but will result in longer block times. Therefore, when setting the block size in practice, it is necessary to consider the requirements of the application scenario for throughput and transaction confirmation latency.
While the simulations may not perfectly reflect the complexities of real distributed environments, they allow researchers to examine and evaluate the protocol’s behavior under controlled conditions. The experiments aim to understand the overall process and evaluate the scalability improvement provided by the protocol compared to existing methods.
Additionally, there may be differences when applying the protocol to a real distributed environment. It is important to note that these differences do not hinder the implementation of the protocol process in a distributed environment or undermine the potential for enhanced scalability and advantages over other protocols.
6. Conclusions
This paper proposes a dynamic transaction confirmation consensus sharding protocol specially designed for alliance chain systems. The protocol implements dynamic transaction confirmation consensus as an intra-shard consensus and uses parallel processing of microblocks and submission of sequential proposals on different shards to achieve this. In addition, the protocol also includes node assignment, review mechanism, and reputation model to prevent attackers from centralizing their controlled nodes into shards, thereby reducing system latency and duplicate message propagation caused by attacks. Experimental results show that the proposed sharding protocol prominently improves the scalability of alliance chain compared to other methods. In order to ensure that users can frequently access the alliance chain and use a considerable number of non-faulty nodes under a smooth network environment, it is necessary to adjust the dynamic confirmation threshold and block capacity. In addition, the protocol can also be applied to networks with the subpar performance of node facilities.
This protocol utilizes epochRandomness in calculating the identity ID to prevent high-computing power nodes from monopolizing the position of the Leader node for an extended period. This approach consumes much computing power to establish identities instead of verifying and reviewing transactions. To balance system resource consumption and ensure fairness, future work considers extending the epoch cycle, increasing the block capacity, and adopting different selection methods to facilitate node role rotation when appropriate. By improving the practicability of the protocol, researchers can expand the application scenarios from alliance chain to various blockchains.