Stacks is a programming layer for Bitcoin. The Stacks blockchain enables smart contracts and decentralized apps for Bitcoin.
>> Read the Stacks whitepaper.
>> See the Stacks overview slides.
Why Bitcoin? Bitcoin is the most durable and secure blockchain. Bitcoin is minimal by design and is meant to not change. Stacks extends the design of Bitcoin to enable smart contracts and apps without modifying Bitcoin and with minimal transaction load on Bitcoin. Thousands of Stacks transactions result in a single hash at the Bitcoin blockchain, and Stacks microblocks offer fast confirmations of streaming blocks. Bitcoin is used as a settlement layer and ultra-fast transactions are enabled as scalable hyperchains, amongst other scalability solutions (like appchains).
Stacks makes Bitcoin productive; BTC can be deployed into DeFi applications, NFT marketplaces etc. For example, see native BTC swaps, and Lightning swaps to stablecoins and NFTs. You can see some applications built using Stacks here.
Stacks cryptocurrency (STX) is used as gas for smart contract execution. STX is a unique crypto asset that can be locked by STX holders to earn Bitcoin rewards from the protocol. More details on earning Bitcoin rewards are at stacking.club.
Stacks cryptocurrency was distributed to the general public through the first-ever SEC qualified token offering in US history. The project decentralized before the mainnet launch in Jan 2021. There are 30+ independent companies that work in the ecosystem.
Clarity is a new language for smart contracts that focuses on safety. Clarity is a decidable language, meaning you can know, with certainty, from the code itself what the program will do. Clarity is interpreted (not compiled) and the source code is published on the blockchain (see this deployed code for the PoX contract).
For details, see the Clarity book and Clarity website.
PoX consensus is a new algorithm that spans consensus between two blockchains. Unlike burning electricity in proof-of-work, miners bid by spending BTC and get a random probability for becoming a leader. Leader election happens on the base chain (Bitcoin) and new blocks are written on the connected chain. Miners use a base cryptocurrency (Bitcoin) to mine newly minted units of a new cryptocurrency. PoX recyles proof-of-work energy to provide Nakamoto-style consensus for the connected chain/layer.
See this post on PoX for more details.
Stacks is a programming layer for Bitcoin. The Stacks blockchain connects to Bitcoin using PoX and enables smart contracts for Bitcoin. Smart contracts on Stacks can read and react to BTC transactions and developers can build cross-chain apps between Bitcoin and Stacks. With PoX there is no need to modify Bitcoin to enable smart contracts around it. There are two types of participants on Stacks (a) STX miners, and (b) STX holders.
STX miners can view state on both the Bitcoin blockchain and the Stacks blockchain. STX miners participate in leader election by sending transactions on the Bitcoin blockchain, a Verifiable Random Function (VRF) randomly selects leader of each round, and the leader writes the new block on the Stacks chain. STX miners get newly minted STX (coinbase rewards), transaction fees, and Clarity contract execution fees of each block. STX miners express the cost of mining in BTC and spend BTC to participate in leader election.
STX holders can participate in the PoX contract by locking their STX for a cycle, running a full node, and sending useful information on the network as transactions. STX holders who actively participate in the PoX contract can earn Bitcoin rewards. Unlike proof of stake, there is no risk of slashing for STX holders. See the STX earning model for potential earning rate and stacking.club for details.
Some resources for further details:
- Post on the Stacks blockchain.
- In-depth video interview for Stacks blockchain and consensus.
- Stacks Improvement Proposals (SIPS), and SIP-007 in particular for more details.
Check out the latest docs for the easiest way to get started!
If you're just starting with Stacks, here are the main software repositories you should checkout:
- Stacks Blockchain - the reference implementation of the Stacks blockchain in Rust.
- Stacks Documentation - community documentation for Stacks
- stacks.js - a JavaScript library for using identity, auth, and storage in your apps.
- Stacks Explorer - blockchain explorer for Stacks.
- Contribute open-source code - send us pull requests with improvements! See some good first issues.
- Help with software testing - we encourage the community to run the software and file issues.
- Become a community evangelist - join community leaders around the world supporting our mission.
- Weekly Stacks meetings on Discord.