Modeling and Simulation of the Economics of Mining in the Bitcoin Market

In January 3, 2009, Satoshi Nakamoto gave rise to the “Bitcoin Blockchain”, creating the first block of the chain hashing on his computer’s central processing unit (CPU). Since then, the hash calculations to mine Bitcoin have been getting more and more complex, and consequently the mining hardware evolved to adapt to this increasing difficulty. Three generations of mining hardware have followed the CPU’s generation. They are GPU’s, FPGA’s and ASIC’s generations. This work presents an agent-based artificial market model of the Bitcoin mining process and of the Bitcoin transactions. The goal of this work is to model the economy of the mining process, starting from GPU’s generation, the first with economic significance. The model reproduces some “stylized facts” found in real-time price series and some core aspects of the mining business. In particular, the computational experiments performed can reproduce the unit root property, the fat tail phenomenon and the volatility clustering of Bitcoin price series. In addition, under proper assumptions, they can reproduce the generation of Bitcoins, the hashing capability, the power consumption, and the mining hardware and electrical energy expenditures of the Bitcoin network.


Introduction
Bitcoin is a digital currency alternative to the legal ones, as any other crypto currency. Nowadays, Bitcoin is the most popular cryptocurrency. It was created by a cryptologist known as "Satoshi Nakamoto", whose real identity is still unknown [40]. Like other cryptocurrencies, Bitcoin uses cryptographic techniques and, thanks to an open source system, anyone is allowed to inspect and even modify the source code of the Bitcoin software.
The Bitcoin network is a peer-to-peer network that monitors and manages both the generation of new Bitcoins and the consistency verification of transactions in Bitcoins. This network is composed of a high number of computers connected to each other through the Internet. They perform complex cryptographic procedures which generate new Bitcoins (mining) and manage the Bitcoin transactions register, verifying their correctness and truthfulness.
Mining is the process which allows to find the so called "proof of work" that validates a set of transactions and adds them to the massive and transparent ledger of every past Bitcoin transaction known as the "Blockchain". The generation of Bitcoins is the reward for the validation process of the transactions. The Blockchain was generated starting since January 3, 2009 by the inventor of the Bitcoin system himself, Satoshi Nakamoto. The first block is called "genesis block" and contains a single transaction, which generates 50-Bitcoin for the benefit of the creator of the block. The whole system is set up to yield just 21 million Bitcoins by 2040, and over time the process of mining will become less and less profitable. The main source of remuneration for the miners in the future will be the fees on transactions, and not the mining process itself.
In this work, we propose an agent-based model with the aim to study and analyse the mining process and the Bitcoin market starting from September 1, 2010, the approximate date when miners started to buy mining hardware to mine Bitcoins. The proposed model simulates the mining process and the Bitcoin transactions, by implementing a mechanism for the formation of the Bitcoin price, and specific behaviors for each typology of trader. We try to reproduce the generation of Bitcoins, the main stylized facts present in the real Bitcoin market and the economy of the mining process. The model described is built on a previous work of the authors [15], which modeled the Bitcoin market under a purely financial perspective. In this work, we fully consider also the economics of mining.
The paper is organized as follows. In Section Related Work we discuss other works related to this paper, in Section Mining Process we describe briefly the mining process and we give an overview on the mining hardware and on its evolution over time. In Section The Model we present the proposed model in detail. Section Simulation Results presents the values given to several parameters of the model and reports the results of the simulations, including an analysis of Bitcoin real prices, and a robustness analysis. The conclusions of the paper are reported in Section Conclusions. Finally, appendix deals with the calibration to some parameters of the model. ket (GASM) an agent-based artificial financial market characterized by actual tracking of status and wealth of each agent, and by a realistic trading and price clearing mechanisms. GASM is able to reproduce some of the main stylised facts observed in real financial markets.
This paper is built on GASM, adding specific features and a mix of zero-intelligence and trend-following traders with the aim to model the Bitcoin exchange market and the economics of mining.

Mining Process
Today, every few minutes thousands of people send and receive Bitcoins through the peer-topeer electronic cash system created by Satoshi Nakamoto. All transactions are public and stored in a distributed database called Blockchain which is used to confirm transactions and prevent the double-spending problem.
People who confirm transactions of Bitcoins and store them in the Blockchain are called "miners". As soon as new transactions are notified to the network, miners check their validity and authenticity and collect them in a block. Then, they take the information contained in the block of the transactions, which include a variable number called "nonce" and run the SHA-256 hashing algorithm on this block, turning the initial information into a sequence of 256 bits, known as Hash [18].
There is no way of knowing how this sequence will look before calculating it, and the introduction of a minor change in the initial data causes a drastic change in the resulting Hash.
The miners cannot change the data containing the information of transactions, but can change the "nonce" number used to create a different hash. The goal is to find a Hash having a given number of leading zero bits. This number can be varied to change the difficulty of the problem. The first miner who creates a proper Hash with success (he finds the "proofof-work"), gets a reward in Bitcoins, and the successful Hash is stored with the block of the validated transactions in the Blockchain.
In a nutshell, "Bitcoin miners make money when they find a 32-bit value which, when hashed together with the data from other transactions with a standard hash function gives a hash with a certain number of 60 or more zeros. This is an extremely rare event", [18].
The steps to run the network are the followings: " New transactions are broadcast to all nodes; each node collects new transactions into a block; each node works on finding a difficult proof-of-work for its block; when a node finds a proof-of-work, it broadcasts the block to all nodes; nodes accept the block only if all transactions in it are valid and not already spent; nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash", [40].
Producing a single hash is computationally very easy, consequently in order to regulate the generation of Bitcoins, over time the Bitcoin protocol makes this task more and more difficult.
The proof-of-work is implemented by incrementing the nonce in the block until a value is found that gives the block's hash with the required leading zero bits. If the hash does not match the required format, a new nonce is generated and the Hash calculation starts again [40]. Countless attempts may be necessary before finding a nonce able to generate a correct Hash.
The computational complexity of the process necessary to find the proof-of-work is adjusted over time in such a way that the number of blocks found each day is more or less constant (approximately 2016 blocks in two weeks, one every 10 minutes). In the beginning, each generated block corresponded to the creation of 50 Bitcoins, this number being halved each four years, after 210,000 blocks additions. So, the miners have a reward equal to 50 Bitcoins if the created blocks belong to the first 210,000 blocks of the Blockchain, 25 Bitcoins if the created blocks range from the 210,001th to the 420,000th block in the Blockchain, 12.5 Bitcoins if the created blocks range from the 420,001th to the 630,000th block in the Blockchain, and so on.
Over time, mining Bitcoin is getting more and more complex, due to the increasing number of miners, and the increasing power of their hardware. We have witnessed the succession of four generations of hardware, i.e. CPU's, GPU's, FPGA's and ASIC's generation, each of them characterized by a specific hash rate (measured in H/sec) and power consumption. With time, the power and the price of the mining hardware has been steadly increasing, though the price of H/sec has been decreasing. To face the increasing costs, miners are pooling together to share resources.

The evolution of the mining hardware
In January 3, 2009, Satoshi Nakamoto created the first block of the Blockchain, called "Genesis Block", hashing on the central processing unit (CPU) of his computer. Like him, the early miners mined Bitcoin running the software on their personal computers. The CPU's era represents the first phase of the mining process, the other eras being GPU's, FPGA's and ASIC's eras (see web site https://tradeblock.com/blog/ the-evolution-of-mining/). Each era announces the use of a specific typology of mining hardware. In the second era, started about on September 2010, boards based on graphics processing unit (GPU) running in parallel entered the market, giving rise to the GPU era.
About in December 2011, the FPGA's era started and hardware based on field programmable gate array cards (FPGA) specifically designed to mine Bitcoins was available in the market.
Finally, in 2013 fully customized application specific integrated circuit (ASIC) appeared, substantially increasing the hashing capability of the Bitcoin network and marking the beginning of the fourth era.
Over time, the different mining hardware available was characterized by an increasing hash rate, a decreasing power consumption per hash, and increasing costs. For example, NVIDIA Quadro NVS 3100M, 16 cores, belonging to the GPU generation, has a hash rate equal to 3.6 MH/s and a power consumption equal to 14 W [16]; ModMiner Quad, belonging to the FPGA generation, has a hash rate equal to 800 MH/s and power consumption equal to 40 W [16]; Monarch(300), belonging to the ASIC generation, has a hash rate equal to 300 GH/s and power consumption equal to 175 W (see web site https://tradeblock.com/mining/.

Modeling the Mining Hardware Performances
The goal of our work is to model the economy of the mining process, so we neglected the first era, when Bitcoins had no monetary value, and miners used the power available on their PCs, at almost no cost. We simulated only the remaining three generations of mining hardware.
We gathered information about the products that entered the market in each era to model these three generations of hardware, in particular with the aim to compute: • the average hash rate per US$ spent on hardware, R(t), expressed in H sec * $ ; • the average power consumption per H/sec, P (t), expressed in W H/sec .
The average hash rate and the average power consumption were computed averaging the real market data at specific times and constructing two fitting curves.
To calculate the hash rate and the power consumption of the mining hardware of the GPU era, that we estimate ranging from September 1st, 2010 to September 29th, 2011, we computed an average for R and P taking into account some representative products in the market during that period, neglecting the costs of the motherboard.
In that era, motherboards with more than one Peripheral Component Interconnect express (PCIe), started to enter the market allowing to install, by using adapters, multiple video cards in only one system and to mine criptocurrency, thanks to the power of the GPUs. In Table 1, we describe the features of some GPUs in the market in that period. The data reported are taken from the web site http://coinpolice.com/gpu/.
As regards the FPGA and ASIC eras, starting about on September 2011 and on December 2013, respectively, we tracked the history of the mining hardware by following the introduction into the market of Butterfly Labs company's products. We extracted the data illustrated in Table 2 from the history of the web site http://www.butterflylabs.com/ through the web site web.archive.org.. For hardware in the market in 2014 and 2015 we referred to the Bitmain  Table 2). Starting from the mining products in each period (see Tables 1 and 2), we fitted a "best hash rate per $" and a "best power consumption function" (see Table 3). We call the fitting curves R(t) and P (t), respectively.
We used a general exponential model to fit the curve of the hash rate, R(t) obtained by using eq. 1: where a = 8.635 * 10 4 and b = 0.006318. The fitting curve of the power consumption P (t) is also a general exponential model: where a = 4.649 * 10 −7 and b = −0.004055.

The Model
We used the Blockchain.info, a web site which displays detailed information about all transactions and Bitcoin blocks, providing graphs and statistics on different data, for extracting the empirical data used in this work. This web site provides several graphs and statistical analysis of data about Bitcoins. In particular, we can observe the time trend of the Bitcoin price in the market, the total number of Bitcoins, the total hash rate of the Bitcoin network and the total number of Bitcoin transactions.   The proposed model presents an agent-based artificial cryptocurrency market in which agents mine, buy or sell Bitcoins.
We modeled the Bitcoin market starting from September 1st, 2010, because one of our goals is to study the economy of the mining process. It was only around this date that miners started to buy mining hardware to mine Bitcoins, denoting a business interest in mining. Previously, they typically just used the power available on their personal computers.
The features of the model are: • there are various kinds of agents active on the BTC market: Miners, Random traders and Chartists; • the trading mechanism is based on a realistic order book that keeps sorted lists of buy and sell orders, and matches them allowing to fulfill compatible orders and to set the price; • agents have typically limited financial resources, initially distributed following a power law; • the number of agents engaged in trading at each moment is a fraction of the total number of agents; • a number of new traders, endowed only with cash, enter the market; they represent people who decided to start trading or mining Bitcoins; • miners belong to mining pools. This means that at each time t they always have a positive probability to mine at least a fraction of Bitcoin. Indeed, since 2010 miners have been pooling together to share resources in order to be able avoiding effort duplication to optimally mine Bitcoins. A consequence of this fact is that gains are smoothly distributed among miners.
On July 18th, 2010, "ArtForz establishes an OpenGL GPU hash farm and generates his first Bitcoin block" and on September 18th, 2010, "Bitcoin Pooled Mining (operated by slush), a method by which several users work collectively to mine Bitcoins and share in the benefits, mines its first block", (news from the web site http://historyofBitcoin.org/).
Since then, the difficulty of the problem of mining increased exponentially, and nowaday it would be almost unthinkable to mine without participating to a pool.
In the next subsections we describe in detail the model simulating the mining, the Bitcoin market and the related mechanism of Bitcoin price formation.

The Agents
Agents, or traders are divided into three populations: Miners, Random traders and Chartists.
Every i-th trader enters the market at a given time step, t E i . Such a trader can be either a Miner, a Random trader or a Chartist. All traders present in the market at the initial time t E i = 0 holds an amount c i (0) of fiat currency (cash, in US dollars) and an amount b i (0) of crypto currency (Bitcoins), where i is the trader's index. They represent the persons present in the market, mining and trading Bitcoins, before the period considered in the simulation. Each i-th trader entering the market at t E i > 0 holds only an amount c i (t E i ) of fiat currency (cash, in dollars). These traders represent people interested in entering the market, investing their money in it.
The wealth distribution of traders follows a Zipf law [34]. The set of all traders entering the market at time t E i > 0 are generated before the beginning of the simulation with a Pareto distribution of fiat cash, and then are randomly extracted from the set, when a given number of them must enter the market at a given time step. Also, the wealth distribution in crypto cash of the traders in the market at initial time follows a Zipf law. Indeed, the wealth share in the world of Bitcoin is even more unevenly distributed than in the world at large (see web site http://www.cryptocoinsnews.com/owns-Bitcoins-infographic-wealth-distribution/). More details on the trader wealth endowment are illustrated in Appendix.
Miners Miners are in the Bitcoin market aiming to generate wealth by gaining Bitcoins. At the initial time, the simulated Bitcoin network is calibrated respecting the Satoshi original idea of Bitcoin network where each node participates equally to the process of check and validation of the transactions and mining. We assumed that miners in the market at initial time (t E i = 0) own a personal PC such as Core i5 2600K, and hence they are initially endowed with a hashing capability r i (0) equal to 0.0173GH/sec, that implies a power consumption equal to 75W [16]. Core i5 is a brand name of a series of fourth-generation x64 microprocessor developed by Intel and brought to market in October 2009.
Miners entering the market at time t E i > 0 acquire mining hardware, and hence a hashing capability r i (t), which implies a specific electricity cost e i (t), investing a fraction γ 1,i (t) of their fiat cash c i (t).
In addition, over time all miners can improve their hashing capability by buying new mining hardware investing both their fiat and crypto cash. Consequently, the total hashing capability of i − th trader at time t, r i (t) expressed in [H/sec], and the total electricity cost e i (t) expressed in $ per day, associated to her mining hardware units, are defined respectively as: and where: • R(t) and P (t) are, respectively, the hash rate which can be bought with one US$, expressed in H sec * $ , and the power consumption, expressed in W H/sec . At each time t, their values are given by using the fitting curves described in subsection Modeling the Mining Hardware Performances; • r i,u (t) is the hashing capability of the hardware units u bought at time t by i − th miner; • γ i = 0 and γ 1,i = 0 if no hardware is bought by i − th trader at time t. When a trader decides to buy new hardware, γ 1,i represents the percentage of miner's cash devoted to buy it. It is equal to a random variable characterized by a lognormal distribution with average 0.15 and standard deviation 0.15. γ i represents the percentage of miner's Bitcoins to be sold for buying the new hardware. It is equal to a random variable characterized by a lognormal distribution with average 0.175 and standard deviation 0.075. The term expresses the amount of personal wealth that the miner wishes to devote to buy new mining hardware, meaning that on average the miner will devote 35% of her cash and 17.5% of her bitcoins to this purpose. If γ i > 1 or γ 1,i > 1, they are set equal to one; • is the fiat price per Watt and per hour. It is assumed equal to 1.4 * 10 −4 $, considering the cost of 1 KWh equal to 0.14$, that we assumed to be constant throughout the simulation. This electricity price is computed making an average of the electricity prices in the countries in which the Bitcoin nodes distribution is higher; see web sites https://getaddr.bitnodes.io and http : //en.wikipedia.org/wiki/Electricity pricing.
The decision to buy or not new hardware is taken by every miner from time to time, on average every two months (60 days). If i − th miner decides whether to buy new hardware and/or to divest the old hardware units at time t, the next time, t I−D i (t), she will decide again is given by eq. 7: where int rounds to the nearest integer and N (µ id , σ id ) is a normal distribution with average µ id = 0 and standard deviation σ id = 6. t I−D i (t) is updated each time the miner takes her decision.
Miners active in the simulation since the beginning will take their first decision within 60 days, at random times uniformly distributed. Miners entering the simulation at time t > 1 will immediately take this decision.
In deeper detail, at time t = t I−D i (t), every miner can decide to buy new hardware units, if her fiat cash is positive, and/or to divest the old hardware units. If trader's cash is zero, she issues a sell market order to get the cash to support her electricity expenses, Each i − th miner belongs to a pool, and consequently at each time t she always has a probability higher than 0 to mine at least some sub-units of Bitcoin. This probability is inversely proportional to the hashing capability of the whole network. Knowing the number of blocks discovered per day, and consequently knowing the number of new Bitcoins B to be mined per day, the number of Bitcoins b i mined by i − th miner per day can be defined as follows: where: • r T ot (t) is the hashing capability of the whole population of miners N m at time t defined as the sum of the hashing capabilities of all miners at time t, Nm i r i (t); • the ratio r i (t) r T ot (t) defines the relative hash rate of i − th miner at time t.
Note that, as already described in section Mining Process, the parameter B decreases over time. At first, each generated block corresponds to the creation of 50 Bitcoins, but after four years, such number is halved. So, until November 27, 2012, 100,800 Bitcoins were mined in 14 days (7200 Bitcoins per day), and then 50,400 Bitcoins in 14 days (3600 per day).
The decision of a miner to buy and/or divests a hardware unit u depends on the Bitcoins potentially obtained mining with the new hardware. A miner buys new hardware units if the daily cost, given by the expense in electricity, e i,u (t), associated to these units is smaller than the gain expected in Bitcoin. Hence, before buying new hardware units the following constraint has to be evaluated: where: • p(t) is the Bitcoin price at time t.
Only if this constraint is respected the miner can buy new hardware. In this case, she issues a market order acquiring an amount of fiat cash c i,a (t) = γ i (t)b i (t)p(t) in the next time steps. She invests 50% of this amount to buy new hardware and keeps the remaining 50% as cash, to pay the electricity bill for her hardware.
If the constraint in eq. 9 is not respected, the miner anyway issues a market order equal to to support her electricity expenses. A miner divests her old hardware units if the expense in electricity associated to that units is 20% higher than the gain expected in Bitcoins using that hardware, at the current price. Therefore, the following constraint has to be respected for each value of k, with k going from 0 to current time t: The model also includes a mechanism that enables 10% of miners to invest and/or divest their hardware also at a time t = t I−D i (t). This mechanism is triggered when the price relative variation, in a time window τ M equal to 15 days, is positive and is higher than a threshold T h M equal to 0.016. This because, in the real market, the investments of miners grow when the profitability of mining activity increases. So, increasing the interest of miners in buying new hardware in these periods is a plausible assumption.
Random Traders Random Traders represent persons who enter the crypto-currency market for various reasons, but not for speculative purposes. They issue orders for reasons linked to their needs, for instance they invest in Bitcoins to diversify their portfolio, or they disinvest to satisfy a need for cash. They issue orders in a random way, compatibly with their available resources. In particular, buy and sell orders are always issued with the same probability. The specifics of their behavior is described in section Buy and Sell Orders.
Chartists Chartists represent speculators, aimed to gain by placing orders in the Bitcoin market. They speculates that, if prices are rising, they will keep rising, and if prices are falling, they will keep falling. In particular, i − th chartist issues a buy order when the price relative variation in a time window τ C i , is higher than a threshold T h C = 0.01, and issues a sell order if this variation is lower than T h C . τ C i is specific for each chartist, and is characterized by a normal distribution with average equal to 20 and standard deviation equal to 1. Chartists usually issue buy orders when the price is increasing and sell orders when the price is decreasing. However, 10% of Chartists decide, instead, to adopt a contrary strategy, and place a sell order instead of a buy order, or vice-versa. This contrarian behavior is common in financial markets, and is typically modeled also in market models [49]. Note that a Chartist will issue an order only when the price variation is above a given threshold. So, in practice, the extent of Chartist activity varies over time. In general the modelled Chartists' behavior is key to produce large price variations, and to the reproduction of the basic statistical proprieties of the real returns.
All Random traders and Chartists entering the market at t = t E > 0, issue a buy order to acquire their initial Bitcoins. Over time, at time t > t E only a fraction of Random traders and Chartists is active, and hence enabled to issue orders. Active traders can issue only one order per time step, which can be a sell order or a buy order.
Orders already placed but not yet satisfied or withdrawn are accounted for when determining the amount of Bitcoins a trader can buy or sell. Details on the percentage of active traders, the number of the traders in the market and on the probability of each trader to belong to a specific traders' population are described in Appendix.

Buy and Sell Orders
The Bitcoin market is modelled as a steady inflow of buy and sell orders, placed by the traders as described in [15]. Both buy and sell orders are expressed in Bitcoins, that is, they refer to a given amount of Bitcoins to buy or sell. In deeper detail, all orders have the following features: • amount, expressed in $ for buy order and in Bitcoins for sell order: the latter amount is a real number, because Bitcoins can be bought and sold in fractions as small as a "Satoshi"; • residual amount (Bitcoins or $): used when an order is only partially satisfied by previous transactions; • limit price (see below), which in turn can be a real number; • time when the order was issued; • expiration time: if the order is not (fully) satisfied, it is removed from the book at this time.
The amount of each buy order depends on the amount of cash, c i (t), owned by i-th trader at time t, less the cash already committed to other pending buy orders still in the book. Let us call c b i the available cash. The number of Bitcoins to buy, b a is given by eq. 11 where p(t) is the current price and β is a random variable drawn from a lognormal distribution with average and standard deviation equal to 0.25 and 0.2, respectively for Random traders and equal to 0.4 and 0.2, respectively for Chartists. In the unlikely case that β > 1, β is set equal to 1.
Similarly, the amount of each sell order depends on the number of Bitcoins, b i (t) owned by i-th trader at time t, less the Bitcoins already committed to other pending sell orders still in the book, overall called b s i . The number of Bitcoins to sell, s a is given by where β is a lognormal random variable as above. Short selling is not allowed. The limit price models the price to which a trader desire to conclude his/her transaction. An order can also be issued with no limit (market order), meaning that its originator wishes to perform the trade at the best price she can find. In this case, the limit price is set to zero. The probability of placing a market order, P lim , is set at the beginning of the simulation and is equal to 1 for Miners, to 0.2 for Random Traders and to 0.7 for Chartists. This because, unlike Random Traders, if Miners and Chartists issue orders, then they wish to perform the trade at the best available price, the formers because they need cash, the latters to be able to gain by following the price trend.
Let us suppose that i-th trader issues a limit order to buy a b i (t) Bitcoins at time t. Each buy order can be executed if the trading price is lower than, or equal to, its buy limit price b i . In the case of a sell order of a s i (t) Bitcoins, it can be executed if the trading price is higher than, or equal to, its sell limit price s i . As said above, if the limit prices b i = 0 or s i = 0, then the orders can be always executed, provided there is a pending complementary order.
The buy and sell limit prices, b i and s i , are given respectively by the following equations: where • p(t) is the current Bitcoin price; • N i (µ, σ c i ) is a random draw from a Gaussian distribution with average µ 1 and standard deviation σ i 1.
The limit prices have a random component, modelling the different perception of Bitcoin value, that is the fact that what traders "feel" is the right price to buy or to sell is not constant, and may vary for each single order. In the case of buy orders, we stipulate that a trader wishing to buy must offer a price that is, on average, slightly higher than the market price.
The value of σ i is proportional to the "volatility" σ(T i ) of the price p(t) through the equation σ i = Kσ(T i ), where K is a constant and σ(T i ) is the standard deviation of price absolute returns, calculated in the time window T i . σ i is constrained between a minimum value σ min and a maximum value σ max (this is an approach similar to that of [47]). For buy orders µ = 1.05, K = 2.5, σ min = 0.01 and σ max = 0.003.
In the case of sell orders, the reasoning is dual. For symmetry, the limit price is divided by a random draw from the same Gaussian distribution N i (µ, σ c i ). An expiration time is associated to each order. For Random Traders, the value of the expiration time is equal to the current time plus a number of days (time steps) drawn from a lognormal distribution with average and standard deviation equal to 3 and 1 days, respectively. In this way, most orders will expire within 4 days since they were posted. Chartists, who act in a more dynamic way to follow the market trend, post orders whose expiration time is at the end of the same trading day. Miners issue market orders, so the value of the expiration time is set to infinite.

Price Clearing Mechanism
We implement the price clearing mechanism by using an Order Book similar to that presented in [50].
At every time step, the order book holds the list of all the orders received and still to be executed. Buy orders are sorted in descending order with respect to the limit price b i . Orders with the same limit price are sorted in ascending order with respect to the order issue time. Sell orders are sorted in ascending order with respect to the limit price s j . Orders with the same limit price are sorted in ascending order with respect to the order issue time.
At each simulation step, various new orders are inserted into the respective lists. As soon as a new order enters the book, the first buy order and the first sell order of the lists are inspected to verify if they match. If they match, a transaction occurs. The order with the smaller residual amount is fully executed, whereas the order with larger amount is only partially executed, and remains in the head of the list, with its residual amount reduced by the amount of the matching order. Clearly, if both orders have the same residual amount, they are both fully executed.
After the transaction, the next pair of orders at the head of the lists are checked for matching. If they match, they are executed, and so on until they do not match anymore. Hence, before the book can accept new orders, all the matching orders are satisfied.
A sell order of index j matches a buy order of index i, and vice versa, only if s j ≤ b i , or if one of the two limit prices, or both, are equal to zero.
As regards the price, p T , to which the transaction is performed, the price formation mechanism follows the rules described below. Here, p(t) denotes the current price: • when one of the two orders has limit price equal to zero: if s j > 0, then p T = max(s j , p(t)), • when both orders have limit price equal to zero, p T = p(t); • when both orders have limit price higher than zero, p T = b i +s j 2 .

Simulation Results
The model described in the previous section was implemented in Smalltalk language. Before the simulation, it had to be calibrated in order to reproduce the real stylized facts and the mining process in the Bitcoin market in the period between September 1st, 2010 and September 30, 2015. The simulation period was thus set to 1856 steps, a simulation step corresponding to one day. We included also weekends and holidays, because the Bitcoin market is, by its very nature, accessible and working everyday.
We set the initial value of several key parameters of the model by using data recovered from the Blockchain Web site. The main assumption we made is to size the artificial market at about 1/100 of the real market, to be able to manage the computational load of the simulation. Table  4 shows the parameter values and their computation assumptions in detail.
In Appendix other details about the calibration of the model are shown. Specifically, the calibration of the trader wealth endowment, the number of active traders, the total number of traders in the market and the probability of a trader to belong to a specific traders' population are described in detail.
The model was run to study the main features which characterize the Bitcoin market and the traders who operate in it. In order to assess the robustness of our model and the validity of our statistical analysis, we repeated 100 simulations with the same initial conditions, but different seeds of the random number generator. The results of all simulations were consistent, as shown in the followings.

Bitcoin prices in the real and simulated market
We started studying the real Bitcoin price series between September 1st, 2010 and September 30, 2015, shown in Fig. 2. The figure shows an initial period in which the price trend is relatively constant, until about 950 th day. Then, a period of volatility follows between 950 th and 1150 th day, followed by a period of strong volatility, until the end of the considered interval.  The Bitcoin price started to fall at the beginning fo 2014, and is continuing on its downward slope until September 2015.
It is well known that the price series encountered in financial markets typically exhibit some statistical features, also known as "stylized facts" [42,38]. Among these, the three uni-variate properties which appear to be the most important and pervasive of price series, are (i) the unitroot property, (ii) the fat tail phenomenon, and (iii) the Volatility Clustering. We examined daily Bitcoin prices and found that also these prices exhibit these properties as discussed in detail in [15].
As regards the prices in the simulated market, we report in Fig. 15 the Bitcoin price in one typical simulation run. It is possible to observe that, as in the case of the real price, at first the price keeps its value constant, but then, after about 1000 simulation steps, contrary to what happens in the reality, it grows and continues on its upward slope until the end of the simulation period.
Figs. 16 (a) and (b) report the average and the standard deviation of the simulated price, taken on all 100 simulations. Note that the average value of prices steadily increases with time, in contrast with what happens in reality. Fig. 16 (b) shows that the price variations in different simulation runs increase with time, as the number of traders, transactions and the total wealth in the market are increasing.
In the proposed model, the upward trend of the price depends on an intrinsic mechanism -in fact, the average price tends to the ratio of total available cash to total available Bitcoins.
Since new traders bring in more cash than new mined Bitcoins, the price tends to increase.
In reality, Bitcoin price is also heavily affected by exogenous factors. For instance, in the past the price strongly reacted to reports such as those regarding Bitcoin ban in China, or the MtGox exchange going bust. Moreover, the total capitalization of the Bitcoin market is of the order of just some billions of US$, so if a large hedge fund decided to invest in Bitcoins, or if large amounts of Bitcoins disappeared because of theft, fraud or mismanagement, the effect on price would be potentially quite large. All these exogenous events, that can trigger strong and unexpected price variations, obviously cannot be part of our base model.
In section Other Results, we shall describe the results obtained when some random traders adopt speculative behaviors, in addition to the speculative behaviour that characterizes Chartists. Simulating this behavior allows to reproduce the Bitcoin price peak in December 2013 and its subsequent fall.
Despite inability to reproduce the decreasing trend of the price, the model presented in Section The Model, is able to reproduce quite well all statistical properties of real Bitcoin prices and returns. The stylized facts, robustly replicated by the proposed model, are the same of a previous work of Cocco et al. [15], and do not depend on the addition of the miners to the model.

Traders' Statistics
Figs. 5 -7 show the average and the standard deviation of the crypto and fiat cash, and of the total wealth, A(t), of trader populations, across all 100 simulations. These simulations were carried with miners buying new hardware using an average percentage of 15% of their wealth, that demonstrated to be optimal. Figure 7(a) highlights how Miners represent the richest population of traders in the market in the beginning of the simulation. However, from about 1400th step onwards, Random traders become the richest population in the market. This is mainly due to the higher number of Random traders with respect to Miners. Note also that the standard deviation of the total wealth is much more variable than the former two figures. This is due to the fact that the wealth is obtained by multiplying the number of Bitcoins by their price, which is very volatile among the various simulations, as shown in Fig. 16(b).  of cash that Miners devot to buy new mining hardware, Miners are able to acquire a wealth percapite that ranges about between $1,000 at the beginning of the simulation and $14,000 at the end. This is due to the optimal percentage of cash devoted to buy new hardware, that is drawn from a lognormal distribution γ with both average and standard deviation set to 0.15, as already mentioned in The Agents. We varied the average percentage of their wealth that Miners devote for buying new hardware, γ, to verify how this variation can impact on Miners' success. Remember that the actual percentage for a given Miner is drawn from a log-normal distribution, so these percentages are fairly different among Miners. Figures 9 (a) and (b) show the total wealth per capita for Miners, for increasing values of the average of γ. It is apparent that Miners' gains are inversely proportional to γ, so the general strategy of devoting more money to buy hardware is not successful for Miners. This is because if all Miners devote an increasing amount of money to buy new mining hardware, the overall hashing power of the network increases, and each single Miner does not obtain the expected advantage of having more hash power, whereas the money spent on hardware and energy increases. The wealth per-capite ranges between about $1,000 at the beginning of the simulation and $8,000 at the end, for γ = 0.25 (see fig. 9 (a)) and about between $1,000 and $6,000 for γ = 0.35 (see fig. 9 (b)). Having found that Miners' wealth decreases when too much of it is used to buy new hardware, we studied if increasing money spent in mining hardware is a successful strategy for single Miners, when most other Miners do not follow it. Fig. 10 (a) shows the ratio of initial Miners' total wealth computed at the end and at the beginning of a single simulation, , versus their actual value of γ i , that is their propension to spend money to buy mining hardware. The average < γ >= 0.15 in this simulation. The correlation coefficients is equal to -0.14, so it looks that there is no meaningful correlation between mining success and the propension to invest in hardware. In Fig. 10 we can see that two of the three most successful Miners, able to increase their wealth of about 100 and 45 times, have a very low value of γ i , (less than 0.1), whereas the third one, who was able to increase his wealth forty times, has a high propension to invest (γ i 0.62).
On the contrary, we found that the total wealth, A fm i (T ), of the miners at the end of the simulation is correlated with their hashing capability r fm i (T ), being the correlation coefficient equal to 0.788, as shown in Fig. 10 (b). This result is not unexpected because wealthy Miner can buy more hardware, that in turn helps them to increase their mined Bitcoins.   Fig. 11(a) shows the average hashing capability of the whole network in the simulated market across all Monte Carlo simulations and the hashing capability in the real market, being both these quantities expressed in log scale. Note that the simulated hashing capability should be about 100 times lower than the real one, due to the reduced dimension of the simulated market with respect to the real one. The simulated hash rate does not follow the upward trend of the Bitcoin price at about 1200th time step that is due to an exogenous cause (the step price increase at the end of 2013), that is obviously not present in our simulations. However, in Fig.  11(a) the simulated hashing capability is actually about two orders of magnitude lower than the real one, as it should be.
In general, Bitcoin mining hardware become obsolete from a few months to one year after you purchase them. "Serious" miners usually buy new equipment every month, re-investing their profits into new mining equipment, if they want that their Bitcoin mining operation to run long term (see web site http://coinbrief.net/profitable-bitcoin-mining-farm/. In our model, miners divest their mining equipment about every ten months. Figure 12 (a) shows the average and standard deviation of the power consumption across all Monte Carlo simulations. Figure 12 (b) shows an estimated minimum and maximum power consumption of the Bitcoin mining network, together with the average of the power consumption of Fig. 12 (a), in logarithmic scale. The estimated theoretical minimum power consumption is obtained by multiplying the actual hash rate of the network at time t (as shown in Fig. 11(a)) with the power consumption P (t) given in eq. 2. This would mean that the entire hashing capability of miners is obtained with the most recent hardware. The estimated theoretical maximum power consumption is obtained by multiplying the actual hash rate of the network with the power consumption P (t − 360), referring to one year before. This would mean that the entire hashing capability of miners is obtained with hardware one year old, and thus less efficient. The estimated obsolescence of mining hardware is between six months and one year, so the period of one year should give a reliable maximum value for power consumption.
The simulation results, averaged on 100 simulations, show a much more regular trend, steadily increasing with time -which is natural due to the absence of external perturbations on the model. However, the power consumption value is of the same order of magnitude of the "real" case. Note that the simulated consumption shown in Fig. 12 (b) is multiplied by 100, that is the scaling factor of our simulations, that have 1/100 th of the real number of Bitcoin traders and miners. In fact, the hash rate quoted is correct, but the consumption value looks overestimated of one order of magnitude, even with respect to our maximum power consumption limit. We believe this is due to the fact that the authors still referred to FPGA consumption rates, not fully appreciating how quickly the ASIC adoption had spread among the miners.
As of 2015, the combined electricity consumption was estimated equal to 1.46 Tera Wh per year, that corresponds to about 167 MW (see article "The magic of mining", 13 January 2015 published on web site www.economist.com.). This value is reported in Fig. 12 (b) as a black circle. This time, the value is slightly underestimated, being at the lower bound of power consumption estimate, and is practically coincident with the average value of our simulations. Figures 13 (a) and (b) show an estimate of the expenses incurred every six days in electricity (a) and in hardware (b) for the new hardware bought each day in the real and simulated market.
Note that also the values of the simulated expenses are average values across all Monte Carlo simulations.
These expenses were computed assuming that the new hardware bought each day in the real (simulated) market, and hence the additional hashing capability acquired each day, is equal to the difference between the real (simulated) hash rate in t and the real (simulated) hash rate in t − 1.
For both these expenses, contrary to what happens to the respective real quantities, the simulated quantities do not follow the upward trend of the price due to the constant investment rate in mining hardware. Remembering that our model sizes the artificial market at about 1/100 of the real market and that the number of traders, their cash and their trading probabilities are rough estimates of the real ones, the simulated market outputs can be considered reasonably close to the real one.

Other Results
It is known that Bitcoin price is driven by speculation, government regulation and investors behavior, and its volatility depends also on Bitcoin acceptance and usage. In 2012 and 2013 prices had a wild ride, until they reached a peak of $1,150 in December 2013. In 2014 Bitcoin price fell following the shutdown of historical Mt. Gox exchange site and reports regarding Bitcoin ban in China.
Trying to reproduce this market trend, we introduced in the model a particular speculative behaviour by some traders. The speculative mechanism implemented stems from a report, called the "Willy Report", published by an anonymous researcher, which alleges suspicious trading activity at Mt. Gox. "The Willy Report: proof of massive fraudulent trading activity at Mt. Gox, and how it has affected the price of Bitcoin", was posted on May 25, 2014 in web site https://willyreport.wordpress.com/.
The anonymous researcher claims to have noted a suspicious bot behavior on Mt. Gox, that spread its trading activity over many accounts, and how this fraudulent massive trading activity impacted on the price, causing bubble and crash.
In the report the researcher writes: "Somewhere in December 2013, a number of traders including myself began noticing suspicious bot behavior on Mt. Gox. Basically, a random number between 10 and 20 bitcoin would be bought every 510 minutes, nonstop, for at least a month on end until the end of January. The bot was dubbed Willy . . . its trading activity was spread over many accounts. . . . Their trading activity went back all the way to September 27th.. . .
In total, a staggering about $112 million was spent to buy close to 270,000 BTC -the bulk of which was bought in November. So if you were wondering how Bitcoin suddenly appreciated in value by a factor of 10 within the span of one month, well, this may be why. Not Chinese investors, not the Silkroad bust -these events may have contributed, but they may not have been main reason. . . . . . . there was another timetraveller account with an ID of 698630 -and this account, after being active for close to 8 months, became completely inactive just 7 hours before the first Willy account became active! So it is a reasonable assumption that these accounts were controlled by the same entity. . . . There were several peculiar things about Markus. First, its fees paid were always 0 (unlike Willy, who paid fees as usual). Second, its fiat spent when buying coins was all over the place, with seemingly completely random prices paid per bitcoin.. . . . . . Since there are no logs past November 2013, the following arguments are largely based on personal speculation, and that of other traders. . . on January 26th, Willy suddenly became inactive -and with it, the price retraced back to a more reasonable spread with the other exchanges. Shortly after -on February 3rd to be precise -it seemed as if Willy had begun to run in reverse, although with a slightly altered pattern: it seemed to sell around 100 BTC every two hours. . . . There's some additional evidence on the chart that a dump bot may have been at play. At several points in time, starting from Feb. 18th, it seemed that some bot was programmed to sell down to various fixed price levels.. . . At this point, I guess the straightforward conclusion would be that this is how the coins were stolen: a hacker gained access to the system or database, was able to assign himself accounts with any amount of USD at will, and just started buying and withdrawing away.. . . " .
According to what just mentioned, we modeled a similar behaviour. We assumed that, until the end of January 2014, 40% of Random traders entering the market were Mt. Gox accounts. The Mt. Gox accounts have a behaviour equal to that of Random traders described in Paragraph Random Traders until July 2012. Then, from August 2012 and until the end of January 2014, they issue only buy orders. Next, from February 2014 they issue only sell orders. Their trading probability is set equal to 0.1 in every period. Fig. 15 shows the Bitcoin price in one typical simulation run, under these conditions. At first, the price keeps its value constant, then at about 700 simulation steps, it grows as happens in reality. The price maintains its value high for about 500 simulation steps, then its value falls down, but after a short delay it continues on its upward slope until the end of the simulation, due to the intrinsec mechanism of our model already previous described.
The MtGox accounts' behaviour has a key rule in the reproduction of the price that has a trend more similar to the real one (shown in Fig. 2) than that described in section Bitcoin prices in the real and simulated market. All the analysis described in the previous sections was performed also for the model including "Mt.Gox" accounts, producing results consistent with those studied in the previous sections.

Conclusions
In this work, we propose an heterogenous agent model of the Bitcoin market with the aim to study and analyse the mining process and the Bitcoin market starting from September 1st, 2010, the approximate date when miners started to buy mining hardware to mine Bitcoins, for five years.
The proposed model simulates the mining process and the Bitcoin transactions, by implementing a mechanism for the formation of the Bitcoin price, and specific behaviors for each typology of trader. It includes different trading strategies, an initial distribution of wealth following Pareto law, a realistic trading and price clearing mechanism based on an order book, the increase with time of the total number of Bitcoins due to mining, and the arrival of new traders interested in Bitcoins.
The model was simulated and its main outputs were analysed and compared to respective real quantities with the aim to demonstrate that an artificial financial market model can reproduce the stylized facts of the Bitcoin financial market.
The main result of the model is the fact that some key stylized facts of Bitcoin real price series and of Bitcoin market are very well reproduced. Specifically, the model reproduces quite well the unit root property of the price series, the fat tail phenomenon, the volatility clustering of the price returns, the price peak in November 2013, its next fall in April 2014, the generation of Bitcoins, the hashing capability, the power consumption, and the hardware and electricity expenses incurred by Miners.
The proposed model is fairly complex. It is intrinsically stochastic and of course it includes endogenous mechanisms affecting the market dynamics. The Zipf distribution of traders' wealth, that impacts to the size of the orders and the "herding" effect of Chartists, when a price trend is established, play a key role in the distribution of the price returns, and hence in the reproduction of the fat tail phenomenon. The Chartist behavior and also the variability of the spread of limit prices as a function of past price volatility contribute to the volatility clustering. The threshold of activation of Chartists based on price relative variation, and the past price volatility used to determine the spread of limit prices impact on the unit-root property of the price series. The percentage of each trader's population, the choice of a trader that trades at a given time step, and the type of trading (buy or sell), as well as the setting of the quantity to trade, impact on the price trend. The setting of the amount of cash to devote to buy new hardware impacts on the wealth and hashing capability of Miners, and consequently on their hardware and electricity expenses.
Future research will be devoted to study in deeper detail the mechanisms impacting on the model dynamics. In particular, we will perform a comprehensive analysis of the sensitivity of the model to the various parameters, and will add traders with more sophisticated trading strategies, to assess their profitability in the simulated market. In addition, since the calibration of our model is based on very few specific real data, and on many assumptions aiming to derive the needed data from indirect real data, we plan to perform a deeper analysis of the Block Chain, and to gather financial data from the existing exchanges, in order to extract specific information needed for a better calibration of our model.

A Appendix B Trader Wealth Endowment
The distributions of cash and Bitcoins, for traders in the market at initial time, follow a powerlaw with exponent α set equal to 1, a value yielding the distribution known as Zipf's law [41]. This is the same assumption made in other papers [47,49]. We assumed that 40% of the total initial crypto cash is not involved in the trading activity, given the initial Miners hoarded a fraction of their Bitcoins (see web site http://www.coindesk.com/mit-report-bitcoin-more-likely-spenthoarded/.).
To create the Zipf's distribution we used the ranking property of the power-law [54]. If the total number of traders is N t and the number of Bitcoins owned by them, b i , follows a Pareto law with exponent α = 1, it is well-known from Harmonic-series theory that the total number of Bitcoins B T = b 1 ln(N t ) + γ, where γ is the Euler-Mascheroni constant and b 1 is the number of Bitcoins owned by the richest trader. The number of Bitcoins owned by i-th trader is consequently: b 1 i . We set the cash of each initial trader equal to five times the value of their crypto cash.
A similar approach was followed to set the wealth of traders who enter the simulation at t > 0, but in this case the traders are only endowed with cash. In this case, we had no specific data to calibrate the wealth of these traders. We stipulated that the cash, c s 1 , of the richest trader is about five times the cash owned by the richest initial trader, and that the exponent of the Pareto law is in this case α = 0.6. Overall, we performed various simulations varying these parameters, with no significant impact on the results.
The set of "new" traders are generated before the simulation starts. When new traders are needed to enter the simulation, they are chosen randomly in this set.

C Active Traders
As mentioned in subsection The agents, only a given percentage of traders is active in the market, and hence enabled to issue orders. To compute this percentage we made some assumptions starting from the work [52] from which we extracted Table 5, which shows the distribution of the transactions number per entity (Entity means the common owner of multiple Bitcoin addresses) and per address on a period between January 3rd, 2009 and May 13th 2012. By analyzing Table 5, we can observed that 97.37% of all entities had fewer than 10 transactions each, 2.27% of all entities had a number of transactions ranging from 10 to 100, 0.34 % of all entities had a number of transactions ranging from 100 to 1,000, and the remaining 0.02 % had a number of transactions higher than 1,000.
According to the insights coming from this work, we neglected the entities having fewer than 10 transactions each and the entities having more than 1,000 transactions each. This was done hypothesizing that the formers, typically involving a small number of Bitcoins, refer to entities who made transactions by chance "only to use" this new coin, whereas the latters, involving a very high of transactions, are probably not linked to single traders, but are the addresses of exchange sites, or of retailers accepting Bitcoins.
We considered the remaining entities, that is the entities with a number of transactions in the range from 10 to 1,000. They issue orders with a period ranging from about one day to about 122 days, because these data are computed on 1227 days. As a result, the daily trading probability of an entity ranges from 0.008 to 1.
We set the values of trading probabilities for Random traders and Chartists in this range. Specifically, we assumed that, Random Traders are active with a probability p t R = 0.1, whereas the Chartists are active with a probability p t C = 0.5. This because the interest of Chartists in purchasing or selling Bitcoins is higher than that of Random traders. Random traders issue orders to satisfy their needs, whereas Chartists issue orders for speculative reasons, study carefully the price variation over time and are readier to place orders. Note that active Chartists actually place orders only if the price variation is above a given threshold.

D Number of Traders
One of the most attractive property of Bitcoin is to provide quasi-anonymous transactions, so knowing the number of traders in the real market is very difficult. The Bitcoin addresses used for the transactions are known, but a user can have, and typically has, more than one address.
At the moment of writing (last quarter of 2015) we had three figures: In the period just mentioned, the Bitcoin network began to spread and Bitcoin had no monetary value. So, for this period we assumed the number of downloads of the official Bitcoin software client equal to the number of traders in the market. We made the assumption that a person who downloads the Bitcoin software is mainly interested to use it to mine Bitcoins. So, we extracted two figures from this data: the total number of downloads on May 1st, 2010 equal to 2,769, and the total number of downloads on September 1st, 2010, equal to 30,589, and we set the number of downloads equal to the number of traders.
So, we computed the number of traders in the market fitting the curve N T through the five figures available: where a = 2624, b = 0.002971. Fig. 17 (a) show the fitting curve and how the number of traders increases over time.

E Probability of a trader to belong to a specific traders' population
At first, users in the Bitcoin network were mainly miners. Subsequently, when the Bitcoin network started to grow and Bitcoins started to acquire a monetary value, new users entered the network. Most of these users did not mine, but simply traded Bitcoins. They are represented in the model as Random traders and Chartists. Since the percentages of the different trader populations is not known, to compute the probability of a trader to be a Miner we performed an analysis of the Bitcoin Blockchain. We analysed the Blockchain until May 1st, 2010 and then until September 1st, 2010. Each block in the Blockchain contains a list of validated transactions. Each transaction has in input all the addresses containing the amount of Bitcoins to transfer, and in output all the addresses that receive the Bitcoins. Users can use multiple addresses.
We assumed, as in [27], that the input addresses that send Bitcoins to the same output address must belong to an unique owner, since to proceed with the transaction it is necessary to know the private keys of all input addresses.
In addition, we considered the input addresses that transfer more than 20 Bitcoins owned by the same owner of the corresponding outputs. In fact, in the period from May 1st, 2010, to September 1st, 2010 Bitcoins had no monetary value, and so it is acceptable to consider that Miners exchanged only small amounts of Bitcoins to test the operation of the network. Of course, this last assumption can be valid only for the period under study.
With these assumptions, we found 46,005 unique addresses on May 1st, 2010 and 82,294 unique addresses on September 1st, 2010. With further analysis, we found that on May 1st, 2010, out of 46,005 addresses, 43,389 were addresses that mined, and on September 1st, 2010, out of 82,294 addresses, 55,974 were addresses that mined, so we computed the probability of an user to be a miner. This probability is equal to 0.94% on May 1st, 2010 and equal to 0.68% on September 1st, 2010. Using these two figures we computed a fitting curve of the probability of an user to be a miner p M . Again, it is defined by using a general exponential model: where a = 0.9425, b = −0.002654. Fig. 17 (b) shows the fitting curve and how this probability decreases over time. We see that the probability of a trader to be a Miner decreases over time, going about from 0.38 to less than 0.01. Of course, defining this probability using a fitting curve computed from only two points is questionable. In the followings, we made some considerations to validate the adoption of this curve.
At first, the number of Bitcoin transactions was low because in the market there were mainly miners. Over time, as Bitcoin was acquiring monetary value, the number of users interested in exchanging Bitcoins increased. So, while the percentage of Miners in the market was decreasing, also due to the increasing difficult to mine Bitcoins, the percentage of Random traders p R and Chartists p C greatly increased, according to the growth of the number of transactions, which slowly rose until a peak on May 2012 and then at the end of the 2013 (see figure 17 (c)). .
We assumed that the random traders to chartist ratio is 7/3, meaning that 30% of traders who are not miners are speculators, whereas the remaining 70% are non-speculative investors. These figures are consistent with recent data obtained for the foreign exchange market [19]. The probabilities of non-miners to be a random trader or a chartist, p R and p C respectively, are defined as a function of p M , respectively as: and With these probabilities, we have at the end of the simulations a number of Miners equal to about 1000, corresponding to 100,000 miners in the real world. This is in agreement with what an Australian bitcoin miner, Andrew Geyl, estimated (see web site http://bravenewcoin.com/news/numberof-bitcoin-miners-far-higher-than-popular-estimates/).