The above considers a scenario where STX miners have been spending a total of 0.02 BTC per Stacks block, which is meant to loosely mimic the reality today. Trevor starts preparing to attack by spending 100x the amount of all other miners per block: 2 BTC. He starts mining with this spend at block N+1. The spend history in the table lists the amount of BTC spent for each of the last 6 blocks. The min and median of these 6 values is then used by the sortition algorithm to calculate the probability a miner will win a block, which is shown in the bottom row.
When Trevor first spends 2 BTC on block N+1, he functionally has no chance of winning that block. In fact, this continues for block N+2, where Trevor spends another 2 BTC. It's not until Trevor spends 2 more BTC to compete to mine block N+3 that his mining power reaches 25%. 25%, however, is insufficient for him to pull of his desired attack. He continues spending 2 BTC per block until block n+6. Once there, he will have spent 10 BTC over the previous 5 blocks, compared to a total of 0.1 BTC by all other miners. Now at block N+6, and 10 BTC poorer, Trevor has a 99% chance of winning, and is ready to attack.
As is the case with PoW based blockchains, the success of Trevor's attack is ultimately determined by his ability to out-mine the rest of the Stacks network to the point that his "double spend" chain is longer. The Stacks network and PoX, however, has a feature that makes Trevor's attack easy to thwart: No matter how strong Trevor is, it takes at least 2 blocks before he can do anything.
This is a key piece that makes the Stacks chain difficult to attack. During the minimum 2 blocks of preparation, every other miner, large Stackers, exchanges, and anyone else monitoring the network will immediately notice the 100x BTC spend to mine. This is because it's not rational for an economic actor to willfully choose to start losing a significant amount of BTC per block. Other participants on the network now have a number of options for how to censor Trevor's attack before it's ready. If economically viable to do so, other miners could simply start spending more BTC per block themselves. Even a modest increase will throw off Trevor's ability of ever getting his "double spend" chain ahead of the canonical chain. Separately, or in addition to this, network participants in general could simply move to increase the confirmation threshold, anchoring it at block N and extending for as long as it takes for Trevor to run out of BTC.
Interestingly, the above also holds true in the case where Trevor is an "honest" miner for any amount of time prior to preparing for his attack. The only way Trevor can avoid this is to build a private Stacks fork. To do so, however, he can't use the Bitcoin chain fork that the rest of the Stacks network follows, which is the canonical Bitcoin chain; otherwise they'll see his block commits. Trevor, therefore, would need to mine a private Bitcoin fork that contains his block commits. Once ready to attack, he would first broadcast his attack Bitcoin fork, and then broadcast the associated Stacks blocks. This means that the Stacks network makes building a hidden Stacks fork at least as difficult
as building a hidden Bitcoin fork.
As a result, the Stacks chain is difficult to attack, and in the short term may be more difficult, and certainly more complex to attack than PoW based chains. This is because, unlike with PoW chains, the honest, long-standing network participants on Stacks can quickly identify an incoming attacker's activity before it has a chance to impact the system. Because building an attack in private equates to building a private Bitcoin fork, the Stacks chain leverages the mining difficulty of Bitcoin to force attackers to reveal themselves before they can do any damage. All of this is to say the Stacks Network is actually incredibly difficult to attack, even at miner numbers that would not be considered optimal on a PoW network. STX Mining: Now & Where We're Going
At the most basic level, STX mining has already proven that people will spend Bitcoin for STX when it is economically profitable to do so. To date more than 500 BTC have been spent to mine over 30 million new STX tokens. In terms of profitability, STX mining is a numbers game: miners need to compete for enough blocks that the law of large numbers becomes relevant, and their probability of expected return is realized. In most cases, STX mining has been profitable and sustainable for miners who consistently stay online. To this end, Daemon is aware of at least 2 currently active mining pools. These are some of the first, as the pooling software is still in early stages.
Currently, STX mining has reached an temporary economic equilibrium of between 2.0 - 3.0 million Satoshis being spent by STX miners every block. As we move forward from the first 4 months of the Stacks 2.0, we expect that number per block to grow, potentially dramatically. This will happen as STX appreciates compared to BTC. But why would that happen?
The main utility of the Stacks chain and network is to enable smart contracts, and more generally DeFi and Web 3.0, on top of Bitcoin. STX tokens themselves can be thought of as compute credits in many ways, serving this exact use case. As more and more of this utility is built
in the coming months and years, a large amount of value could accrue to STX by creating popular smart contract use cases that can settle down to Bitcoin. Any resulting appreciation of STX compared to BTC would represent the market value of smart contracts on top of Bitcoin.
Today, Clarity smart contracts have been live for 4 months, and are at the very beginning of the adoption curve. This can be quantified. 1 STX token is currently worth ~0.00003 BTC. Put another way, STX is roughly 0.0003% the value of BTC. This makes sense given the nascence of the network and Clarity. In the near future, however, if the value of smart contract use cases on Bitcoin is worth even 1% the value of BTC, then we will see miners spending considerably more per block, and a much higher equilibrium may form. In addition, the imminent existence of STX mining pools
will continue to allow more participation in mining.
What this means for Daemon Technologies going forward is we are focused on two paths: (1) continue building tools for STX miners and mining pools, and (2) create and incentivize others to create valuable applications, products, and services with Clarity smart contracts. We should be able to start measuring early results in the coming months, and we expect the economics of mining to naturally adjust to allow a higher BTC spend per block and/or a higher number of miners (e.g. higher gas fees). Conclusion
It's still early days for STX Mining, and for the Stacks 2.0 chain in general. STX Mining has been initially validated, and Daemon is excited about the ability for the network to profitably support many more miners in the future. The reason is the Stacks network uses Bitcoin as an ultimate settlement layer, making smart contracts, and use cases such as DeFi, on top of Bitcoin possible. We believe this is the killer use case for Bitcoin, and that this type of system design on top of BTC will become the norm over time.