# A Robust Sharding-Enabled Blockchain with Efficient Hashgraph Mechanism for MANETs
## 1 Introduction  
Blockchain has attracted widespread attention from all over the world [1] because of its capability of establishing trust in a decentralized manner. Distributed ledger technology makes the recorded transactions immutable, transparent and traceable, such that the blockchain is applied to some IoT (Internet of Things) scenarios, e.g., VANET (vehicular ad hoc network) [2], UAS (unmanned aerial system) [3] and MCS (Mobile CrowdSensing) [4]. A mobile ad hoc network (MANET) is established autonomously by mobile devices without relying on any infrastructure, and the mobile devices communicate in wireless multi-hop mode [5]. The MANET is decentralized in communications. The integration of blockchain and MANET improves both MANET security and blockchain adaptability. Nowadays, the blockchain is explored to build on MANETs [6; 7; 8; 9], and its applications involve incentive data collection [10], secure resources sharing [11; 12; 13], and an expansion of cryptocurrency [14; 15]. A MANET-based blockchain is geographically closer to end users than the blockchain based on edge computing, so it is envisioned to provide more safety and privacy protection. Hashgraph [16] is more applicable to the MANET-based blockchain compared with current popular consensus mechanisms. Since Proof-of-X, PBFT (Practical Byzantine Fault Tolerance) [17] and RAFT [18] require one miner/leader for transactions collection and block generation, they conflict with the decentralized characteristics of the MANET in communications, reducing the security and efficiency of the blockchain. In other words, it is hard to select a reliable miner/leader which has the minimum transmission delay to all other nodes in a dynamic network. The PoW (Proof of Work) [19] aggravates the computational burdens of the nodes with limited resources. Under opportunistic communications incurred by node mobility, the collection of vote messages in the PBFT or RAFT isin low rates, resulting in latency of the blockchain update. Even worse, the communication complexity \(O(n^{2})\) of the PBFT takes up a lot of network resources. Fortunately, hashgraph has the capacity of supporting the dynamic nature of MANETs. It is because: (i) neighbor nodes in the MANET are dynamically changed, while the leaderless and asynchronous operations of hashgraph avoid the overhead of route discovery and construction, e.g., the route from a miner/leader to other nodes. So, hashgraph mitigates the latency caused by neighborhood changes. (ii) When network partition occasionally occurs in the MANET, an isolated group of nodes can continue to perform virtual voting in hashgraph. Once the network merges, votes are counted to confirm events. (iii) The wireless communication resources of the MANET are limited, while gossip about gossip and the virtual voting mechanisms of hashgraph make each gossip contain votes for multiple received gossips, without extra votes transmission, improving the transmission efficiency of voting messages. Intuitively, by abstracting the physical network topology [20], the communication links of the above consensus protocols form the logical topologies of blockchain networks in Figure 1. Hashgraph, which is the mesh network without a leader, is similar to the MANET. Sharding technology scales the blockchain effectively through the parallel execution of multiple shards. The blockchain nodes and the distributed ledger are divided into shards. Two critical components of the sharding protocol are defined as intra-sharding and inter-sharding consensus [21; 22]. Within a shard, nodes are responsible for updating transactions to the local ledger via the intra-sharding consensus. The inter-sharding consensus guarantees the atomicity and consistency of cross-shard transactions. The atomicity means the cross-shard transaction is committed and aborted atomically, and the consistency is that the transaction is either updated to the ledgers of all involved shards or not updated.