Stacks (STX) Review: Making Bitcoin Programmable
Stacks 2.0 is the rebranded and upgraded iteration of Blockstack addressing the utility and scalability issues that affect the Bitcoin network. It is a layer-1 blockchain that assists in using smart contracts and dApps indirectly on Bitcoin’s network.
In order to achieve this the team has created a new and unique consensus mechanism they’ve dubbed Proof of Transfer (PoX) which connects the Bitcoin and Stacks blockchains. In this design the Stacks blockchain contains the smart contracts, whereas the Bitcoin layer acts as the finality and security layer. Leader elections occur on the Bitcoin blockchain, while new blocks are written to the connected Stacks blockchain.
In this network construction the Stacks blockchain transactions are capable of scaling independent of the Bitcoin blockchain. Bitcoin’s chain is only needed for security and finality. This means that thousands of transactions on the Stacks blockchain result in just one single hash on Bitcoin’s blockchain.
These Stacks transactions are settled on Bitcoin automatically each time a block is created on Bitcoin. In addition, Stacks introduces a new concept of microblocks that provide confirmation in seconds. The microblock idea is the main direction for scalability research, where a theoretically faster consensus algorithm like PoX can use microblocks that settle on Bitcoin each time a new block is mined.
Thus Bitcoin serves as Stacks settlement protocol. The Bitcoin blockchain and blocks serve as the ultimate truth, and hashes of the Stacks block history are archived on Bitcoin. The Stacks team chose Bitcoin as the settlement, security and finality layer due to its proven history of excelling in all three areas.
Smart contracts and dApps are programmed using a new language called Clarity, which benefits from being a predictable language that uses no compiler.
The project has four major layers – the application layer, the protocol layer, the Stacks blockchain, and the Bitcoin system.
Stacks 2.0 Design Elements
It’s mentioned above that the Stacks blockchain can support the use of smart contracts and decentralized applications, and depends on Bitcoin for security and finality. It uses a new consensus algorithm called Proof of Transfer (PoX), and we will explore PoX and its capabilities in further detail below.
Proof of Transfer (PoX)
Every consensus algorithm used in blockchain constructs requires some type of resource to secure the blockchain, whether it be computing resources or financial resources.
For the most part these algorithms are divided into two major types. The first is proof-of-work, where nodes dedicate computing resources in a process called mining. The second is proof-of-stake, where the nodes dedicate financial resources in a process called staking.
The high level idea that led to the creation of proof-of-work and proof-of-stake is to make it feasibly impossible for a malicious entity or group of entities to be able to attack the network.
There are variants of these two primary algorithms, and one of the variants of proof-of-work is the proof-of-burn consensus mechanism where miners compete for network rewards by “burning” or destroying the proof-of-work cryptocurrency in lieu of using computing resources.
Stacks has taken the proof-of-burn concept to create a new consensus mechanism they’ve named Proof-of-Transfer.
The PoX algorithm is in essence a generalization of Proof-of-Burn. In PoX the Proof-of-Work cryptocurrency of an already established blockchain is not burned, but instead it is used to secure the new blockchain. Rather than burning the existing cryptocurrency it is transferred by miners to other participants in the network.
The miners receive some of the new cryptocurrency and the other network participants receive the established cryptocurrency in the transfer. This allows network participants who are adding value to the new cryptocurrency network to earn a reward in a base cryptocurrency by actively participating in the consensus algorithm.
This new consensus mechanism encourages the use of an already extremely secure blockchain such as Bitcoin to secure new chains without introducing new Proof-of-Work chains and cryptocurrencies.
This also introduces the novel property of allowing network participants to receive payouts in an existing, stable cryptocurrency while participating in the new blockchain network. This helps to solve the bootstrapping problem typically faced by new blockchains by giving early participants a solid incentive to join.
This is exactly the consensus mechanism being used in Stacks.
As we’ve already established the PoX consensus algorithm works by using an existing Proof-of-Work cryptocurrency (like Bitcoin) to secure a new blockchain (in this case Stacks). PoX is the very first consensus algorithm to use two blockchains rather than just one.
In the PoX implementation on Stacks, miners participate in leader elections each round. This election occurs on Bitcoin’s blockchain. A leader is chosen by the protocol through the use of a verifiable random function. That leader then writes the new block on Stacks’ blockchain while also minting the rewards.
In essence the algorithm has miners bid on becoming the leader using Bitcoin, and the Bitcoin is then transferred to other network participants who are securing the network. It is thought to be an improved version of Proof-of-Burn that works without needing to burn the existing cryptocurrency in order to generate new tokens.
In PoX the Bitcoin is transferred to STX holders as rewards for securing the network. Rewards are distributed based on the total number of STX tokens held. In return the PoX miners receive newly minted STX tokens.
- Block reward: 1000 STX/block for first 4 yrs; 500 STX/block for following 4 yrs; 250 for the 4 yrs after that; and then 125 STX/block in perpetuity after that.
- Block time: Stacks blockchain produces blocks at the same rate as Bitcoin. Bitcoin blocks are produced roughly once every 10 minutes, so that will be the rate for Stacks 2.0 mainnet. However, microblocks can give faster initial confirmation.
- Block reward maturity window: 100 blocks, meaning if a miner wins a block, they will earn the coinbase reward for that block after 100 blocks have elapsed.
- Stacking parameters: 2 reward addresses per block; reward cycle 2000 blocks (~2 weeks) for a total of 4000 reward slots.
- Stacking threshold: the minimum number of STX needed is dynamic based on participation.
- This threshold is 0.025% of the participating amount of STX when participation is between 25% and 100% and when participation is below 25%, the threshold level is always 0.00625% of the liquid supply of STX.
The Stacks Blockchain
As already noted, the Stacks network has four major layers - application, protocol, Stacks blockchain, and the Bitcoin system.
The Stacks blockchain is the cement holding the entire ecosystem together. By itself the Stacks blockchain is a distributed layer where users can deploy smart contracts and create virtual assets.
The interesting aspect is that this is not a layer-2 chain, but instead it is connected to the Bitcoin powered chain in a 1:1 block ratio. This means that whatever happens in the Stacks ecosystem should be verifiable on the Bitcoin blockchain.
How Do Stacks and Bitcoin Connect?
Connecting two independent distributed ledgers is accomplished with PoX where miners are able to mine STX tokens by transferring BTC. Apart from the new consensus mechanism this decentralized platform also supports smart contracts, dApps, and the creation of virtual assets that are indelible and easily transferred.
These virtual assets can represent any number of use cases, from governance to funding or other business models. Stacks supports both fungible token creation and non-fungible token creation.
To power the smart contracts Stacks uses the Clarity programming language, which provides enhanced security and is a predictable language that uses no compiler. Developers might be familiar with Clarity as it is used in other leading decentralized platforms such as Algorand.
The protocol layer of Stacks is where the storage, authentication, financial and naming services reside. The storage system used in Stacks has been named Gaia and it stores app data off-chain without the need for a third-party storage provider.
Gaia uses off-chain cloud systems such as Azure to provide applications with blazingly fast data access. The data remains secured by the private key of the creator.
In addition to that Stacks uses a decentralized authentication feature. This authentication is how access is granted for apps, with the username and other details stored in Gaia.
The financial aspect of the protocol layer can support decentralized finance platforms, similar to Uniswap and 1inch. These platforms can give users the ability to participate in DeFi exchanges and lending, or even more advanced DeFi such as yield farming. This layer is strengthened even further by the use of Clarity in the creation of smart contracts.
As an example, the smart-contract programming language is actually capable of interfacing directly with the Bitcoin blockchain. It has also been reinforced to prevent potential security breaches while also anticipating possible vulnerabilities.
Stacks was also created with a unique naming service feature called the Blockstack naming Service (BNS). Even though the platform is decentralized the naming service allows the platform users to give human-readable names to assets, with those assets being secured with a combination of public and private keys.
The PoX consensus mechanism consists of two types of participants:
- STX miners
- STX holders
The group of STX miners are able to view state on both the Stacks and Bitcoin blockchains. They are responsible for the leader elections each round and they spend Bitcoin by sending transactions on the Bitcoin network. Leaders are selected each round via a Verifiable Random Function, and the newly elected leader is responsible for writing the new block to the Stacks blockchain.
STX miners are then rewarded for their activity with the newly minted STX that come from transaction fees and from the smart contract execution fees.
Let’s take a look at PoX mining and the method by which an STX holder is able to earn BTC.
As already mentioned, PoX mining is simply an improved type of Proof-of-Burn, where tokens are transferred to other network participants as rewards rather than being burned and destroyed.
In the Stacks ecosystem a PoX miner transfers Bitcoin to eligible owners of Stacks (STX) tokens, and in return, they receive the newly minted Stacks (STX) tokens. Thus all the network participants benefit.
The miners who choose to participate in this PoX mechanism run a mining client on their computer or server. The mining client is responsible for implementing the necessary PoX mechanism, and this ensures that the process is handled properly through four key phases:
- Registration – Miners register themselves for the incoming election by sending consensus data to the network.
- Commitment –To participate in the election, the registered miners transfer Bitcoin to the eligible Stacks (STX) tokens holders proportional to the amount of their staked token.
- Election – A verifiable random function randomly chooses one miner as a leader to write a new block on the Stacks blockchain.
- Assembly – The leader writes the new block and, in return, receives newly-minted Stacks (STX) tokens as a reward.
PoX miners are rewarded with newly minted STX tokens when transferring BTC. The rewards schedule was set by the developers as follows:
- First 4 years, 1000 STX per block are released for mining.
- Next 4 years, 500 STX per block are released.
- Next 4 years, 250 STX per block are released.
- For the rest of the period, 125 STX per block will be released.
Miners rewards are made up of the block rewards above and the transaction fees, however these take 100 blocks on the Bitcoin blockchain to mature. This means miners will typically not see their rewards until roughly 24 hours after they are generated.
Normal users who hold STX tokens are the users who can participate in the consensus of the network by locking their STX tokens in a staking contract, running or supporting a full node, or sending useful information over the network as STX transactions. As a reward for these actions STX holders earn BTC in a two-week long reward cycle.
By locking their STX (called ‘Stacking’) and sending occasional transactions the STX holder is an active participant in securing the network. This entitles them to a portion of the Bitcoin rewards that are created when the miners make BTC transfers as part of the mining process.
This Stacking mechanism is a new secure method for earning Bitcoin without needing to invest in costly mining rigs, become involved in centralized lending schemes, or leverage potentially risky third-party DeFi products.
Stacking is the unique new method used by Stacks to allow users to earn BTC. This is the first time that users are able to lock one asset and earn their rewards from the protocol in a reserve currency. Stacks calls this process “Stacking” and it is a key component of the Proof-of-Transfer consensus mechanism.
Stackers in Stacks help to support network consensus by either locking their own STX tokens, or by delegating them to others. As a reward they receive BTC at the end of each stacking cycle.
This is ultimately preferable to the current DeFi methods where users are forced to stake all sorts of tokens, typically earning their rewards in that same token, which then needs to be converted to BTC or some stablecoin for safekeeping.
Rather than accepting the risks that process entails Stackers are able to directly earn the most valuable of all crytocurrencies directly by participating in the network. That also keeps users away from potentially buggy or shady projects.
Staking vs. Stacking
While Stacking sounds similar to Staking there are some key differences to understand:
(e.g. Tezos, Cosmos, Cardano)
- User funds might be slashed based on network activity
- Requires high uptime and guarantees from nodes
- Funds received from staking generally sold to offset maintenance and uptime costs, creating potential for market sell pressure
Only possible with Stacks (STX)
- Your funds never leave your wallet, and there's no risk of losing them
- No special hardware required. Users can participate on their own through the STX wallet or through providers
- Earnings are paid in BTC, but the reward generating asset is STX, meaning there is no added sell pressure for STX
Stacking and Earning
All these technical details are fascinating, but by now I'm sure you just want to know how you can Stack and make some passive BTC. It's actually pretty straightforward and easy.
To run a full node requires 70,000 STX tokens, which isn't realistic for most small traders and stackers. However it is also possible to delegate or use an STX pool if you have less than 70,000 STX, so even us small fry can stack and earn BTC.
If you're interested in doing just that the first thing to do is download the Stacks desktop wallet from here.
Once you've downloaded and installed the wallet you'll need some STX and you can get that from Binance using the BTC/STX pairing. Other exchanges offering STX include OkCoin and KuCoin. Get some STX and transfer it to your wallet.
Once the STX is in your wallet you can get started with stacking by clicking the get started button. This will then ask you if you want to Stack by Yourself or Delegate. If you don't have the required 70,000 STX to Stack by Yourself the wallet will show an insufficient balance message. Most of us will be choosing the Delegate option.
When you click Continue on the Delegate option it will take you to a page where you can choose between the various services that offer delegation of STX. Each delegator has different minimum token criteria, fees and payouts, so you may want to research each option before making a choice.
Once you've delegated you'll also need to provide an address where your BTC is deposited. Then simply sit back and wait for the BTC to stack up. Earning cycles are roughly 14 days long, and if you don't unlock your STX at the end of a cycle they are automatically stacked in the next cycle.
Clarity Smart Contracts
Clarity is the programming language user to create smart contracts and dApps on Stacks. The Clarity code is what’s known as predictable code because developers are able to determine what the program is going to do, how much data it will consume, and what the cost will be for the application.
That’s preferable to Ethereum’s Solidity language, which does not allow developers to know or predict what the program will do, its data needs, or its costs without actually executing the code under given conditions.
Clarity is also different from most other programming languages because it doesn’t get compiled. Instead the source code for any smart contract is published and directly executed on the blockchain nodes. The Clarity smart contracts also have visibility into the Bitcoin state, which is important because it allows contract logic to be triggered based entirely on Bitcoin transactions.
Stacks began as a project to build a better internet all the way back in 2013 in the Princeton Computer Sciences Department. A year later co-founders Ryan Shea and Muneeb Ali went through Y Combinator and recruited a group of other computer scientists from Princeton for the initial R&D efforts. In 2017 Muneeb’s PhD thesis laid out the framework for a user-owned internet that would be built on blockchains.
Fast forward to 2021 and Stacks is being developed by a globally distributed team that includes leading researchers from MIT, Princeton, and Stanford. The project is owned by Hiro Systems PBC (formerly Blockstack PBC) and is overseen by the Stacks Open Internet Foundation.
The STX Token
STX was created primarily to be used as fuel for executing Clarity smart contracts, however they have additional functionality in the Stacks ecosystem. STX can be used to publish new smart contracts to the blockchain, to pay for transaction fees, and to register digital assets among other uses.
The STX token is unique in that it was initially distributed to the public through the first ever SEC approved token offering in U.S. history. The project also released a legal memo in December 2020 that outlined how STX would be able to move from its current status to become tradeable on U.S. exchanges.
The genesis block saw 1.3 billion STX minted and there is a planned maximum supply of 1.818 billion tokens. The tokens minted with the genesis block were shared among the founders, treasury, equity investors, employees, two token sales, and app mining.
At its April 5, 2021 high of $2.82 STX had seen growth of over 8,800% in 2021. While price has declined from its all-time high, as of April 27, 2021 it remains at $2.23 which gives it an ROI of 1,750% from its ICO.
While the STX token has seen amazing performance in 2021, the long-term value of the token is dependent on the growth of the Stacks ecosystem and network, as well as the demand for Clarity smart contracts. This is logical since developers need STX tokens to add smart contracts to the blockchain and users need STX tokens as fuel (gas fees) when executing the contracts.
Stacks is available on Binance and a number of other global exchanges. Unfortunately, its availability has been set for non-US persons only.
Stacks is a unique and innovative project that promises to enhance the utility of the Bitcoin network, and unlock the massive value in Bitcoin by making it more useful in the DeFi ecosystem through the inclusion of smart contracts and dApps. When combined with the already formidable store of value promise for Bitcoin this is expected to increase the value of Bitcoin even further.
The platform is also unique in creating a way for users to earn Bitcoin without mining or participating in shady schemes. By locking STX tokens users are able to directly earn BTC. This is the first time ever that it’s possible to earn BTC passively by locking tokens from another blockchain.
What will be interesting to see is how rapidly the blockchain community adopts Stacks, and whether adding smart contracts to Bitcoin actually causes people to move away from other networks that were designed for dApps, such as Ethereum.
So far, given the rising token price, the enthusiasm for Stacks seems clear.
Disclaimer: These are the writer’s opinions and should not be considered investment advice. Readers should do their own research.