
Recently we could see several institutions coming together to create consortium based blockchain networks such as Hyperledger. Although for applications of blockchain such as Bitcoin, Litecoin, etc. the majority-attack might not be a great threat but for consortium based blockchain networks where we could see several institutions such as public, private, government, etc. are collaborating, the majority-attack might just prove to be a prevalent threat if collusion among these institutions takes place. This paper proposes a methodology where we can use intelligent software agents to monitor the activity of stakeholders in the blockchain networks to detect anomaly such as collusion, using supervised machine learning algorithm and algorithmic game theory and stop the majority-attack from taking place.
Index Terms—Computer Security, network, blockchain, machine learning, algorithmic game theory, majority attack, anomaly detection
I. INTRODUCTION
When Satoshi Nakamoto [2] released the technology named Bitcoin, he revolutionised the industry not because he has invented a new currency system, which do not require intervention of institutional mediator while transferring money from one entity to another, but because he has gifted one of the most disruptive technology, which has come to life in decades. With the introduction of Bitcoin, Blockchain got introduced to the world, which is a digital ledger in which all transactions are recorded chronologically and publicly. But the application of blockchain is not just limited to crypto-currencies [3, 4] such as Bitcoin and have proved to be useful in tracking ownership, provenance of documents, digital assets, physical assets, voting rights, etc. As we can see the rise in use of blockchain technologies, we can also see rise of security issues such as ‘Double-Spending’, especially in the Majority Attack [2, 5, 6, 7, 8]. The majority attack is carried out by a group of individuals/entities in the decentralised environment, who colludes to take control over the ledger to gain profit from it. In this proposed methodology, a novel approach of using Algorithmic Game Theory concepts and Machine Learning techniques is used to reduce the chances of collusion in the decentralized system to gain advantage over other miners so that the system can be as fair as possible. In section 2, some background theory regarding blockchain and economy of double-spending is discussed. In section 3, the proposed methodology is discussed. Finally the paper ends with some discussion in section 4 and conclusion.
II. BACKGROUND THEORY AND RELATED WORK
In this section we will visit the concepts of double-spending and the majority attack in Blockchain. Later in this section we will also discuss the economy of the attack being performed and how Game Theory is applicable to security implications in blockchain as well.
A. Blockchain, Double-Spending & Majority Attack
A double-spending attack [2, 5, 6, 7] in blockchain means the attacker has to convince the merchant that a transaction has been confirmed and then convince the entire network to approve some other transaction, which will lead to the attacker keeping both the money and the service (goods) from the merchant whereas the merchant would be left with neither the money or the service. This problem in synchronization is solved by proof-of-work, which is a computational effort consisting of hashes to acknowledge the groups of transactions, also known as blocks. For a transaction to be valid, sufficient work has been done to acknowledge that the block contains it. Since, validation of blocks require computational effort to do so, this also gives rise to another issue, what if the attacker has substantial computational power at its disposal? All the attacker has to do is mine a blockchain privately till the length of the chain becomes longer than the chain mined by the honest network, and release this private blockchain for confirmation when it is appropriate.
In Rosenfeld’s paper [6] the probability of the attacker succeeding in his attack is discussed. If we consider $z$ as the number of blocks by which the honest network has advantage over the attacker then $z = n – m$, where $n$ is the number of blocks in the chain on top of the one where fork started for the honest network, whereas $m$ is the number of blocks in the chain on top of the fork which the attacker has built. Before we…
discuss the probability of having advantage over the attacker, let us consider the following assumptions:
- The total hashrate of the attacker and honest network is constant. They have a hashrate of $H$, combined, of which $pH$ belongs to honest network and $qH$ belongs to the attacker, where $p + q = 1$.
- The mining difficulty is constant, such that the time taken to find a block with $H$ hashrate is $T_n$.
There are two possibilities of double-spending attack, which is either the attack succeeds or it fails, as follows:
$$ z_{i+1} = \begin{cases} z_i + 1, & \text{with probability } p, \ z_i – 1, & \text{with probability } q. \end{cases} $$
If we consider $a_z$ to be the probability of the attacker succeeding in the attack then we can arrive at the following equation:
$$ a_z = p a_{z+1} + q a_{z-1} $$ \hspace{1cm} (1)
And if we solve this using the boundary condition and the notion $p + q = 1$ then we can conclude:
$$ a_z = \min\left(\frac{q}{p}, 1\right)^{\max(\lfloor z + 1 \rfloor, 0)} $$ \hspace{1cm} (2)
If we assume $n$ number of blocks are found by the honest network and $m + 1$ number of blocks are found by the attacker during this time period then the probability ($r$) of double-spending to succeed when the merchant waits for $n$ confirmations using the equation (2) is:
$$ r = \sum_{m=0}^{\infty} P(m) a_{(n-m-1)} $$
$$ = \begin{cases} 1 – \sum_{m=0}^{n} \binom{m + n – 1}{m} (p^n q^m – p^m q^n) & \text{if} \quad q < p \ 1 & \text{if} \quad q > p \end{cases} $$ \hspace{1cm} (3)
In the study [6], it is proved that as the number of confirmations by the honest network increased, the success rate of the attack decreased but no matter how many confirmations by the honest network has succeeded, the attack will always succeed if the hashrate of the attacker approached 50% of the total network hashrate, which means $q \geq 0.5$.
This proves that an attacker with more computing power at its disposal might prove to be a key factor in succeeding in the attack. This particularly raises security concerns in Consortium Blockchain [5, 7, 8] such as Hyperledger, where we can see involvement of several companies or business entities. Whoever in the Hyperledger network holds the maximum computing power, can always get a competitive advantage over its competitors while performing business transaction over the network.
With Proof of Work, more CPU/GPU power is required in checking hashes of each block in the blockchain. Because of this mechanism, more and more business entities would like to join in this mining process, which would create mining pools, and once the mining pool holds 51% computing power, then it would take control of the blockchain. Therefore, by taking control what it can do is [5, 8]:
- Modify the transaction data, which can lead to double spending attack
- To stop the block verification transaction
- To stop miners mining any available block
B. Economy of Double-Spending
In the study by Rosenfeld [6], it was found that the number of confirmations required to keep the success rate of the attacker (double-spending) below 10%, 1% and 0.1%, are 2, 4 and 6 respectively. In addition, we have already seen that once the attacker’s hashrate reaches 50% of the total network hashrate then the number of confirmations required reaches infinity, which means no amount of confirmation can defeat the attack. Taking this into account, we also have to consider the likelihood of the attack being performed in reality. If value of the commodity being exchanged is assumed to have a value of $v$ and the attacker has mined $o$ number of blocks where each block has a value of $B$, then if the attack succeeds the attacker will gain $v$, where if the attack fails then the attacker will loose $v + oB$. Therefore, if we consider the two possibilities, the payoff ($s$) for the attacker is as follows:
$$ s = \begin{cases} v, & \text{if} \quad q = > 0.5 \ -(v + oB), & \text{if} \quad q < 0.5 \end{cases} $$ \hspace{1cm} (4)
where $q$ is the hashrate of the attacker
And in order to carry on with the attack the value of $v$ has to be significant. This payoff ($s$) will prove to be useful in portraying the security implication in the light of Game Theory, and how decisions can be made to classify whether an attack is taking place or not.
III. PROPOSED METHODOLOGY
In section 2.B we have already seen that payoff ($s$) for the attacker can only have two possibilities: succeed or fail. This is where Game Theory [1] comes into account. But before we get into the concept let us define few terminologies of Game Theory in this context as follows:
- Self-Interested Agents: This can be any entity such as a person, business or any other institution in the blockchain network with their own preferences and utility. This also includes honest entities and attacker(s).
- Player: Each Self-Interested Agent who are participating in the blockchain network. Let us assume that there are $N$ players where $N = (1,\ldots,n)$ is a finite set of $n$, indexed by $i$.
- Action: Action taken by each player based on their preferences and utility. And let us assume that set of actions taken by the player $i$ is $A_i$ where $A_i = (a_1, \ldots, a_n)$.
- Payoff: The reward, which each player receives
- Now, if we consider the equation (4) then we can see the attacker would want to maximize the probability of getting a payoff of $v$ instead of losing $v + oB$. Therefore, we can extend the same equation (4) to derive the utility function/payoff function as follows:
- $$u(a) = \begin{cases} v, & \text{if } q = 0.5 \ -(v + oB), & \text{if } q < 0.5 \end{cases}$$
- (5)
- where $u$ is utility, $a$ is the action taken by the attacker, $q$ is the hashrate of the attacker, $v$ is value of commodity/service by the merchant, $o$ is number of blocks mined, $B$ is value of each block.
- This utility function ($v$) will govern the decision on whether an attack is bound to happen or not by the attacker based on the value of the commodity/service. And in order to keep the blockchain network safe from the Majority Attack we should focus on this function.
- We can feed this utility function to Supervised Machine Learning algorithms to classify whether an attack is likely to take place or not. If the attack is likely to take place then set of rules should be implemented by the system to either prevent the blockchain confirmation from the attacker(s) or to prevent confirmation of the whole transaction till a new fair transaction is performed again i.e. no payoffs for anyone, in order to ensure fairness and legitimate transactions being confirmed in the network.
- In order to achieve this, an intelligent agent is implemented in the application layer of the blockchain network system, which would have two distinct parts:
- Based on the past transactions of the stakeholders the probability of each stakeholder to defect
- Based on the current value of the commodity/service being sold in the current transaction the probability of the stakeholder(s) to attack through majority attack
- In Fig.1, we can see the workflow of the proposed methodology where after the new block is released in the network for the consensus purpose by the stakeholders (including attacker and other players), the intelligent software agent in the application layer of the network uses the utility function ($v$) to classify the motive of the stakeholders and the value of the current service being sold in the transaction. If the motive of the stakeholders is deemed to be malicious in nature with the intent of collusion to perform a majority attack then the transaction is cancelled and all the stakeholders are requested for a new transaction instead.
- IV. DISCUSSION
- In the proposed methodology we have discussed about the utility function ($v$) based on the value of the service or commodity being sold in the current transaction. Here, the commodity does not have to be something that has a tangible value in the network, rather it can have some personal attachment or importance to the stakeholder(s). In that case the intelligent agent needs to deduce the level of attachment or importance of the commodity or service being handled in the transaction in order to calculate the utility function and then the probability of the majority attack from taking place.
- V. CONCLUSION
- As blockchain technology becomes more and more popular, we can see emergence of several variations of such consensus based distributed ledger systems where majority-attack can become more proficient. In order to prevent such malicious activity in the consensus based distributed ledger systems we can utilise some variations of the Proof-of-Work proposed in this paper. Although this is a work in progress and in its preliminary stage, the proposed Proof-of-Work will be extended to provide more holistic approach to such issues faced in the system.
- ACKNOWLEDGMENT
- The author wishes to thank his colleagues at ReMe Basket Ltd. and Codeepy UK Pvt. Ltd. for their support. He would also like to thank his parents, Soma Dey and Sudip Dey, for their continued support and faith on the author’s capabilities. This work was supported in part by a grant from Codeepy Pvt. Ltd. with reference CDPY/2018/1.
- REFERENCES
- [1] Nisan et al. (2007), Algorithmic Game Theory. Cambridge University Press.
- [2] Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System. Available at https://bitcoin.org/bitcoin.pdf (Accessed: 30th January, 2018).
- [3] Staples, M. (2016) Blockchain is useful for a lot more than Bitcoin, The Conversation. Available at http://theconversation.com/blockchain-is-useful-for-a-lot-more-than-just-bitcoin-58921 (Accessed: 30th January, 2018).
- [4] (2018) How could blockchain be used in the enterprise, Computer World UK. Available at https://www.computerworlduk.com/galleries/security/how-could-blockchain-be-used-the-enterprise-3628558/ (Accessed: 30th January, 2018).
[5] Lin, I., Liao, T. (2017) A Survey of Blockchain Security Issues and Challenges, International Journal of Network Security, Vol. 19, No. 5, pp. 653-659.
[6] Rosenfeld, M. (2014) Analysis of hashrate-based double-spending, ArXiv CoRR. Available at https://arxiv.org/pdf/1402.2009.pdf (Accessed: 30th January, 2018).
[7] Courtois, N.T. (2014) On The Longest Chain Rule and Programmed Self-Destruction of Crypto Currencies, ArXiv CoRR. Available at https://arxiv.org/pdf/1405.0534.pdf (Accessed: 30th January, 2018).
[8] Eyal, I., Sirer, E. G. (2013) Majority is not Enough: Bitcoin Mining is Vulnerable, ArXiv CoRR. Available at https://arxiv.org/pdf/1311.0243.pdf (Accessed: 30th January, 2018)
Useful information for enthusiasts:
- [1]YouTube Channel CryptoDeepTech
- [2]Telegram Channel CryptoDeepTech
- [3]GitHub Repositories CryptoDeepTools
- [4]Telegram: ExploitDarlenePRO
- [5]YouTube Channel ExploitDarlenePRO
- [6]GitHub Repositories Keyhunters
- [7]Telegram: Bitcoin ChatGPT
- [8]YouTube Channel BitcoinChatGPT
- [9] Bitcoin Core Wallet Vulnerability
- [10] BTC PAYS DOCKEYHUNT
- [11] DOCKEYHUNT
- [12]Telegram: DocKeyHunt
- [13]ExploitDarlenePRO.com
- [14]DUST ATTACK
- [15]Vulnerable Bitcoin Wallets
- [16] ATTACKSAFE SOFTWARE
- [17] LATTICE ATTACK
- [18] RangeNonce
- [19] BitcoinWhosWho
- [20] Bitcoin Wallet by Coinbin
- [21] POLYNONCE ATTACK
- [22] Cold Wallet Vulnerability
- [23] Trezor Hardware Wallet Vulnerability
- [24] Exodus Wallet Vulnerability
- [25] BITCOIN DOCKEYHUNT
Contact me via Telegram: @ExploitDarlenePRO