RV Blog What is Stacks?

What is Stacks?

What is Stacks?

Stacks is a layer-1 blockchain that allows for the execution of smart contracts. In contrast to commonly known smart-contract blockchains like Ethereum, Cardano, Solana, or Avalanche, Stacks is associated with the Bitcoin ecosystem because it aims to enhance Bitcoin’s capabilities by building on top of it.

While this goal might be similar to that of Bitcoin sidechains, drivechains, or second-layer solutions, being a layer-1 blockchain itself, Stacks has a unique way of achieving this. The project has its own nodes, its own network, its own miners as well as its own coin. Contrary to different Bitcoin sidechains, Stack’s coin (STX) is not pegged to on-chain BTC. The connection to Bitcoin is established as follows: The Stacks blockchain uses the Bitcoin base-layer blockchain as a reliable storage and broadcast medium, meaning that everything that happens on Stacks (the transaction history compiled in Stacks blocks) is recorded on Bitcoin itself.

In more technical terms one could say: Stacks’ entire state settles on Bitcoin. In order to create any Stacks block, a Bitcoin transaction has to be initiated on the Bitcoin blockchain itself. This transaction records the hash of a respective Stacks block and makes sure that the Stacks block is unambiguously anchored within a block on the Bitcoin blockchain. This way, Stacks’ entire transaction and state history is unequivocally represented on the Bitcoin base layer.

Understand the Future of Everything

Join the Crypto Revolution
Start Your Free Membership Now

100% Free. Yep, You Heard Us

Who is behind Stacks?

The Stacks project was initially founded by Muneeb Ali and Ryan Shea after they met each other at Princeton University. Originally, the project started under the name Blockstack. Already in 2017, the project managed to release a public alpha of the Blockstack browser. An early goal of the project was to launch a decentralized identity system. In 2018, Blockstack transformed into Stacks by successfully launching the Stacks 1.0 blockchain.

After this the building continued and one year later, Stacks raised about $23M in the first-ever SEC-qualified coin offering in US history. Throughout 2020, the migration to Stacks 2.0 was worked on. In early 2021, a successful hard fork happened and the mainnet of Stacks 2.0 went live.

The company that initially started the project, Blockstack PBC, has been transformed into Hiro PBC. It is this company that mainly builds developer tools for Stacks and can be considered the core entity within today’s Stacks ecosystem.

How exactly does Stacks interlink with Bitcoin?

Various projects nowadays claim that they are building on top of Bitcoin and they all seem to be doing it differently. The key concept behind Stacks and its relation to Bitcoin is its unique consensus mechanism called Proof-of-Transfer (PoX). Via this consensus mechanism, Stacks is tethered to Bitcoin by settling all Stacks transactions on Bitcoin.

Proof-of-Transfer is an adaptation of Proof-of-Burn (PoB), which was originally proposed as a consensus mechanism for the Stacks blockchain. With Proof-of-Burn, miners that participate in the consensus algorithm burn a cryptocurrency of an already established blockchain (by sending it to a burn address). It is their way of proving that they have incurred costs for proposing new blocks. With Proof-of-Transfer, this mechanism is slightly amended: The cryptocurrency used is not burned (i.e., destroyed) but distributed to a set of participants that help secure the new chain.

So, in Stacks’ case, miners that want to mine Stacks’ native coin (STX) and participate in consensus need to send a Bitcoin transaction (containing Bitcoin units) to predefined Bitcoin addresses. Only by transferring Bitcoin to a predetermined randomized list of Bitcoin addresses can blocks be produced within the Stacks blockchain. Whichever miners get to produce a block is ultimately decided by sortition. However, the probability of being chosen increases with the amount of bitcoin a miner transfers to the list of Bitcoin addresses.

In a sense, Stacks’ consensus mechanism is mimicking Bitcoin’s Proof-of-Work mechanism. But instead of using energy to produce new blocks, Stacks miners use bitcoin — that they need to buy at the market rate — to maintain the Stacks blockchain. Since this approach incurs costs for Stacks miners, they are compensated accordingly. Compensation is also similar to Bitcoin as it is provided in the form of block rewards and transactions fees from the Stacks network. The compensation is issued by the protocol in STX, Stacks’ native blockchain coin. The block rewards are as follows:

  • 1,000 STX per block are released in the first 4 years of mining after the mainnet launch
  • 500 STX per block are released during the following 4 years
  • 250 STX per block are released during the following 4 years
  • 125 STX per block are released from then on indefinitely

Since Stacks block rewards also halve every four years for three consecutive periods, these Stacks “halvings” are synchronized with Bitcoin halvings.

Sta(c)king without Proof-of-Stake

Without Proof-of-Transfer, the question is: Where do the Bitcoin units go that miners need to send in order to participate in Stacks’ block production? The receivers are Stacks stakers. This means: As a STX holder, one can register for a rewards cycle by broadcasting a signed message that locks up one’s STX coins for a defined lockup period. At the same time, a Stacks staker needs to provide his Bitcoin address to receive funds from block-proposing miners.

Temporarily locking up STX for bitcoin rewards to support the Stacks blockchain’s network security and consensus sounds an awful lot like ordinary staking that is common with a consensus mechanism called Proof-of-Stake. As we have seen though, Stacks’ consensus mechanism is not Proof-of-Stake at all. This is also why within the Stacks ecosystem users generally use the term “stacking” instead of “staking” when talking about the process of locking up one’s STX coins to participate in network security. Stacking happens over reward cycles with a fixed length. In each reward cycle, a set of Bitcoin addresses from stacking participants receives bitcoin rewards.

What about Stacks’ scalability?

Although Stacks is building on Bitcoin, it is not a second-layer technology to scale Bitcoin’s transaction throughput. It is more a Bitcoin-adjacent blockchain to bring new functionalities to Bitcoin’s base-layer blockchain. Nevertheless, because Stacks is its own layer-1 blockchain, whose blocks are anchored to Bitcoin’s, the fact is: The time to mine a Stacks block matches the expected block time of Bitcoin, which is on average 10 minutes. The question arises: Does this mean that the Stacks’ blockchain is limited to the same transaction throughput as the Bitcoin blockchain?

The answer is: Of course not. The Stacks blockchain has implemented a mechanism called microblocks that allows for increased transaction throughput and speed. Stacks blocks that are confirmed simultaneously to Bitcoin blocks are called anchor blocks and these occur every 10 minutes on average according to Bitcoin’s mining algorithm. In between these anchor blocks, Stacks allows for the creation of microblocks, which make for rapid settlement of Stacks transactions with a high degree of confidence. Transactions incorporated into microblocks will get confirmed once the associated anchor block has been approved. Through this method, the Stacks blockchain achieves scalability.

Clarity: Stacks’ unique smart-contract language

Establishing a proper interlinkage between Stacks layer-1 blockchain and Bitcoin is essential because only then can it be argued that Stacks’ inherent smart-contract capability benefits Bitcoin. Without an adequate connection, the smart contracts on Stacks would have no bearing on Bitcoin whatsoever.

Before elaborating on Stacks’ unique smart-contract language, Clarity, we first need to expand on how Stacks smart contracts interact with the Bitcoin base layer. When diving deeper into the mechanics, we can see that conceptually, there are 3 different transactions to an “isolated” Bitcoin-Stacks smart contract. Two Stacks transactions and one Bitcoin transaction.

In the first Stacks transaction, an arbitrary state change (could be almost anything) is written into the Stacks smart contract and parameters like the Bitcoin receiver address, amount of Bitcoin, or anything else is defined. Following this, a Bitcoin transaction is performed that is settling Stacks’ state on the Bitcoin blockchain. Once the Bitcoin transaction is confirmed, a second Stacks transaction is executed that verifies the Bitcoin transaction (i.e., Stacks’ current state on the Bitcoin base layer blockchain) and then executes whatever the Stack smart contract indicates — for example, the release of a Stacks-based digital asset. This is the process of how Clarity smart contracts are anchored down onto the Bitcoin blockchain, thereby making it possible for these smart contracts to operate based on actions seen on the Bitcoin blockchain.

As a matter of fact, a whole bunch of distinct software logic can be implemented through a Stacks smart contract. Apart from decentralized applications for financial use cases, other functionalities can be included as well:

  • Access control (for example, pay to access)
  • Non-fungible (for example, collectibles) and fungible tokens (for example, stablecoins)
  • Business-model templates (for example, subscriptions)
  • App-specific blockchains

Unique about Stacks’ smart-contract language is the fact that it optimizes for predictability and security. Clarity distinguishes itself from other smart-contract languages in two crucial ways:

  • The language is interpreted and broadcast on the blockchain as is (not compiled).
  • The language is decidable (not Turing complete).

The first feature ensures that the executed smart-contract code is human-readable and auditable at all times. The second point guarantees that it can be precisely determined which code is executed, for what function, and what duration.


Unlock Free Access to Real Vision Crypto

It’s a gift from us to you.
Understand the future of everything. Your free membership to Real Vision Crypto, the world’s premier cryptocurrency and digital assets video channel, is available right now.