# Enable Fair Proof-of-Work (PoW) Consensus for Blockchains in IoT by Miner Twins (MinT)
## 2 Related Work
### Blockchain and Nakamoto Consensus Protocol  
As a form of distributed ledger technology (DLT), _Blockchain_ was initially implemented as an enabling technology of Bitcoin [15], which aimed to provide a cryptocurrency to record and verify commercial transactions among trustless entities in a decentralized manner. With the decentralized P2P network architecture and cryptographic mechanisms, participants in a blockchain system maintain the immutability and auditability of data and transactions recorded on the distributed ledger instead of relying on a centralized third party trust authority.  
As one of the most fundamental problems in a distributed/decentralized computing environment, _consensus_ in a blockchain network can be defined as a fault-tolerant state-machine replication problem, which aims to maintain the globally distributed ledger state across the P2P network. Bitcoin adopts the Nakamoto consensus based on a Proof-of-Work (PoW) scheme to achieve pseudonymity, scalability and probabilistic finality in an asynchronous and open-access network environment. The goal of Nakamoto consensus is to ensure all participants agree on a common network transaction log as a serialized blockchain [12].  
PoW is essentially an incentive-based consensus algorithm, which requires all participants to compete for rewards through a cryptographic block discovery racing game. To be a winner in PoW block generation, every miner has to solve a computing-intensive hash puzzle problem. In brief, a valid PoW solution requires exhaustively querying a cryptographic hash function for a partial preimage generated from a candidate block [16]. Finally, the hash code of a candidate block must satisfy a predefined difficulty condition parameter \(h\), such as having a fixed length of bits as zeros.  
Given current _block_data_, which consists of a block header and ordered transactions by time stamps, a miner continually calculates a hash value _nonce_ until it satisfies the PoW puzzle problem. The PoW puzzle problem can be formally defined as follows:  
\[hash\_block=\mathcal{H}(block\_data|nonce)\leqslant D(h), \tag{1}\]  
where for some fixed length of bits \(L\) and difficulty condition, \(D(h)=2^{L-h}\). \(\mathcal{H}(\cdot)\) is a predefined collision-resistant cryptographic hash function that outputs a hash string \(L\in\{0,1\}^{\lambda}\), and \(\lambda\) is the length of a hash string.  
The PoW process defined by Equation (1) is essentially a verifiable process of a weighted random coin-tossing [12]. Thus, the probability of generating a valid block is in proportion to miners' computation resources. Higher computation power leads to higher hash string rate in PoW, which means more rewards and benefits. Such a mining centralization may discourage participants who have limited computation resources, such as IoT devices; but it also lead to majority (51%) attacks if an adversary controls more than 50% of the computation resources of the whole network.  
To reduce energy consumption in PoW consensus, Peercoin [17] proposed Proof-of-Stake (PoS), which requires a miner to use its coin stake to solve the puzzle solution. Unlike PoW protocols that relies on a brute-force hash calculation, PoS miners use a process of \"virtual mining\" manner that only consumes limited computational resources. However, PoS still has a mining centralization issue because an attacker can amplify its power by simply accumulating the credit stake. As the first practical Byzantine Fault Tolerant (BFT) consensus, Practical BFT (PBFT) [13] guarantees both liveness and safety in synchronous network environments given the assumption that at most of \(\lfloor\frac{n-1}{3}\rfloor\) out of total of \(n\) participants in consensus protocol are Byzantine faults. As PBFT requires that all nodes communicate synchronously to achieve consensus purposes, it has poor scalability due to high latency and communication overhead as more nodes join the consensus network.