Published on 08/16/22
Introduction to Cryptocurrency
A new decentralized payment network called Bitcoin was launched in January 2009. This fresh innovation was developed by Satoshi, a pseudonymous author or collective of authors. In a piece that was made available to the public in the email list for cypherpunks. They are anarchists, the cypherpunks. cryptographers who have focused on personal security. Internet privacy has existed since the 1990s. Here, we'll concentrate on mathematics' role in the safety and efficiency of the Bitcoin protocol. A mathematical procedure on a network that maintains transaction data and establishes a majority consensus among the participants is roughly what the Bitcoin protocol is. Therefore, if the majority of the participants are truthful, then we automatically arrive at a truthful consensus. Its primary characteristic is decentralization, meaning no organization or central authority exists. The network's nodes are voluntarily participating members subject to the same rights and obligations. Anyone is welcome to join the network and participate. The network is robust and unstoppable once it is up and running. Since January 2009, it has been continuously running without any major interruptions.
What are Nodes and Mining in Bitcoin?
Network nodes can take part in transaction validation and disseminate transactions. Because it has to do with creating new bitcoins, the process of validating transactions is sometimes referred to as "mine." The idea behind bitcoin is that it is a form of "electronic gold," and the protocol rules take this idea into account when determining the rate of production. A block of transactions is typically validated every ten minutes, and in a unique transaction known as the "coinbase transaction," which does not include bitcoin input, new bitcoins are created.
The goal of bitcoin mining is to create blocks, which are records of recent transactions, and add them to the blockchain. The algorithms that verify bitcoin transactions are solved by bitcoin miners using the software. In exchange, miners receive a specific quantity of bitcoin per block. The mining and validation process resembles a decentralized lottery in specific ways. A block of floating, unvalidated transactions are put together by a miner (a node involved in transaction validation), who also creates a header for the block that contains a hash of the header from the previous block. The employed hash algorithm is SHA-256, which produces 256 bits after two iterations. A hash function is a deterministic one-way function in mathematics; it is simple to compute yet nearly impossible to detect pre-images or collisions (two files giving the same output).
The Mining Model
We take into account a miner whose share of the overall hash rate is 0 < p ≤ 1. The block rewards from his/her validated blocks are where he makes his money. Knowing the likelihood of success is crucial when mining a block. His/her hash rate p is proportional to the average number of blocks per unit of time that he is successful at mining. The average time for the entire network to validate a block is τ0 = 10 minutes, hence the average time for our miner is t0 = τ0/p. The interval of time between blocks mined by our miner is represented by the random variable T. The hash function's pseudo-random characteristics demonstrate that mining is a memoryless Markov process. Using this principle to demonstrate that T follows an exponential distribution is a simple task:
This equation represents α = 1/t0 = 1/E[T]. The Markov property demonstrates that the random variables T1, T2,..., Tn are independent and are all identically distributed using the same exponential law if the miner begins mining at time t = 0 and if we denote T1 as the time required to mine a first block, followed by T2,..., Tn as the inter-block mining times of subsequent blocks. Consequently, the time that is needed to investigate n blocks is
The exponential distribution's n-convolution is followed by the random variable Sn, and as is widely known, this results in a Gamma distribution with the parameters (n, a),
accompanied by the cumulative distribution
This leads us to the conclusion that if N(t) is a process that counts the number of blocks that have been verified at time t > 0, then N(t) = max{n ≥ 0; Sn < t}, so this represents this:
N(t) exhibits a Poisson distribution with mean αt. This conclusion is conventional, and Poisson processes are used in the mathematics of bitcoin mining as well as other cryptocurrencies with proof-of-work-based validation.
The Double Spend Problem
The potential for a double spend is the first significant mathematical issue in the bitcoin system that requires consideration. It is not unexpected that Nakamoto addressed this issue because it was the primary barrier to the development of decentralized coins. He imagines a scenario in which a dishonest miner sends money, then secretly attempts to validate a second, incompatible transaction in a fresh block, from the same address but to a different address under his control, enabling him to recoup the money. The only option for this is to rewrite the blockchain starting with the first transaction's validation in a block on the official blockchain after the seller has provided the items (the vendor won't distribute unless some confirmations are displayed). This is possible if he possesses a majority of the hash rate, or if his relative hashrate satisfies the condition that q > 1/2. At that point, he can mine more quickly than the rest of the network and rewrite the blockchain's last end however he pleases. Decentralized mining is required in order to ensure that no single entity has more than 50% of the mining power. However, he can still try to undertake a double spend and will succeed with a non-zero chance even when 0 < q < 1/2. Calculating the likelihood that the rogue miner would be successful in changing the most recent n ≥ 1 blocks constitutes the first mathematical challenge. We suppose that the honest miners who adhere to the protocol's rule make up the remaining relative hashrate, p = 1 - q.
This issue is comparable to the well-known gambler's ruin issue. According to Nakamoto, the likelihood of catching up to n blocks is:
According to the mining model, there exist separate Poisson processes N(t) and N’(t) counting the number of blocks mined at time t by honest and malevolent miners, respectively.
The Bitcoin Mining
Bitcoin operates as a peer to peer network, which means that everyone who uses Bitcoin is a tiny fraction of the bank of bitcoin. Miners use special software to solve math problems associating with bitcoin and are issued a certain number of bitcoins in exchange. This provides a smart way to issue the currency, and creates an incentive for more people to mine. Since miners are required to approve bitcoin transactions, more miners mean more secure network. The bitcoin network automatically changes the difficulty of the math problems depending on how fast they are being solved.
In the early days, bitcoin miners solved these math problems with the processors and their computers. Miners discovered that graphics cards (faster, use more electricity, and generate a lot of heat) used for gaming were much better suited to this kind of working. The first commercial bitcoin mining products included chips that were reprogrammed for mining bitcoin. These chips were faster, but still needed more power.
ASIC, or application specific integrated circuit, chips are designed specifically for bitcoin mining. ASIC technology has made bitcoin mining even faster while using less power. As the popularity increases, more miners join the network, making it more difficult for individuals to solve the math problems. To overcome this, miners have developed a way to work together in pools. Pools of miners find solutions faster than their individual members, and each miner is rewarded proportionate to the amount of work he or she provides. Mining is an important part of bitcoin that ensures fairness while keeping the bitcoin network stable, safe, and secure.
Modeling for Mining Profitability
In businesses, mining profitability accounts for the “profit and loss” per unit of time. The profits of a miner derive from the block rewards that pertain the coinbase reward in new bitcoins created, and the transaction fees of the transactions in the block. The profitability at instant t > 0 is given by:
R(t) and C(t) represent the rewards and the cost of the mining operation up to time t respectively. If the transaction fees are not considered, where R(t) and C(t) represent, respectively, the rewards and the cost of the mining operation up to time t. If we don’t consider transaction fees, following is considered:
b > 0 is the coinbase reward. The random variable C(t) represents the cost of mining operations, and is far more complex to determine because it depends ono external factors (electricity costs, mining hardware costs, geographic location, currency exchange rate, etc). However, this is not necessary in the comparison of the profitability of different mining strategies. The mining activity is repetitive and the miners return to the same initial state after some time: to start mining a fresh block for instance. Mining strategy is composed of cycles where the miner invariably returns to the initial state. This is the “game with repetition” similar to those employed by profit gamblers in casino games (when they can spot a flaw that makes the game profitable).
Comments