My Stacks Journey Part 2 - How It Works

In the second part of my AF series on trying to answer if Stacks benefits from Ordinals, I am going to look at the mechanics and technical aspects of Stacks briefly. If I can understand how the chain works, especially some upcoming upgrades, the answer to my question may become evident.

Nakamoto Tech

There are a few well-known scaling projects dedicated to helping Bitcoin scale. Lightning, RSK, Liquid BTC, and Stacks stand out among these projects. Lightning is in its own league as engineers designed it to bring much cheaper transactions to Bitcoin. Meanwhile, RSK, Stacks, and Liquid BTC bring additional functionality to Bitcoin, like smart contracts, tokens, and asset issuance.

I looked into RSK and Liquid BTC a few years ago, but when I looked, I was unimpressed by their approaches. RSK uses merge-mining with BTC, and Liquid BTC uses a federated model, and both use a BTC peg in/out process that, at the time, seemed to add more centralizing risk to Bitcoin scaling than I would like. Centralization/decentralization lies on a spectrum, but it seems best if Bitcoin scaling solutions add as little centralization risk as possible. After reading up on Stacks in my quest to see if it benefits from Ordinals at all, I have to say I am impressed by their approach.

As readers know, Stacks is a Layer 2 that brings smart contracts to Bitcoin. Stacks is currently in its V1 and uses a unique consensus model called Proof of Transfer [PoX] and STX as a gas token. In PoX, miners bid BTC to earn the chance to write a block to Stacks’ chain. If the miner writes a block, they earn STX transaction fees and an STX block reward. The Bitcoin miner’s bid is not burnt but sent to Stackers instead (more on them later). Stacks also uses a unique language for its smart contracts. The language, Clarity, is decidable, which should allow for easier verification at the expense of it not being turing complete.

Stacks has proposed a significant update to its protocol that should bring faster block times, faster transactions, and better security guarantees to Stacks. Called Nakamoto, the update is coming sometime in 2023 – probably Q4. The update could be a solid catalyst for the chain – especially as it puts it around the same time as Bitcoin’s halving. Nakamoto promises to make Stacks more resilient, faster, and permissionless than before by solving some critical issues with Stacks tech.

First, Nakamoto shifts Stacks to a five-second block time – down from ten minutes. Miners mine the shorter blocks on Stacks but post hashed Stacks transaction data into settlement blocks on every new Bitcoin block. As such, Stacks will inherit Bitcoin’s security and finality with a 150-block depth on Bitcoin – which is about a day. Secondly, Nakamoto adds the potential for app-specific subnets built on top of Stacks. For apps that need a faster block time or are willing to sacrifice some decentralization for performance, subnets could be a reliable tool to get what they need while also inheriting some of Bitcoin’s security guarantees through Nakamoto.

Finally, Nakamoto brings a novel peg in/out process for moving Bitcoin to Stacks, called sBTC. At the core of sBTC are the STX Stackers. Stackers are users who stake their STX to participate in the Stacks consensus and to secure the Stacks bridge. The sBTC bridge has two modes: Normal and Recovery. In Normal mode, users send BTC to a special BTC script wallet controlled by Stackers for a peg-in tx. When a user sends BTC to the wallet, Stackers mint sBTC to the receiving address on Stacks. Peg-out transactions work the same way, but 70% of Stackers must sign the peg-out transactions, which also take 150 blocks to process. To ensure their honesty, Stackers receive the BTC that miners bid to build blocks as a reward for signing peg ins/outs. Recovery mode occurs if normal mode fails. In this mode, Stacks uses BTC PoX payouts that Stackers would’ve received in Normal mode to pay the peg-out transactions – ensuring that BTC sent to Stacks is always recoverable. However, the peg-out Recovery mode would take a long time.

There are also a few nuances with sBTC that readers should be aware of. First, there is a maximum supply of sBTC. The sBTC supply cap is a governance set parameter proportional to the amount of STX stacked. The whitepaper states this is currently proposed at 60% – meaning that if $200M of STX is stacked and signing peg transactions, then the max supply of sBTC can be $120M. Stacks uses a 90-moving average to temper volatility. If the ratio in the peg exceeds the max ratio, no more peg-in transactions can happen. Interestingly, Stacks uses an on-chain STX/BTC oracle for this ratio, which can help reduce third-party oracle risks.

Performance Metrics

Now that you have a rough idea of how Stacks works now and after Nakamoto, here are some metrics on how Stacks performs compared to the larger market.

First, when I look at the daily transactions of Stacks vs. competitors like Ethereum, Optimism, and Arbitrum, they are not even in the same league. Ethereum sometimes does over 1M transactions per way, with Optimism and Arb doing less, but still comparable numbers. When we look at Stacks, however, we see that it rarely breaches 10K transactions per day. In 2023, Stacks averaged around 8.9K daily transactions on their chain. Stacks doesn’t even come close to being in the same league as its competitors, despite being live longer than Optimism and Arbitrum. Of course, Stacks being behind the big guys probably has more to do with Bitcoin’s conservative culture rather than any big technical flaw. However, Stacks has a long way to go before it starts putting up numbers like the Ethereum ecosystem.

Secondly, Stack’s fee earnings are low. Like other chains, Stacks pays miners an inflationary block reward through its consensus method. But, like other chains, they also pay transaction fees to miners. Stack’s fees are generally pretty low, with some significant spikes in activity. But so far, the fees the chain generates are nowhere close to where Stacks needs to be self-sufficient with no STX inflation. Of course, it is still early, and if Ordinals have brought a culture change to BTC, the Stacks fee story could change quickly.

The Ordinals Question So Far:

As I have been reading about Stacks, I have not yet found any direct benefit for Stacks from Ordinals. To me, it still seems to be a competitor. Of course, the utility of Ordinals and BRC-20s on Bitcoin is minimal – just minting and transfers. So Stacks could benefit from Ordinals by extending their utility beyond what Ordinals have on Bitcoin L1. But, this begs the question: why mint anything as an Ordinal? If Stacks can mint NFTs and tokens with its smart contracts, and after Nakamota gains finality and Bitcoin security after 150 blocks, why even bother with expensive Ordinals? Ordinals on Bitcoin offer better assurances for ownership and being uncensorable, but the market often doesn’t care about that.
I suppose, on some level, there is also the potential for Stacks to gain some use if Ordinals cause Bitcoin’s main chain to become too expensive to use – but this benefit will also go to its competitors. As mentioned in our BRC-20 report, a Stacks project is working on a permissionless Indexer, but still, the connections and benefits between Ordinals and Stacks seem ephemeral to me.

Leave your comment...

This is super interesting! Is there any info on the breakdown of transaction types on Stacks and the predominate activity there?

Stay tuned for this weeks issue. Next I want to see what people are doing on Stacks!

woot! cant wait