Statistical Confidence in Mining Power Estimates for PoW Blockchains

The security of blockchain systems depends on the distribution of mining power across participants. If sufficient mining power is controlled by one entity, they can force their own version of events. This may allow them to double spend coins, for example. For Proof of Work (PoW) blockchains, however, the distribution of mining power cannot be read directly from the blockchain and must instead be inferred from the number of blocks mined in a specific sample window. We introduce a framework to quantify this statistical uncertainty for the Nakamoto coefficient, which is a commonly-used measure of blockchain decentralization. We show that aggregating blocks over a day can lead to considerable uncertainty, with Bitcoin failing more than half the hypothesis tests ({\alpha} = 0.05) when using a daily granularity. For these reasons, we recommend that blocks are aggregated over a sample window of at least 7 days. Instead of reporting a single value, our approach produces a range of possible Nakamoto coefficient values that have statistical support at a particular significance level {\alpha}.


Introduction
The security of Proof of Work (PoW) blockchains depends on the distribution of mining power across participants [GKL15, ZXL19, NBF + 16].For example, an attacker controlling the majority of the mining power in the Bitcoin network could rewrite the blockchain and double spend coins (aptly termed a 51% attack).However, unlike, say, stake in a Proof of Stake (PoS) system, the exact mining power of each party cannot be directly retrieved from PoW blockchains.
State-of-the-art approaches to estimating mining power rely on the fact that an entity with X% of the mining power has an X% chance of mining a specific block [OKK24].Therefore, entities with more mining power are more likely to have mined more blocks.By the same reasoning, entities who mined more blocks in a time period likely held more mining power.Indeed, various authors [LLZC21, CCC + 23, LPXD23,BS15] assume that an entity who mined X% of the blocks in a certain period held X% of the mining power.
This inference is imperfect though.A trivial example illustrates what this assumption depends upon, namely observing sufficient blocks.If calculations are based on observing just one block, the above approach would infer that the entity who mined that block holds 100% of the mining power.In reality, this miner was just the winner of a single stochastic process, and likely holds a fraction of the mining share.Clearly the solution is to observe more than one block, but the question is, how many blocks do we need to observe to obtain reliable estimates?This is a classic problem in statistical inference.
We answer this question with respect to a metric that summarizes the distribution of mining power, namely the Nakamoto coefficient (NC).The Nakamoto coefficient is defined as the minimum number of independent entities needed to obtain the majority ownership of a blockchain [SL17].In these settings, the Nakamoto coefficient measures the resilience of a network by capturing blockchain decentralization, yet there is no method for calculating whether enough blocks have been observed.
This paper provides an approach to quantifying statistical uncertainty when determining the Nakamoto coefficient.We answer the following research questions: RQ1 How can we evaluate statistical confidence in NC estimates?RQ2 Are estimates in prior work statistically sound?Contribution We introduce a framework that models the probability of a group of entities mining a block as a binomial distribution.This approach enables us to calculate whether a given Nakamoto coefficient estimate passes a hypothesis test at a given confidence level α.We show that most estimates for Bitcoin do not pass a binomial hypothesis test with α = 0.05 if a daily granularity is used.The framework also provides a range of plausible values for the Nakamoto coefficient, which have statistical support.We also provide Python code extracts (Appendix B) using our framework to support future work. 1  Section 2 introduces our statistical framework and data collection choices.Section 3 displays the statistical confidence in Nakamoto coefficient estimates across various blockchains.Section 4 identifies the methodological choices in prior work.Section 5 discusses our framework and results, while Section 6 offers a conclusion.

Approach
We introduce a framework to evaluate the statistical uncertainty in estimates of mining power distribution in Section 2.1.We then explain how we collected empirical data in Section 2.2.

Framework
To address RQ1, we develop methods to evaluate and visualize statistical confidence in the Nakamoto coefficient at the consensus layer for PoW blockchains.At a point in time, the Nakamoto coefficient can be modelled as a multinomial distribution in which each miner holds a proportion, p i , of the total mining power where n i=1 p i = 1.A Nakamoto coefficient of C is equivalent to saying C is the smallest integer such that C i=1 p i > 0.5 where p 1 , ... p n are ordered in decreasing size.
The proportion of mining power (p i ) owned by entity i, cannot be directly observed, and must instead be inferred from the share of blocks mined by each entity.The i-th entity is expected to mine n × p i blocks given n opportunities.Due to the stochastic mining process, the actual number of blocks mined are randomly distributed around this expected value.By the law of large numbers, the proportion of blocks pi mined per entity converges on p i given enough observations n.Thus, we can use the observed proportions pi as a proxy for the true mining power p i providing we accept statistical uncertainty.
Turning to the Nakamoto coefficient, the question is not whether the i-th miner holds p i of the mining power, but instead whether the top C miners collectively hold mining power p C > 0.5.This reduces the mulitnomial distribution to a simple binomial distribution in which n is the number of blocks in a sample and k is the number of blocks mined by the top C miners, such that pC = k n .This allows us to conduct a hypothesis test of a Nakamoto coefficient estimate at a given significance level α, as follows: We assume the underlying distribution is a binomial B(0.5), and reject H 0 if the probability of observing pC is less than α.If the blockchain is such that an attack can be launched if an entity controls X% of the mining power, then the p-values should be calculated according to B(X).If the null hypothesis is rejected, then there is statistical support for saying that the true Nakamoto coefficient is C or less.
The significance level α can be viewed as the acceptable rate of false positives.It is the rate at which the null hypothesis is rejected when it is in fact true.An α value of 0.05 is the most common choice within the scientific community, while lower values can be used to provide higher confidence in the results [BJP10].
Note that, if the null hypothesis is rejected for some C, then the Nakamoto coefficient is not necessarily equal to C, as the top C − 1 miners may also have mined enough blocks in the n trials to reject H 0 .This motivates the concept of a confidence interval [a, b] of possible Nakamoto coefficients at the α confidence level.This range is such that a is the smallest number of top miners for which the null hypothesis would be rejected, and b is the largest value of top miners for which the alternate hypothesis would be rejected.These can be seen as the upper and lower bounds for the Nakamoto coefficient.
If a given observation of n blocks has a confidence window [a, b] such that a < b, then we should report the Nakamoto coefficient as a range, since we cannot reject any of those values at the significance level α.This allows us to visualize the statistical uncertainty in a given estimate, and the p-values allow us to quantify uncertainty.The range is analogous to an error bar.
Through hypothesis tests using real blockchain data, we will show that the existing approach to calculating the Nakamoto coefficient create a false sense of security by obscuring the statistical uncertainty.These empirical results can be found in Section 3.

Data Collection
To apply this framework, we first collected data about the distribution of produced blocks of 5 different PoW blockchains, using datasets provided by Big-Query [FB15].Table 1 shows the ledgers that we analyzed, together with the sample window we used and the mean number of blocks per day for each of them. 2 The raw data from BigQuery was manually parsed such that each entry corresponds to a block and contains the block's number, its timestamp, the address which receives the fees from the block, and some identifiers that can potentially be used to attribute the block to the entity that produced it. 3o get a more accurate picture of the distributions, the addresses were mapped to the entities that control them using three different methods: known identifiers, known addresses, and known clusters.Briefly, the first tries to match well-known pool tags with the block's identifier, the second cross-checks the block's reward addresses with known pool addresses, and the third uses known legal ties between pools and is applied after the first two have successfully attributed a block to a pool.The attribution data needed for this were obtained through public blockchain explorers4 and community projects. 5If no match is found by any of these methods, then the block's address is considered a unique identity.Due to the pseudonymity of these systems and the fact that we cannot have attribution data for all addresses, it is of course possible that some of the "unique identities" are, in reality, controlled by the same entity.However, we do not expect this to be a problem in our context, as the Nakamoto coefficient only looks at the "biggest" entities of the system, for which there typically exists plenty of information.
Our data spanned three years, and the daily blocks mined range from 140 to 6,500 across the different ledgers.The number of unique entities mining these blocks ranged from 236 (Bitcoin) to 16021 (Ethereum).We count how many blocks were produced by each unique entity.
To translate this into time-series data, we use sliding window sampling where the data can be aggregated across n-days.Figure 1 shows an example of this sliding window sampling with a 3-day sample window.Here, the first sample window consists of all blocks mined in days 1-3.The second sample window consists of all blocks mined in days 2-4, and so on.To calculate the Nakamoto coefficient for a given window, we count the number of blocks mined by each entity i in the specific window.We then calculate p i , the number of blocks mined by entity i divided by the total number of blocks in that window, and use all the values p i to calculate the Nakamoto coefficient using the definition from Section 2.1.
We explore how changing the value of n, which we call the granularity of the estimates, impacts statistical confidence.

Results
This section explores how statistical confidence in Nakamoto coefficient estimates is impacted by two core parameters, namely the significance level α and the granularity of the sample window.It also compares uncertainty in estimates across different ledgers.Throughout we chose sample windows that best illustrate the statistical methods that we developed.
Granularity impacts how sensitive the measurement is to fluctuations over time.High granularity estimates aggregate over a shorter time period, which makes them more sensitive to changes in the distribution of mining power.This helps participants to rapidly detect the potential for a 51% attack.However, high granularity also requires estimating with fewer blocks mined.This lower n increases the probability of observations deviating from the true distribution of mining power.We explore the impact of aggregating daily, across 3-days, 7days, 14-days, and 30-days.Ideally, researchers would use the lowest granularity that achieves a tolerable level of statistical confidence.
To evaluate granularity, we can test whether estimates with that granularity pass a hypothesis test at a given confidence level α.Figures 2 and 3 demonstrate the relationship between granularity and statistical confidence at significance levels α = 0.05 and α = 0.01 respectively.The most notable characteristic is that statistical uncertainty varies significantly across ledgers for the same granularity level.This is driven by two factors: (i) blockchains with a higher throughput have more blocks in a given time period (more statistical power); and (ii) there is more statistical confidence in low values of Nakamoto coefficient because the distribution of blocks mined has less entropy.
Figure 2 demonstrates that when using the confidence level of α = 0.05 and a daily sample window, Nakamoto coefficient estimates for Bitcoin fail our hypothesis test more than 50% of the time.Bitcoin Cash shows similar results.Ethereum and Zcash pass a statistical test 90% of the time, even when using just a day's worth of block data.Aggregating blocks over 7 days creates a lot more statistical confidence, with all ledgers passing the hypothesis test over 80% of the time (at a 7-day granularity, Bitcoin passes 80.45% of hypothesis tests).There are diminishing returns to increasing granularity beyond this point.Even with monthly data, none of the ledgers pass out hypothesis test 100% of the time.
We re-ran the same tests with a stricter significance level (α). Figure 3 shows how often each coin passes a hypothesis test with the significance level α = 0.01.The same broad story holds-we see low statistical confidence in Bitcoin and Bitcoin Cash, whereas we are more confident in the estimates for Ethereum and Zcash.Again, Bitcoin and Bitcoin Cash have lower throughput than the latter.For this significance level, the diminishing returns set in for a 14-day sample window, after which the gains in statistical confidence are limited.
Thus far, we have explored statistical confidence in a single Nakamoto coefficient estimate calculated directly from the observed data.However, it may make more sense to consider the potential values of the Nakamoto coefficient.The estimate calculated directly from the data is always the most plausible, however it is possible that higher and lower values may also be plausible if we cannot rule out these values at a given significance level.In this way, our approach also provides us with insight into all the potential values of the Nakamoto coefficient, as explained in Section 2.1.For the sake of brevity, we focus on a 5% significance level. 6 Table 2 compares the direct value of the Nakamoto coefficient to the range of possible values using our method based on a daily granularity.Across the 2-week period in 2019, 44% of the direct values could plausibly be lower.At a 5% significance level, we could not reject the possibility that a single entity held the majority of the Bitcoin Cash mining power on the 1 st , 2 nd and 5 th of January 2019.For the other ledgers, there are no days where a single entity might plausibly control a majority of the mining power.However, for both Bitcoin and Zcash, there were days where 2 entities could plausibly have held the majority of the mining power.
More generally, we find that the direct values consistently under-estimate  how centralized these blockchain systems are.In all cases in Table 2, the possible values are lower than the direct value.This result is not because we do not test whether higher values of the Nakamoto coefficient are possible.Indeed, when we use stricter significance levels, we find possible values that are higher than the direct value, which can be seen in Table 3.However, there is a structural bias in that direct estimates of the Nakamoto coefficient under-estimate how centralized blockchain systems are.
Zooming out to a longer time frame, Figure 4 shows how the range of possible Nakamoto coefficients unfolded throughout 2019 for Bitcoin.There is rarely statistical support to say there is exactly one true estimate, and instead the Nakamoto coefficient should be reported as a range.The summer of 2019 appears to be a transitional period in which the Bitcoin ecosystem shifted towards more centralization in the distribution of mining power.In particular, there were days in which a Nakamoto coefficient estimate of 1 was plausible.Notably, a low value for the lower estimate should be seen as a potential security risk.
For Table 2 and Figure 4, we fixed α = 0.05.Table 3 explores how the Nakamoto coefficient estimates for Bitcoin change when we vary the confidence level, again for the 2-week period (Jan 1 2019 -Jan 14, 2019).Applying the strict confidence level of 0.1%, plausible values range from 2 to 5 on the 6 th of January.We cannot say what level of statistical confidence is appropriate, but it clearly makes a difference when estimating the Nakamoto coefficient.

Related Work
The Nakamoto coefficient is regularly used to summarize mining power distribution [SL17, LLLL23, LLZC21, CCC + 23, LPXD23, ZCC + 21, RJZH19, LMTS22, GHW23].Other works use the Nakamoto coefficient to capture other layers of the blockchain, namely governance token and/or token distribution [JvWR21, KO22,FMW22].We focus on a handful of articles that illustrate why statistical confidence matters and how to use our framework.
In 2017, Srinivasan and Lee [SL17] introduced the Nakamoto coefficient.In  doing so, they calculated it for Bitcoin and Ethereum on a single day (i.e., daily granularity).Although the specific date is not mentioned, we are led to believe it is the 24-hour period preceding publication on 28 July 2017.In this inaugural paper, Srinivasan and Lee reported that Bitcoin had a Nakamoto coefficient of 5.However, even with the standard significance level (α = 0.05), we could not rule out the possibility that the Nakamoto coefficient could have been 4.When investigating the source of Srinivasan and Lee's data [SL17], the dashboard warns that "our analysts have found that weekly numbers are a better representation of the underlying power, because they are less sensitive to mining randomness" [Blo24], but they do not support this statement with statistical analysis.For their sample window, Ethereum likely had sufficient statistical confidence (see Figure 2).7 Lin et al. [LLZC21] measure the same two ledgers, but use three different levels of granularity.Two of these (weekly and monthly) are likely appropriate, although reporting this via statistical tests would increase our confidence.However, they also report on estimates using a daily granularity, which is not appropriate for Bitcoin.
Liu et al.
[LLLL23] also use three levels of granularity (daily, weekly, and monthly) to summarize data for Dogecoin and Ethereum Classic.Both blockchains have high throughput and, thus, likely have sufficient statistical confidence for all granularities.Nevertheless, reporting on statistical tests using our framework would support this choice.
Compajola et al. [CCC + 23] use a weekly granularity for a range of ledgers.This weekly granularity conforms with our recommendations, although we did not check whether it is appropriate for Monacoin or Feathercoin.Finally, Li et al. [LPXD23] used a daily granularity for Steem and Ethereum.It is unclear whether this granularity was appropriate for Steem, which we did not investigate.For new ledgers, researchers need to run their own statistical analysis using the framework introduced in Section 2 and the code published in the Appendix.

Discussion
This section discusses implications and future work.
Implications It is natural to ask whether reporting statistical confidence matters.As discussed, most researchers calculate the Nakamoto coefficient by assuming the observed distribution of mined blocks is equal to the true distribution of mining power.In their defense, this estimate is the most plausible value, even though there may be other plausible values.All of the possible values in Table 2 include the value that most researchers calculate by default.
Statistical uncertainty matters when it has security implications.For example, the default approach might lead researchers to estimate a Nakamoto coefficient of 2, even though 1 is a plausible value.This would mean there is a non-negligible probability that one entity can launch a safety attack.In this way, the direct approach-universally used in industry and academia-can create a false sense of security.In particular, we have shown that the direct approach appears to have a bias towards under-estimating centralization, at least in the blockchains and time periods that we studied.
One potential criticism of our work is that we run too many statistical tests.Ioannidis [Ioa05] made the influential argument that most scientific findings are false because the significance level α = 0.05 is vulnerable to various publication biases when researchers run many statistical tests and selectively report on the significant ones.In the same way, one might argue that our study ran thousands of statistical tests, and so it is unsurprising that the direct values lacked statistical support some of the time.We accept that some estimates lacking support is inevitable.However, it happens too often for some levels of granularity.For example, Figure 2 shows that most Nakamoto coefficient estimates for Bitcoin do not have statistical support based on a daily granularity.
Going forward, one solution is for researchers to report statistical uncertainty using the framework introduced in this paper.The Nakamoto coefficient can be reported as a range of plausible values (see Table 3).It is much harder to do the equivalent for other metrics (see Appendix A) because of their complexity.However, we acknowledge that not all authors will report a range of values.For this reason, we reluctantly make the recommendation that a granularity of at least a week is used when estimating the Nakamoto coefficient for PoW blockchains.Such values achieve most of the reduction in statistical uncertainty.However, it is possible that systems exist that require a a longer sample window, such as those with particularly low throughput.
(Reluctant) Recommendation If researchers do not report a range of values, they should calculate Nakamoto coefficient values using a granularity of at least 7 days.
Future Work There are additional directions for methodological contributions.One direction is to identify statistical tests for other metrics that are used to quantify blockchain decentralization, such as the Shannon entropy, Gini coefficient, and/or Herfindahl-Hirschman index (HHI).Appendix A begins to explore the mathematical relationship between these metrics and the Nakamoto coefficient, specifically for the case where the coefficient is 1.Future work should generalize this formal analysis for arbitrary values and also the relationship between other metrics, for example Gini and HHI.
For the Nakamoto coefficient, we defined granularity as a fixed time window (e.g., 1-day or 7-day).It is possible to instead base each calculation on a fixed number of blocks mined.This would ensure every estimate has sufficient statistical power.However, it would also mean that blockchains with high throughput, say Ethereum, would be more sensitive to temporal variations than blockchains with lower throughput, say Bitcoin.For example, Bitcoin would contribute 1000 new blocks approximately once a week, whereas Ethereum does this every 4 hours.
More fundamentally, statistical uncertainty is just one potential bias or inaccuracy related to decentralization estimates.Attribution uncertainty is another source of error.For example, a system may become centralized if two entities secretly coordinate actions (or are in fact the same entity).Similar hazards may occur when individual miners offer significant power in parallel to multiple, seemingly independent pools [RJZH19].Additionally, block attribution tags, such as Bitcoin's coinbase parameter, are filled by pools on a voluntary basis.In particular, although pools tend to claim blocks as their own by adding their attribution information in them, this information cannot be independently verified, so some level of trust is necessary, i.e., assuming that the information is correct.In summary, block attribution is typically done in an ad-hoc manner, so the research community should build robust techniques and datasets to address the problem of mapping out the ecosystem of entities and their relationships.

Conclusion
Block mining is a stochastic process, with success determined by each entity's mining power.For PoW blockchains, the distribution of mining power cannot be read directly from the blockchain, and must instead be inferred from the number of blocks mined.We introduced a framework to quantify this statistical uncertainty.
We showed that aggregating blocks daily can lead to considerable uncertainty when estimating the Nakamoto coefficient.For example, estimates for Bitcoin from 2018-2023 fail a hypothesis test more than half the time when using a day's worth of block data.Blockchains with higher throughput had less statistical uncertainty.We also showed that the existing approach to calculating the Nakamoto coefficient consistently underestimates the centralization of mining power, which provides a false sense of security regarding the risk of a 51% attack.
Looking forward, a granularity of 7-14 days appears to achieve the best balance between statistical power and sensitivity to temporal fluctuations in the distribution of mining power, at least among the blockchains that we studied.We also recommend that authors report a range of possible Nakamoto coefficient values, which have statistical support at a particular significance level α.To allow researchers to run hypothesis tests and calculate this range, we produced the relevant code in Python, which is publicly available on GitHub 8 and can be https://www.core-econ.org/doing-economics/book/text/05-02.html(visited2024-03-11).

A Other Metrics
Given our framework is tailored to the Nakamoto coefficient, we explored the mathematical relationship between the Nakamoto coefficient and other popular decentralization metrics.In particular, we focused on whether other metrics can identify distributions of mining power with the highest security risk.This occurs when the Nakamoto coefficient is 1, which means a single entity holds more than 50% of the mining power.We explore possible values of the other decentralization metrics when the Nakamoto coefficient is 1.Our analysis reveals that, in this setting, the HHI must be greater than 2500, Shannon entropy can be any value, and the Gini coefficient is 0.5 or more if n is sufficiently high.

A.1 Herfindahl-Hirschman Index (HHI)
The HHI is the sum of the squares of each entity's percentage of market control: It ranges from 0 to 10,000, where higher values indicate a more concentrated market, and therefore a system which is more vulnerable to a safety attack.If we assume that 1 person holds the majority of the resources, then the HHI will be minimized when the remaining resources are held in equal share (s i = 1−s1 n−1 , where s i is the share of resources held by the i-th entity).Let s 1 be the share of the market controlled by the most powerful entity.Then, This value is lowest for very large n.Therefore, lim n→∞ HHI = s 2 1 .
This means that given an HHI of less than or equal to 2500, we know that the Nakamoto coefficient must be greater than 1.

A.2 Shannon entropy
Formally, Shannon entropy is defined as: where X is a discrete random variable that takes values in X and p(x) is the probability of an outcome x ∈ X .A system with high entropy is a decentralized system.Once again we consider a setting with a Nakamoto coefficient of 1 where p 1 is the proportion of resource ownership by the majority party.Once again, we know that entropy will be maximized if the remaining n − 1 parties hold the remaining resources in equal share, So, with a high enough number of participants, we could observe a high value of entropy, but was due to having a large population rather than actual security.
This means regardless of the observed value for Shannon entropy, it is possible that the Nakamoto coefficient is 1.

Figure 1 :
Figure 1: A sliding window with a 3-day granularity.

Figure 2 :
Figure 2: How often a Nakamoto coefficient passes a hypothesis test at α = 0.05 with differing levels of granularity (based on our full dataset from 2018-2023).

Figure 3 :Figure 4 :
Figure 3: With a smaller confidence level (α = 0.01), a smaller proportion of hypothesis tests are passed (based on our full dataset from 2018-2023).
m p u t e n a k a m o t o c o e f f i c i e n t ( row ) : """ 5 : param row : s e r i e s o f b l o c k s mined by each d i s t i n c t e n t i t y 6 : r e t u r n s : nakamoto c o e f f i c i e n t f o r t h e g i v e n row """ 8 t o t a l b l o c k s = sum( row ) 9 nc , p o w e r r a t i o = 0 , 0 10 i f t o t a l b l o c k s > 0 : 11 f o r b l o c k s in row .s o r t v a l u e s ( a s c e n d i n g=F a l s e ) : 12 nc += 1 13 p o w e r r a t i o += b l o c k s / t o t a l b l o c k s 14 i f p o w e r r a t i o > 0 .5 : m p u t e n a k a m o t o c o e f f i c i e n t s ( d f ) : """ 21 : param d f : dat af r am e o f b l o c k s mined , w i t h 22 d a t e s i n rows and d i s t i n c t e n t i t i e s i n columns 23 : r e t u r n s : dat af r am e o f nakamoto c o e f f i c i e n t , w i t h 24 d a t e s i n rows and c o r r e s p o n d i n g v a l u e s o f nc i n columns """ 26 n c s e r i e s = d f .apply (lambda row : c o m p u t e n a k a m o t o c o e f f i c i e n t ( row ) , a x i s =1) 27 n c d f = pd .DataFrame ( { ' nc ' : n c s e r i e s } , i n d e x=d f .i n d e x ) 28 return n c d f ✝ ✆ Listing 1: Python code to compute the Nakamoto coefficient.✞ ☎ 1 from s c i p y .s t a t s import b i n o m te s t 2 import pandas a s pd 4 def f i n d n c r a n g e ( df , n c d f , a l p h a = 0 .0 5 ) : """ 6 : param d f : dat af r am e o f b l o c k s mined , w i t h 7 d a t e s i n rows and d i s t i n c t e n t i t i e s i n columns 8 : param n c d f : dat af r am e o f nakamoto c o e f f i c i e n t , w i t h 9 d a t e s i n rows and c o r r e s p o n d i n g v a l u e s o f nc i n columns 10 : r e t u r n s : dat af r am e o f r an g e o f nakamoto c o e f f i c i e n t v a l u e s , w i t h 11 d a t e s i n rows and l ow e r , upper nakamoto c o e f f i c i e n t i n columns """ 13 l o w e r , upper = [ ] , [ ] 14 f o r d a te in d f .i n d e x : 15 t o t a l b l o c k s = d f .l o c [ d a te ] .sum( a x i s =0) 16 c o e f f = n c d f [ ' nc ' ] .l o c [ d a te ] 17 c o e f f p , c o e f f q = c o e f f , c o e f f 18 i f t o t a l b l o c k s > 0 : 19 s o r t e d d f = d f .l o c [ d a te ] .s o r t v a l u e s ( a x i s =0 , a s c e n d i n g= F a l s e ) 20 s u c c e s s e s = s o r t e d d f .n l a r g e s t ( c o e f f ) .sum( ) 21 p = b i n o m te s t ( k=s u c c e s s e s , n=t o t a l b l o c k s , p = 0 .5 , a l t e r n a t i v e= ' g r e a t e r ' ) .p v a l u e 22 i f p > a l p h a : 23 while p > a l p h a : # upper 24 c o e f f p += 1 25 u p p e r s o r t e d = d f .l o c [ d a te ] .s o r t v a l u e s ( a x i s =0 , a s c e n d i n g=F a l s e ) s u c c e s s e s = i n t ( u p p e r s o r t e d .n l a r g e s t ( c o e f f p ) .sum ( ) ) p = b i n o m te s t ( k=s u c c e s s e s , n=t o t a l b l o c k s , p = 0 .5 , a l t e r n a t i v e= ' g r e a t e r ' ) .p v a l u e 28 c o e f f p −= 1 29 q = b i n o m te s t ( k=s u c c e s s e s , n=t o t a l b l o c k s , p = 0 .5 , a l t e r n a t i v e= ' l e s s ' ) .p v a l u e 30 i f q > a l p h a : 31 while q > a l p h a : # l o w e r 32 c o e f f q −= 1 33 l o w e r s o r t e d = d f .l o c [ d a te ] .s o r t v a l u e s ( a x i s =0 , a s c e n d i n g=F a l s e ) s u c c e s s e s = i n t ( l o w e r s o r t e d .n l a r g e s t ( c o e f f q ) .sum ( ) ) q = b i n o m te s t ( k=s u c c e s s e s , n=t o t a l b l o c k s , p = 0 .5 , a l t e r n a t i v e= ' l e s s ' ) .p v a l u e 36 c o e f f q += 1 37 l o w e r .append ( c o e f f q ) 38 upper .append ( c o e f f p ) r e s u l t = pd .DataFrame ({ ' l o w e r ' : l o w e r , ' upper ' : upper } , i n d e x= d f .i n d e x )

Table 1 :
Data we collected using Google BigQuery.

Table 2 :
Using the daily granularity and α = 0.05, we see a range of possible Nakamoto coefficients across ledgers.Red cells show us days where the possible Nakamoto coefficient was lower than the reported value, indicating a possible security risk.