Cryptocurrency Mining from an Economic and Environmental Perspective. Analysis of the Most and Least Sustainable Countries

: There are different studies that point out that the price of electricity is a fundamental factor that will inﬂuence the mining decision, due to the cost it represents. There is also an ongoing debate about the pollution generated by cryptocurrency mining, and whether or not the use of renewable energies will solve the problem of its sustainability. In our study, starting from the Environmental Performance Index (EPI), we have considered several determinants of cryptocurrency mining: energy price, how that energy is generated, temperature, legal constraints, human capital, and R&D&I. From this, via linear regression, we recalculated this EPI by including the above factors that affect cryptocurrency mining in a sustainable way. The study determines, once the EPI has been readjusted, that the most sustainable countries to perform cryptocurrency mining are Denmark and Germany. In fact, of the top ten countries eight of them are European (Denmark, Germany, Sweden, Switzerland, Finland, Austria, and the United Kingdom); and the remaining two are Asian (South Korea and Japan).


Introduction
The accelerated development of new technologies is transforming the traditional forms and balances of economic and social organization [1]. In particular, the confluence of technological, economic, and socio-cultural factors is changing the conventional ways in which commercial exchanges take place [2] and by extension, payment systems [3]. In recent years, a diverse set of virtual or digital currencies known as cryptocurrencies have emerged strongly that act as means of exchange and adopt the functions of money in this sense, but "unlike traditional currency, is untethered to, and independent from, national borders, central banks, sovereigns, or fiats" [4]. The phenomenon of cryptocurrencies is a controversial reality that has been analyzed from multiple approaches and disciplines ranging from economics, sociology, engineering or political science, among others [5]. One of the aspects that are part of the debate around cryptocurrencies is the significant electrical energy needs required by mining processes and the consequent potential environmental impact [6], which has led some cryptocurrency mining powers such as China to raise the possibility of banning them [7]. On 1 November 2008, few could have imagined the impact and importance that the submission made by "Satoshi Nakamoto" would have. That day, a new "peer-to-peer" [8] electronic payment system was announced on the Metzworld cryptography mailing list, where its operation and features were explained; thus Bitcoin (hereinafter BTC) was born [9]. Its growth over time has increased: both users, price, and also detractors. However, the fact we want to focus on in this article is how the price of Bitcoin was first set with respect to a traditional currency, the US Dollar. This price was set at the now defunct online exchange house New Liberty Standard in 2015. The aforementioned online exchange house sold 5050 BTC for 5.02 US Dollars, which is equivalent to one dollar for every 1006 BTC [10]. The Bitcoin mining process is always the same: the "miners" receive a new mathematical problem every ten minutes and the fastest to solve it gets the new coins that are put into circulation [11,12]. This mathematical problem is based on random calculations that aim to find the solution and thus obtain the validation of the block [13]. Whoever deciphers this will get the reward, provided that the rest of the members of the network confirm that the answer is correct. Currently, 6.25 Bitcoins are obtained for each new block validated; this is due to the third Bitcoin halving that took place on 11 May 2020 [14]. We must consider that to this fixed amount of Bitcoins are added the commissions for each of the transactions. The generation of these types of virtual currencies involves the use of a large number of computers working simultaneously, so it implies a large energy expenditure [15,16]. Despite the popularization of this problem, the existing literature on this issue is still scarce.
In this context, this article aims to respond to the challenge of ensuring a higher sustainability factor for mining tasks. To this end, it examines, among a very broad set of countries, the profile of those countries that are optimal for carrying out such tasks, giving priority to the sustainability factor. The original contribution of this article is that the analysis is not only limited to the analysis of the economic viability quantified through the different energy costs, but also incorporates a particularly relevant factor in our day, namely, environmental sustainability, into the analysis.
For this purpose, the study adopts a mainly empirical analytical method, through the analysis of frequencies and correlations; 144 countries were considered as the study population, of which 133 finally made up the study sample.

Literature Review
There is currently a great debate in the scientific community about the impact that mining Bitcoin and other cryptocurrencies can have on the environment; and to what extent this exponential growth in mining can have on the objectives established to mitigate climate change [17]. The authors [18,19] point out in their study that "energy-derived emissions from mining could drive global warming above 2 • C". Very illustrative of the above, for the purpose of economically quantifying this impact, is what is collected by [20] in his study that points out that "the results illustrate a scenario where each 1 USD of cryptocurrency coin value created would be responsible for 0.66 UDS in health and climate damages". On the other hand, other authors such as [21] defend that implausible projections are being made, which are overestimating Bitcoin CO 2 emissions in the short term; who are joined by [22] who likewise criticizes "the inclusion of unprofitable mining platforms [ . . . ], thus greatly overestimating emissions". However, despite the results reported by [18][19][20], there is currently a great debate in the scientific community about the real impact of cryptocurrency mining on the environment, as other authors, such as [21,22], argue that this impact is overestimated. Furthermore, [23] indicate that in addition to Bitcoin, the expansion of the entire blockchain-based industry must be taken into account when calculating the environmental impact, and they put forward six scenarios. Thus, the authors [24] advocate that "a site regulation policy that induces changes in the energy consumption structure of mining activities is more effective in limiting carbon emissions" arising from cryptocurrency and blockchain mining. All this, referring to China, which as we indicate below currently accounts for 72% of the global hash rate. What is undeniable, beyond the estimates made, is that the mining of cryptocurrencies and the use of blockchain means an increase in energy demand, and that depending on how it is produced, it will have a greater or lesser impact on the environment. It is an indisputable fact that the lack of official statistics on the number of miners and the energy efficiency of their platforms makes it difficult to accurately estimate the environmental impact of mining processes. Despite this, some authors have made an effort to estimate the associated energy consumption. Thus, [25] points out that Bitcoin mining "is responsible for 13,000 kg of CO 2 emissions for each bitcoin mined, and 40,000 kg of CO 2 per hour" and also at a global level involves an "annual electricity consumption for bitcoin production that is currently equivalent to 32.56 tera-watts per hour (TWh), this being greater than the aggregate consumption of Ireland or Denmark". It was estimated by [26] that "From 1 January 2016 to 30 June 2018, we estimate that mining Bitcoin, Ethereum, Litecoin and Monero consumed an average of 17, 7, 7 and 14 MJ to generate one USD, respectively"; during this period the authors estimate that "mining for all 4 cryptocurrencies was responsible for 3-15 million tonnes of CO 2 emissions". Other estimates can be found in the Cambridge Bitcoin Electricity Consumption Index, prepared by the Cambridge Centre for Alternative Finance (UK), in May 2021 where they estimate, under a model that incorporates hash rates, payouts to miners, the efficiency of mining rigs, among other variables, that Bitcoin mining consumes 124. 6 TWh per year, surpassing the electricity consumption of Pakistan and Norway (120.56 and 124. 13 TWh per year, respectively) and is about to surpass countries such as Argentina and Ukraine whose consumption is 125.03 and 128. 81 TWh per year, respectively [27]. Therefore, this increasing energy consumption brings with it potential environmental problems as a consequence of the boom in cryptocurrency mining and trading [28]; "empirical results show a positive correlation between crypto-currencies trading volumes and the energy consumption". In addition, the prediction shown in Figure 1 shows that consumption will continue to grow. impact of mining processes. Despite this, some authors have made an effort to estimate the associated energy consumption. Thus, [25] points out that Bitcoin mining "is responsible for 13,000 kg of CO2 emissions for each bitcoin mined, and 40,000 kg of CO2 per hour" and also at a global level involves an "annual electricity consumption for bitcoin production that is currently equivalent to 32.56 tera-watts per hour (TWh), this being greater than the aggregate consumption of Ireland or Denmark". It was estimated by [26] 13 TWh per year, respectively) and is about to surpass countries such as Argentina and Ukraine whose consumption is 125.03 and 128. 81 TWh per year, respectively [27]. Therefore, this increasing energy consumption brings with it potential environmental problems as a consequence of the boom in cryptocurrency mining and trading [28]; "empirical results show a positive correlation between cryptocurrencies trading volumes and the energy consumption". In addition, the prediction shown in Figure 1 shows that consumption will continue to grow. Depending on how such energy is being generated, it can cause an increase in pollution, air pollution being one of them [29,30]. There are several studies on this issue such as [31] "the impact derived from increased energy generation (by mining); does not clearly generate socioeconomic benefits for the county and brings environmental implications"; or also [32] when they point out that "the Bitcoin blockchain validation process requires specialized hardware and large amounts of electricity, which translates into a significant carbon footprint". In addition to the energy consumption directly linked to mining processes, there are other associated factors that directly impact environmental sustainability. In particular, some authors [7] point to the increase in e-waste and the additional energy needs to counteract the heat released from the rigs. For all of the above, new (and Depending on how such energy is being generated, it can cause an increase in pollution, air pollution being one of them [29,30]. There are several studies on this issue such as [31] "the impact derived from increased energy generation (by mining); does not clearly generate socioeconomic benefits for the county and brings environmental implications"; or also [32] when they point out that "the Bitcoin blockchain validation process requires specialized hardware and large amounts of electricity, which translates into a significant carbon footprint". In addition to the energy consumption directly linked to mining processes, there are other associated factors that directly impact environmental sustainability. In particular, some authors [7] point to the increase in e-waste and the additional energy needs to counteract the heat released from the rigs. For all of the above, new (and sustainable) solutions should be devised to mitigate or eliminate the adverse effects derived from Bitcoin mining. Examples of this can be found in [33] who propose the reuse of waste heat derived from cryptocurrency mining in Finland, to heat a multifamily dwelling; similar solutions were proposed by [34] in Russia as well as [35] in the case of Canada; or even to design a heat generator (stove), based on the mining of cryptocurrencies, as recently proposed by [36]. Other alternatives proposed to reduce electricity demand consist of incorporating new algorithms that can ensure digital transactions that require reduced energy consumption [6]. Along the same lines, [37] argue that there is a direct relationship between the amount of energy required for proof-of-work and its design. These authors present a proposal consisting of eliminating the nonce and therefore the burden of the proof-of-work as "the main cause of the energy waste in cryptocurrencies such as Bitcoin." However, the purpose of this article is not to find a solution to the high energy consumption derived from Bitcoin mining as advocated by some authors, nor to propose a solution to the heat given off by computer equipment while solving problems; generating higher electricity consumption and therefore higher CO 2 emissions, ultimately affecting climate change. In this article we seek to apply a method that allows us to detect those countries that would be optimal for mining cryptocurrencies, taking into account a number of factors that could contribute to more sustainable mining. To do this, we considered the price of electricity (the lower the cost, the better), the amount of energy generated in a sustainable way (country with more % of clean energy generated), the temperature (assuming that a lower temperature is better, as it implies less consumption for cooling), the legal regulations (not prohibited or incentives), and finally, the development of new mining systems (countries with more R+D+I advantage). According to [24], 75% of BTC mining occurs in China due to the proximity to hardware manufacturers and lower electricity costs. Recently, the Chinese government has banned financial institutions in the country from trading cryptocurrencies. Behind this decision is the attempt to prevent competition with the digital yuan project headed by the People's Bank of China. This fact, together with the announcement of Tesla's president not to accept these decentralized digital assets as a means of payment has caused a fall in the quotation during the month of May. One of the arguments used by the car company is the high environmental impact generated by mining, which compromises environmental sustainability. However, from an economic sustainability point of view (i.e., the capacity of this activity to generate profits in the future) it can be indicated that the activity will continue to be profitable in the short term because the volume of transactions is high, but it will tend to decrease because the rewards decrease every few years and as the creation of certain cryptocurrencies progresses it is closer to the established limit.

Materials
As pointed out by [38], "energy consumption is not the main concern in many blockchain applications", furthermore, [28] points out about blockchain and mining that "this technology could generate a risk of concentration in the mining industry thus affecting nature". When determining which would be the best countries in which to carry out cryptocurrency mining in a sustainable way (or at least in the least environmentally damaging way), it is necessary to take into account those countries that are more sustainable. For this purpose, the Environmental Performance Index [39] has been used as a starting point, which provides a quantitative basis for comparing, analyzing, and understanding the environmental performance of 180 countries; from the point of view of which is the most sustainable and environmentally friendly. As material for analysis, the electricity price of the countries in the sample were taken, as the electricity price is a fundamental factor that will influence the mining decision, derived from the cost it represents [15,16,40]. Energy price data were extracted from the GlobalPetrolPrices consortium database, who, for electricity prices, follow the national averages of 150 countries. For each country, they calculate several data points for different levels of electricity consumption, as prices per kWh vary with consumption [41]. Therefore, mining cryptocurrencies in a country based on the price per kWh will be considered as deterministic [42,43]. For our purpose, it is also necessary to know whether that energy is being produced sustainably. To measure this variable, we took each country's data on electricity production from renewable sources. For this purpose, we extracted the data provided by the World Bank, which are elaborated on the basis of the International Energy Agency (IEA) and Organisation for Economic Co-operation and Development (OECD)statistics [44]. The next factor taken into account was the average temperature of the country where cryptocurrency mining is intended to be performed as this process gives off a large amount of heat [18,19] and if mining is performed in a country with mild or low temperatures, the climate itself can help to decrease electricity consumption and pollution as less cooling is needed. To measure this parameter, we took the data related to the annual average temperature (average of daily minimum and maximum temperatures of the country), averaged for the years 1961-1990, from the data provided by the Climatic Research Unit [45]. The next variable used and taken into account when determining an optimal location for the establishment and mining of cryptocurrencies is the legal regulations of the country in question. For this purpose, the legality or illegality of operating with these virtual currencies was consulted. We have only added those countries that have reliably prohibited its operation, while we have taken as "legal operation" those that have not pronounced against it (in spite of a situation of illegality); it is not prohibited, but it is not regulated either. Data on this legal issue were extracted from Cointelegraph [46] and Bit2Me [47]. We also used data related to the development of new mining systems through the relationship between countries that invest more in R&D&I will have an advantage when using more advanced and sustainable mining systems. For this purpose, we used the expenditure on research and development variable (% of GDP) provided by the World Bank [48]. To the above, we added a final variable to take into account and from which data was taken: the human development index. We started from the assumption that those countries that combine a high HDI together with a high investment in R&D&I analyzed above, will be a better place to perform cryptocurrency mining tasks. The analyzed data (human capital index on 0-1 scale) were extracted from [49].
All the above data allowed us to generate Table 1, which includes the selection of variables, as well as to elaborate the dataset included in the appendix as Table A1. Where Y, would be our dependent variable (most sustainable country), Pe would be the price of electricity, Er would be the production of energy from renewable sources, T would be the temperature of the country in question, N would be the regulation (whether or not mining cryptocurrencies is prohibited), Id would be the R&D&I expenditure variable, and finally Dh would be the human capital index variable.

Methodology
Once all the necessary information was compiled in the database that we generated, which appears in the appendix as Table A1, we proceeded to readjust the Environmental Performance Index (EPI) through linear regression, to approximate the dependency relationship between our dependent variable Y (which in our case will be the most sustainable country according to its score in the readjusted EPI); m independent variables Xi (which in our case are the six first variables as listed in Table 1) with m ∈ Z +, and a random term ε [50,51].
Since the parameters β 0 , β 1 . . . are unknown constants, these must be estimated using the sample data we collected [51,52]. For this purpose, starting from the linear regression model and applying it to the data contained in Table A1 of the appendix, we obtained the descriptive statistics contained in Table A2 of the appendix where our statistical analysis sample (N) consists of 133 countries for which complete data are available, despite the fact that 144 countries appear in the initial dataset. The difference is due to the lack of data on the human capital index variable in several countries. After the application of linear regression to refit the EPI with our new variables, we obtained the model summary and the estimation of the β parameters of the model in Tables 2 and 3. As predictors, we used: (Constant); HDI; ban mining/operation with cryptocurrencies; electricity production from renewable sources, excluding hydroelectric (% of total); average temperature per country in degrees; R&D&I; research and development expenditure (% of GDP); electricity prices for households, September 2020 (kWh, USD); and being our dependent variable, the most sustainable country. After applying the above model, we managed to estimate the β 0 , β 1 . . . parameters using the sample data we collected and processed with SPSS [51]; and they are listed in Table 3.

Results
As we can see in Table 2, our R-squared coefficient yields a result of 0.787. The result obtained shows that our new EPI is explained by 78.7% of our new independent variables that we introduced. [52][53][54]. Moreover, in the same table we can observe the result yielded by the Durbin-Watson test for our proposed model. The value reached is 2.074 that is very close to the value of 2, which according to the Durbin-Watson test indicates that there is an absence of autocorrelation in the regression model used [55]. Therefore, as can be seen in the Table 2, our regression shows a high R-squared value and the adjusted R-squared result, and also highlights the absence of endogeneity.
On the other hand, as shown in Table 4, after performing the ANOVA test the p-value (Sig.) is less than 0.05. Therefore, the hypothesis presented can be accepted, which means that at least one of the parameters is statistically different from "zero", hence the model is valid as a whole [51,53]. Where the following were used as new predictors in the adjusted EPI: HDI; mining ban/operation with cryptocurrencies; electricity production from renewable sources, excluding hydroelectric (% of total); average temperature per country in degrees; R&D&I research and development expenditure (% of GDP); and electricity prices for households, September 2020 (kWh, U.S. Dollar). Finally, if we review the p-value (Sig.) in Table 3, they are statistically different from zero (Sig < 0.05), so they can remain in the model [51,52]. Table A3 in the appendix contains the statistics of the residuals. If we apply the equation obtained from the linear regression to the data contained in Table A1 in the appendix in each country, we can obtain a visual ranking of those countries in which cryptocurrency mining would be more sustainable. Considering the price of energy, but also weighting the production of energy from clean or renewable sources of that country, the existing legal restrictions on cryptocurrency mining, the human development index, and the investment in R&D&I made, and last but not least, the average temperature of the country under study. The average temperature is important, since in hot countries energy will be needed for mining cryptocurrencies, but also much more energy will be needed to cool the computer equipment while performing the mathematical calculations necessary for mining. This is shown in Figure 2.
Therefore, once we adjusted the new index of the most sustainable countries, in this case considering variables related to cryptocurrency mining, we can establish a composite index. Table 5 shows the 15 most and least sustainable countries for cryptocurrency mining derived from the index we have constructed. Table A4 in the appendix shows the new complete EPI with all the countries in the sample.
We therefore see that the most sustainable countries for mining cryptocurrencies are Denmark and Germany, followed by some distance by Sweden, South Korea, and Switzerland. It is worth noting that within the top 10 most sustainable countries for mining cryptocurrencies, eight of them are European (Denmark, Germany, Sweden, Switzerland, Finland, Austria, and the United Kingdom), and the remaining two are Asian countries (South Korea and Japan). In Europe, the trend seems clear: these are advanced countries in clean energy production, where the price of electricity is average and there are no legal obstacles. In addition, these are countries that invest in R&D&I, and human capital. In Asia, the European pattern is repeated, as South Korea and Japan coincide with the above characteristics.
In both cases (European and Asian) there is another parallelism: they are all countries in the northern hemisphere, and within the northern hemisphere, most of them are located in the northern part of the northern hemisphere. In addition to their location in the northern hemisphere, all the countries at the top of the ranking share a common characteristic: they have a high or very high GDP and GDP per capita. Additionally, according to several studies [56][57][58] there is a strong relationship between economic growth and environmental quality and concern for the sustainability of their citizens. If we extend the list of analysis to fifteen countries, only one non-European country appears on the list, partially breaking with the previous trend: Israel. The remaining countries to complete the list of fifteen countries are the Czech Republic, Ireland, the Netherlands, Portugal, and France. This list can be consulted in the appendix, in Table A4. In both cases (European and Asian) there is another parallelism: they are all countries in the northern hemisphere, and within the northern hemisphere, most of them are located in the northern part of the northern hemisphere. In addition to their location in the northern hemisphere, all the countries at the top of the ranking share a common characteristic: they have a high or very high GDP and GDP per capita. Additionally, according to several studies [56][57][58] there is a strong relationship between economic growth and environmental quality and concern for the sustainability of their citizens. If we extend the list of analysis to fifteen countries, only one non-European country appears on the list, partially breaking with the previous trend: Israel. The remaining countries to complete the list of fifteen countries are the Czech Republic, Ireland, the Netherlands, Portugal, and France. This list can be consulted in the appendix, in Table A4.
On the contrasting side we would find those countries in which mining cryptocurrencies would not be sustainable. In this case, the worst places for environmental impact in mining are South American countries (Bolivia, Venezuela, and Suriname) and the Caribbean (Cuba). Furthermore, on the African continent, Libya, Sudan, and Nigeria stand out, and in the Middle East, Pakistan, and Iraq. This list can be found in Tables 5 and A4 in Appendix A.
However, if we compare these results with Figure 3, which shows the average monthly hash rate by country, we can see that cryptocurrency mining is not currently taking place in those countries that would be more sustainable. The hash rate refers to the numerical value within each cryptocurrency used by the proof-of-work. The value indicates the number of computational operations that a miner (or the network of miners as a whole) is capable of performing. All this in order to solve cryptographic puzzles derived from the cryptographic function used by the cryptocurrency. So, the higher the hash rate, the more cryptocurrency mining is taking place in that geographic area.  On the contrasting side we would find those countries in which mining cryptocurrencies would not be sustainable. In this case, the worst places for environmental impact in mining are South American countries (Bolivia, Venezuela, and Suriname) and the Caribbean (Cuba). Furthermore, on the African continent, Libya, Sudan, and Nigeria stand out, and in the Middle East, Pakistan, and Iraq. This list can be found in Tables 5 and A4 in  Appendix A. However, if we compare these results with Figure 3, which shows the average monthly hash rate by country, we can see that cryptocurrency mining is not currently taking place in those countries that would be more sustainable. The hash rate refers to the numerical value within each cryptocurrency used by the proof-of-work. The value indicates the number of computational operations that a miner (or the network of miners as a whole) is capable of performing. All this in order to solve cryptographic puzzles derived from the cryptographic function used by the cryptocurrency. So, the higher the hash rate, the more cryptocurrency mining is taking place in that geographic area. As we can see, China is undoubtedly the center of the world as far as cryptocurrency mining is concerned, since with the data collected in the previous figure, we can see that almost 72% of the world hash rate is carried out in China [27]. China is not one of the most sustainable countries for cryptocurrency mining, in fact, it is in the 41st position in our calculation of the most sustainable countries (see Table A4 in Appendix A). This implies that if some of this mining were to be done in another more sustainable country (from our economic-environmental point of view), the benefits for the environment would be remarkable. Leaving China aside, we focus on other striking places on the map. Firstly, Venezuela, which although it is among the countries with the highest hash rate (even at 0.46) [27], is the fourth least recommendable country according to our model for mining activity (from the point of view of sustainability). Furthermore, noteworthy in Africa is Libya, which is also among the countries with the highest global hash rate (even with 0.6) and is the third least recommendable country according to our model for mining activity (again from the perspective of sustainability). Finally, two other parts of the world should be highlighted: Iran, with a hash rate of 2.67 and Malaysia with 3.82 [27]. These are places where consistent cryptocurrency mining activity is taking place. However, neither are countries that are well positioned according to our model in terms of sustainable mining. In fact, Iran is ranked 116th out of 145 countries and Malaysia is ranked 63rd out of 145.

Discussion
Electricity demand linked to cryptocurrency transactions has grown immensely in recent years. Several factors have driven this energy consumption. Among them are "the increasing difficulty in mining" and "the large number of new market participants that have been attracted by the elevated prices of this developing financial asset" [59]. As we can see, China is undoubtedly the center of the world as far as cryptocurrency mining is concerned, since with the data collected in the previous figure, we can see that almost 72% of the world hash rate is carried out in China [27]. China is not one of the most sustainable countries for cryptocurrency mining, in fact, it is in the 41st position in our calculation of the most sustainable countries (see Table A4 in Appendix A). This implies that if some of this mining were to be done in another more sustainable country (from our economic-environmental point of view), the benefits for the environment would be remarkable. Leaving China aside, we focus on other striking places on the map. Firstly, Venezuela, which although it is among the countries with the highest hash rate (even at 0.46) [27], is the fourth least recommendable country according to our model for mining activity (from the point of view of sustainability). Furthermore, noteworthy in Africa is Libya, which is also among the countries with the highest global hash rate (even with 0.6) and is the third least recommendable country according to our model for mining activity (again from the perspective of sustainability). Finally, two other parts of the world should be highlighted: Iran, with a hash rate of 2.67 and Malaysia with 3.82 [27]. These are places where consistent cryptocurrency mining activity is taking place. However, neither are countries that are well positioned according to our model in terms of sustainable mining. In fact, Iran is ranked 116th out of 145 countries and Malaysia is ranked 63rd out of 145.

Discussion
Electricity demand linked to cryptocurrency transactions has grown immensely in recent years. Several factors have driven this energy consumption. Among them are "the increasing difficulty in mining" and "the large number of new market participants that have been attracted by the elevated prices of this developing financial asset" [59].
There are different studies such as the one by [60] that have tried to calculate "an aggregate price of electricity derived from Bitcoin as a function of the mining locations and the prices in these locations", others such as [15,16] point out that the price of electricity is a fundamental factor that will influence the mining decision, derived from the cost it represents. In the same vein, [61] argue that mining activities will only be profitable in those countries where the cost of electricity is lower than 0.14 USD/kWh and have the most efficient mining technology.
In our study we proposed a study in which, taking into account several determinants of cryptocurrency mining, we detected those countries that would be optimal from the point of view of environmental sustainability, to carry out this activity. However, there are authors such as [15] who point out that "renewable energies will not solve the problem of Bitcoin sustainability"; and although this is possible in the long term, at least in the short or medium term, cryptocurrency mining in countries where energy is generated in a sustainable way instead of more polluting sources such as coal, will be a relief for the environment. Thus, studies such as that of [62] point out that Bitcoin mining and the potential profits derived from it can incentivize the development of wind farms or renewable and sustainable energy sources. Furthermore, [63] point out that "a sustainable energy strategy focused on the penetration of renewable energy power sources, together with the use of energy efficient mining hardware, will alleviate Bitcoin's carbon footprint"; and according to [64], cryptocurrency mining is an opportunity for renewable energy. Along the same lines, [16] indicate that "Blockchain applications are expected to reshape the renewable energy market".
In our study to detect the most sustainable countries to carry out cryptocurrency mining activity, we used the following as variables: First, electricity prices (kWh, U.S. Dollar). These data, present the limitation that they refer to the year 2020, possibly having suffered some variation in the average price during the period until 2021.
Secondly, we took the production of electricity from renewable sources (% of total) as a variable. This variable has the same limitation, and that is that it refers to the closest data, which is the year 2020, and differences may have occurred in some countries.
The third variable we used was the average temperature per country in degrees Celsius. The limitation of this variable is that the 1961-1990 series was used, as we had not obtained more recent data to cover the selected sample of countries. Regarding the prohibition of mining/operation with cryptocurrencies by country, the limitation of this variable is given by the following; and that is that we have only taken as negative those countries that have "reliably" banned cryptocurrencies in their territory, but most of them have not made any pronouncement. This generates a de facto situation of illegality: it is not forbidden to operate with cryptocurrencies, but there is no clear regulatory framework either.
Of the variables R&D&I research and development expenditure (% of GDP), human capital index, and most sustainable countries, we did not detect any significant limitations.
Our statistical analysis sample (N) consists of 133 countries for which complete data are available, despite the fact that 144 countries appear in the initial dataset. The difference is due to missing data on the human capital index variable in several countries. After applying the regression, R-squared yields a result of 0.787. In addition, the Durbin-Watson test on our proposed model is 2.074, is very close to the value of 2, which according to this test indicates that there is absence of autocorrelation in the regression model used. Furthermore, after performing the ANOVA test, the p-value (Sig.) is less than 0.05. Therefore, the hypothesis presented can be accepted. Based on the Environmental Performance Index (EPI), we considered several determinants of cryptocurrency mining: energy price, how this energy is generated, temperature, legal constraints, human capital, and R&D&I. From this, via linear regression, we recalculated this EPI by including the above factors that affect cryptocurrency mining in a sustainable way. The study determines, once the EPI has been readjusted, that the most sustainable countries for mining cryptocurrency are Denmark and Germany. In fact, out of the top ten, eight of them are European (Denmark, Germany, Sweden, Switzerland, Finland, Austria, and the United Kingdom); and the remaining two are Asian (South Korea and Japan). On the opposite side we would find those countries in which performing cryptocurrency mining activity would not be sustainable. In this case, the worst places in terms of environmental impact in mining are South America (Bolivia, Venezuela, and Suriname) and the Caribbean (Cuba). Furthermore, on the African continent, Libya, Sudan, and Nigeria stand out, and in the Middle East, Pakistan and Iraq. Similar techniques to find optimal countries have already been used by [65,66], but in this case applicable to CBDCs. In addition, it must be taken into account that the possible implementation of a CBDC will reduce the demand for cryptocurrencies (even though they are very antagonistic systems), since one is centralized and the other decentralized [67]. In future, cryptocurrencies will become stronger and more usable in everyday life but once CBDCs (central bank digital currencies) are implemented these could overtake cryptocurrencies and weigh down the use and popularity of digital currencies such as Bitcoin. It will depend on whether the central banks finally decide to bet on CBDCs, following in the wake of the leading countries in this implementation (such as Bahamas or China); or not [68]; in the latter scenario having a greater demand for cryptocurrencies. Additionally, it is that as noted by [69] "Bitcoin is still in an embryonic stage and needs to evolve over time especially keeping pace with technological advances"; or also [70] "we refute the hypothesis that cryptocurrencies are sought as an alternative to fiat currencies or regulated finance." Notwithstanding the above, [71] in their study point out that "the findings show that these technologies are evolving, and organizations are adopting them to gain a competitive advantage; so there does not seem to be a clear trend about their future". In addition, "The vertiginous development of digital infrastructures together with the globalization of an increasingly agile and reliable network access and interconnection is causing a global digital ecosystem. Its configuration drives the concurrence of multiple disruptive processes" [72].
The study by [40] points out that, using grid electricity, Iran, Russia, and China are the best countries to mine BTC, while using natural gas for power generation, Iran, Canada, and Russia are the best countries to mine BTC. In our study, we took into account sustainable production as a determining factor.
Realistically, however, it is unlikely that without incentives this change can be realized. Although difficult, [24] point out that "a site regulation policy that induces changes in the energy consumption structure of mining activities is more effective in limiting carbon emissions". Along the same lines, the study by [17] analyzes the possible public policies to de-socialize the environmental externalities associated with blockchain technology designs and their excessive energy consumption, identifying for this purpose different fiscal policy options. Furthermore, [73] point out that incentive policies can be a determining factor, "cryptocurrencies offer an additional incentive to electric vehicle users". One option could be the one pointed out by [74,75] in which tax incentives could play an important role in determining the cryptocurrency mining location, together with favorable legislation [76]. However, in closing, reference should be made to the disciplining effect that cryptocurrencies may have on governments if it becomes a widespread means of payment. As pointed out by [77], "the ability of governments to conduct monetary, fiscal and drug policies would be undermined [ . . . ] and this would be an ethically desirable outcome from both a private property rights and utilitarian perspective". Furthermore, bearing in mind the possible adverse effects that public aid policies for renewable energies can bring, as the study by [78] points out precisely this negative experience from the experience of Spain. This situation could be used to try to attract cryptocurrency mining, for example, as we can see, this public aid policy brought adverse results. Finally, as indicated by [79], the classical belief that technological advances do not contribute to increasing social welfare must be abandoned, because "the more technological advances occur, the more suitable work is for human beings, as they can devote themselves to exploiting their personal talents"; and here responsible and sustainable mining can help to ensure the latter statement. Another factor to take into account that may affect miners' decision making is the possible profit or gain derived from this activity in such a volatile market, with smaller cryptocurrencies being particularly affected, as shown by [80]; or also the possible changes in the profile of people interested in these cryptocurrencies, as pointed out by [81]. It should be noted, as indicated by [82,83], that in a competitive free market environment, the cost of energy would tend to reduce due to business innovation, and therefore this will positively affect cryptocurrency mining as well.

Conclusions
Led by the success of Bitcoin, other cryptocurrencies such as Ethereum, Ripple, or Dogecoin, to name a few, have emerged and have experienced rapid growth and expansion. Mining is necessary for the operation of these decentralized virtual currencies. To do this, the necessary computer equipment consumes a large amount of energy. In our article, we showed that cryptocurrency mining is not currently being carried out in a sustainable manner, although this could be intuited. We started from the Environmental Performance Index (EPI). From the EPI, we considered several determinants of cryptocurrency mining: energy price, how this energy is generated, temperature, legal constraints, human capital, and R&D. From this, via linear regression we recalculated this EPI by including the above factors that affect cryptocurrency mining in a sustainable way. We detected, based on the new adjusted EPI, that sustainable cryptocurrency mining would currently only be possible if the mining capacity was moved from countries that have scored poorly in our index such as (Venezuela, Libya, Iran, or Malaysia) to other countries where although cryptocurrency is currently mined (Germany or Denmark), if done there, this activity would have a lower impact for the environment and the activity would be more sustainable as the energy needed for mining and cooling of the equipment comes from energy generated in a clean and planet-friendly way. While this seems difficult without a public policy of awareness, accompanied by regulation, recent bans on cryptocurrency mining in China open a window of hope for change. However, awareness policies are needed especially in countries where electric power is cheaper, and legislation is more lax. All this to raise awareness of the environmental damage that this cryptocurrency mining can cause. This brings with it another necessary issue, and that is the firm commitment of the countries, for the sake of a greater production of energy in an environmentally friendly way.