• 沒有找到結果。

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

3.5 Calibration

This thesis aims to analyze optimal design possibilities of a cryptocurrency. For that purpose, the two parameters, the transaction limit tlimit and the initial Bitcoin gener-ation B(0), henceforth called bitgen, were picked. These two variables were chosen, because both of these are part of the original protocol of Bitcoin and were never really justified by their creator Satoshi Nakamoto. Additionally, these two variables can be adjusted comparatively easily, by a new consensus of all Bitcoin participants who run a full version of the Bitcoin protocol on their computer, implementing a hard fork. The following sections will describe the three different calibration approaches of this thesis.

3.5.1 Realistic Parameters

The first calibration process involved using the real Bitcoin parameters to have a base-line value to compare the other calibration processes against. As described in section 2.1.2, the current Bitcoin block has a size limit of 1 MB. Since an average transaction has a size of 250 bytes, this results in a block transaction size limit of 4000. As the model simulates on a daily basis, this number is multiplied by 144 (6 blocks per hour and 24 hours a day). Afterwards, it is divided by the computational factor of 5000.

Therefore, tlimit is set to 115 for this calibration.

The amount of Bitcoins mined per block was already described in section 2.1.3. As described, the block mining reward halves every 210,000 blocks, which equals approx-imately 4 years. Therefore, the mining reward does not stay the same during the whole simulation. However, for simplicity reasons, bitgen is only expressed in its initial value, even though it always halves after 210,000 blocks. Table2 shows the values used for the mining reward during the simulation runs.

Table 2: Daily Mining Reward in Simulation

Date Real Bitcoin Reward Simulated Bitcoin Reward

2014.02.23 - 2014.11.11 3600 0.72

2014.11.12 - 2018.04.03 1800 0.36

3.5.2 Optimization for Economic Efficiency

The second calibration step is the optimization for economic efficiency in the model.

Economic efficiency can be considered as the sum of the economic benefits minus the costs (Varian, 1996). For this thesis the economic efficiency is therefore considered as the total wealth in the model’s system. This optimization objective is similar to the one from Chiu & Koeppl (2017). In their paper, Chiu & Koeppl used a theoretical model to optimize the welfare of a market which uses Bitcoin as a currency. They defined welfare as the aggregated surplus of the market minus the expenditures, i.e., the mining costs. The aim of this optimization process is now to verify their finding, which is that the optimal calibration of a blockchain to maximize the welfare is a low mining block reward and no transaction fees. This thesis uses a similar function to measure the economic efficiency, which is considered as the overall wealth and it is defined as:

Π(t) =

where bi(t) are agent i’s Bitcoins, ci(t) his fiat cash, p(t) the Bitcoin price at time t and rtot(t)

R(t) the current worth of the miners’ hardware in US-Dollar.7

Since the relation between the parameters and the wealth is not known and might not be linear, a brute force approach would be very computation-intensive and therefore unfea-sible. Instead, a multi-objective evolutionary algorithm (MOEA) is used to maximize the wealth. This approach has been used for multi-objective optimization of agent-based model before by Narzisi et al. (2006) and is still used in this case here with only one objective due to its very efficient nature.

The multi-objective evolutionary algorithm used in this thesis is called Non-dominated Sorting Genetic Algorithm II (NSGA-II), developed by Deb et al. (2002) and will be briefly explained in the following:

Generally NSGA-II, just like any other MOEA optimizes f with m objectives and the following form:

Optimize: f (o) = (f1(o), ...fm(o)) (36)

7As users and chartists can not purchase hardware, thus their hardware’s value is equal to 0.

where o is a vector of optimization variables with the lower and upper limit of ol and ou (Seah et al., 2012). A solution oi dominates solution oj if the following conditions are fulfilled: 1. oi is better or equal in all objectives as oj. 2. oi is better than oj in at least one objective. Thus, a solution that is not dominated by any other solution is called non-dominated.

Just like most other evolutionary algorithm, NSGA-II starts by picking a random set of parameters (their genetic code here) and uses the outcomes for the creation of a new generation, that is a new set of parameters. The new offspring is created using mutation and crossover including a tournament selection to determine which parameters to use for the crossing. NSGA-II has the following special features: First of all, for the fitness evaluation, all results are sorted into classes of Pareto fronts, that is by how many other candidate solutions they are being dominated. For candidate solutions of the same front, a crowding distance is used which tries to diversify the offspring and prefers results that are further away from other solutions (in terms of their euclidean distance of their parameters to that of other) (Calle, 2017). Secondly, it follows an elitist principle, i.e., only the top performing 50% of the candidate solutions in terms of their fitness evaluation will be included for the crossover and mutation for the next generation (Deb et al., 2002).

To make the optimization process feasible, some compromises have to be made. First of all, the NSGA-II have been reduced to 1000 from the original 1500 simulation steps.

Additionally, the number of Monte Carlo simulation runs for each NSGA-II candidate solution has been picked, that allows for a robust mean, but could decrease the overall computational time. Each candidate solution is then run for the amount of Monte Carlo runs and the outcomes passed back to the algorithm. This approach has also been used in Narzisi et al. (2006). We conducted a series of simulation runs using the model calibrated with the real tlimit and bitgen values. Table3 shows the average for both the wealth and the overall hashing power, as the latter will be used in the last calibration process. Based on the results, 25 Monte Carlo runs were chosen to estimate the wealth and hashing power of each candidate solution during the NSGA-II optimization process, as the average wealth and hashing power appeared to sufficiently stabilize at that amount of runs. The upper limit for tlimit was set 70 times larger than the real one and 10 times

Table 3: Model’s Stochasticity per amount of Monte Carlo Runs No. of Monte Carlo runs

for each candidate solution Average wealth (Std.) Average hashing power (Std.)

1 14794 13,277,608

5 13476 (2763) 11,885,676 (1,855,772)

25 12672 (2277) 11,073,409 (1,390,767)

50 12904 (2226) 11,168,782 (1,352,951)

100 12795 (2295) 11,047,399 (1,418,213)

For the implementation of NSGA-II the python package pymoo by Blank & Deb (n.d.) was used. All default parameters have been used, including a binary tournament selec-tion, a crossover rate of 0.9 and a mutation rate equal to 0.5 (1 divided by the number of parameters). All other meta-parameters have been listed in table4.

The meta-parameters for the NSGA-II in this calibration are listed in table4.

Table 4: Meta-Parameters for NSGA-II of Wealth Optimization

Objective Maximize: Π(t)

bitgenl 0

bitgenu 7.2

tlimitl 0

tlimitu 8,050

No. of Monte Carlo runs

for each candidate solution 25 No. of simulation steps per run 1000

Size of the population 20

No. of generations 20

3.5.3 Optimization for Economic Efficiency and Hashing Power

The last calibration step is the optimization for economic efficiency and hashing power.

The optimization of a cryptocurrency just for the economic efficiency or in this case the overall wealth might be not a feasible solution, since the network’s security is ne-glected. In the case of Bitcoin and similar cryptocurrencies, the network’s security relies completely on its hashing power (Pagnotta, 2018). It is therefore a vital aspect of the design and should also given a high degree of attention. The network’s hashing

power, introduced in section3.2.3, is defined as:

rtot(t) =

j

X

i=1

ri(t) (37)

where ri(t) is the hashing power of miner i and j is the amount of all miners at t. This time the NSGA-II algorithm optimizes for two objectives, which is the maximization of Π(t) and rtot(t), where wealth and NSGA-II both have been introduced in the previous section. The optimization in this step will not return one optimal value, but instead an optimal Pareto front of values, that are all not dominated by each other. This is expected to result in a function that represents the trade-off between wealth and hashing power of a cryptocurrency. For that reason, the population size of this optimization was increased in order to receive a larger number of optimized outcomes that can be used to derive a more accurate function. The final meta-parameters for the NSGA-II are the following:

Table 5: Meta-Parameters for NSGA-II of Wealth and Hashing Power Optimiza-tion

No. of Monte Carlo Runs for each candidate solution 25

No. of Simulation steps per run 1000

Size of the population 40

No. of generations 20

3.6 Summary

This chapter described the model used in this thesis. It was created to mimic the real Bitcoin, its market and transaction system. Initially, it was also calibrated with the real Bitcoin parameters. Furthermore, the model was optimized in two parts using a multi-objective genetic algorithm. First only for the maximization of the total wealth and second for the maximization of both total wealth and network hashing power in a multi-objective fashion. The results of these three calibrations will be presented in the next chapter.

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

4 Findings

This chapter will describe the findings of this thesis. Section4.1presents the simulation results of the model calibrated with the real Bitcoin parameters. It will explain in detail the findings for the different outcomes, such as price, wealth and hashing power of the Bitcoin network. Section 4.2 describes the results of the optimization for wealth of the model. It will explain the optimization results of the genetic algorithm and the outcomes of the model using the optimized parameters. Section4.3describes the results of the second optimization for wealth and network hashing power. It will also explain the relation between the input parameters and outcomes as well as the Pareto optimal relation between the two outcomes. Lastly in section4.4, a summary will be made.

4.1 Real Parameters

The first calibration used the real Bitcoin parameters. That means a daily block reward of 0.72 Bitcoins and a transaction limit of 115. The following will present the results of this first calibration.

4.1.1 Price Development

Figure8shows the average price development of the Monte Carlo simulation. It reached an average of 10,116 US-Dollar in the last simulation step. One can observe, since new agents with new cash enter the market at every period, that the price is generally always rising. However, since this figure is only representing the average this is actually not the case in all runs of the simulation. Figure 9 shows the Bitcoin price development of a single simulation run in comparison to the development of the real Bitcoin price development.

One can observe that the simulated Bitcoin price of that run initially has a higher degree of volatility, while later on it does not match the volatility degree of the real Bitcoin price. The degree of volatility of the model is created by the chartists, which pick up small upwards and downward trends and amplify them. The average continuous upward trend of the simulation price is caused by the nature of the model. More specifically, as shown in equation (31), new agents will continue to join at each simulation step, bringing more wealth in form of cash and have no choice but to acquire Bitcoin, hence

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

Figure 8: Simulated Average Bitcoin Price

the price always continues to increase in the long run. This clearly is a too simplistic assumption and would need to be modified in the future to reflect the reality more accurately.

4.1.2 Hashing Power Development

Figure 10 and 11 show the simulated average of the hashing power and its standard deviation. The final average hashing power level of the simulated network is 7.38 · 1017 H/s, which is equal to 730,000 tera-hash per second. This number can be explained by the on average continuously rising Bitcoin price, which also increases the reward the miners receive daily. Falling hardware prices and increasing hardware efficiency over time allowed for miners to increasingly invest in hashing power.

Figure 12 shows the hashing power development of the real Bitcoin network and a single simulated run remultiplied with the computational factor of 5000 for comparison reasons. While the model is able to capture the upward trend of the real network hashing power, it outgrows it by a power degree of two, since the real hashing power of the network at the last simulated day was only 2.82 · 1019H/s, compared to the 3.68 · 1021 H/s of the simulated one.

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

Figure 9: Real and Simulated Bitcoin Price of a single Run Data from Blockchain.com (2019f)

Figure 10: Simulated Average Hashing Power

Figure 11: Standard Deviation of Sim-ulated Hashing Power

Figure 12: Real and Simulated Hashing Power of a single Run Data from Blockchain.com (2019e)

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

This difference might be explained by the models underlying exponential functions (2) and (3) for the hashing power per US-Dollar and the electricity consumption per Hash/s, which might not be realistic enough to reproduce real values. Additionally, the generated revenue plays an important role for the miners and their investment in hashing power. The simulated Bitcoin price was also higher on average than the real one, hence the simulated miners did have a higher incentive to invest more.

The average electricity consumption corresponding to the network’s hashing power is shown in figure13 and14. It continues to increase with an exponential growth, since the decreasing electricity costs per hash per second can not outset the increasing hash per dollar and the miners continuous investment. The simulated electricity consumption reaches a value of 4.9 million kilo watt per hour.

Figure 13: Simulated Average Electric-ity Consumption

Figure 14: Simulated Electricity Con-sumption Standard Deviation

4.1.3 Transaction Fee Development

A major addition to the model was the transaction system. Figure15shows the average transaction fee with the corresponding standard deviation. Until the 620th simulation step, the transaction fee stays at under two cents US-Dollar. After that step, it contin-uously rises until the end, where it reaches a transaction fee of 22.54 US-Dollar. This pattern can be well explained by figure 16. It shows the average unprocessed transac-tions at every time step, meaning the amount of transactransac-tions that were not within tlimit at the end of each simulation step. It becomes greater than zero for the first time on the 374th simulation step. Therefore, it can be observed that these two figures are highly related, as the amount of unprocessed transactions with a certain time delay influences the transaction fee.

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

Figure 15: Simulated Average Transac-tion Fee

Figure 16: Unprocessed Transactions during the Simulation

Figure17shows the real average transaction fee during the simulated time frame. The simulated model was able to reproduce some of its patterns. One can observe that the real fees also stayed low until they suddenly begun to raise. The model, however, did not accurately reproduce the time step at which the real fees begun to raise. Also, the real fee level was not fully reached and lastly, the simulated fees continued to rise, despite what happened for real Bitcoin. This might be explained by the continuous addition of users to the model with a fixed tendency to make a transaction, therefore smoothing the growth of the transaction fees unrealistically.

Figure 17: Real Bitcoin Transaction Fees BitInfoCharts (2019a)

4.1.4 Wealth Development

Figure18and19show the development of wealth per agent type and the corresponding standard deviation. As described in section 3.5.2, the wealth is defined as the sum of cash and the number of held Bitcoins multiplied by the current Bitcoin price at that simulation time step. Figure20and21separate the wealth into cash and Bitcoins at any given time step.

As one can see, the wealth of chartists and users is continuously rising, while the wealth

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

Figure 18: Simulated Average Wealth per Agent Type

Figure 19: Simulated Wealth Standard Deviation per Agent Type

Figure 20: Simulated Average Cash per Agent Type

Figure 21: Simulated Average Bitcoin per Agent Type

of miners experiences initially a lower volatility until nearly the end of simulation where the volatility nearly reaches the same level as that of chartists and users. This might be explained by the fact that miners sell their Bitcoin at a lower frequency than users and chartists and never place buy orders. Also, the number of chartists and users is rising at a higher pace than that of miners. Since all new agents bring new cash, the wealth of those overall groups will always increase. The high standard deviation is likely caused by the volatile Bitcoin price, which has a great impact on the wealth.

Figure22and23show the wealth development per capita and the corresponding stan-dard deviation (See figure7 for the development of the agents number per type). The wealth of a single miner increases initially and then drops below the level of wealth of the chartists and users. It stays rather low until during the last 200 simulation steps, then it steeply grows and outweighs the wealth per capita of the chartists and users drasti-cally. This also seems to be explained by the fast growth of the Bitcoin price in the later simulation steps. Interestingly enough, the wealth per capita of the chartists initially was larger than the one from the users, but at the end of the simulation it was slightly

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

Figure 22: Simulated Average Wealth per capita

Figure 23: Simulated Wealth Standard Deviation per capita

lower.

相關文件