A deep dive into the Lightning Network and Stacks, assessing how each works to expand the Bitcoin ecosystem.
The Lightning Network and Stacks are two Bitcoin-based projects designed to overcome some of the inherent limitations of the Bitcoin blockchain. While other crypto projects, like Ethereum, were developed at their core with advanced Web3 and DeFi functionality in mind, many Bitcoin-based solutions face difficulties in their development due to Bitcoin’s security-focused core design.
The Lightning Network and Stacks directly address two of the Bitcoin blockchain’s core issues: low, inefficient throughput that hinders scalability, and limited functionality within the growing Web3 and DeFi landscape. Each project takes a vastly different approach from the other, presenting different variables to consider for users looking to best access Bitcoin’s developing ecosystem.
Lightning Network: improving Bitcoin ’s scalability
With Bitcoin’s lower throughput (roughly three to seven transactions per second) and transaction fees, the network can be inefficient in facilitating small payments. For micropayments (transactions as low as fractions of a cent), it can become burdensome to pay fees that exceed the cost of the transaction itself.
The Lightning Network directly addresses these issues. As a second layer built on top of Bitcoin’s blockchain, this L2 protocol facilitates high volumes of faster, more efficient Bitcoin transactions.
How it works
This decentralized, peer-to-peer (P2P) system, consists of a network of two-party, multi-signature Bitcoin addresses that act as payment channels between users. Multiple transactions can be conducted instantly through these channels, circumventing any Bitcoin network congestion. Its connection to the Bitcoin mainnet (layer one), though, lies in the settlement of these payment channels.
The channels themselves are opened and funded via a Bitcoin transaction, locking the bitcoin (BTC) into the channel. From there, any number of transactions can be made between the connected parties until the channel is closed. The channel can even be maintained by simply adding more BTC to its ledger.
When closed, the aggregate of the channel’s transactions is recorded on Bitcoin’s blockchain. This design gives Lightning the flexibility to achieve instant, low-cost payments.
The network offers lightning-fast (sometimes fractions of a second) Bitcoin payments without the need to wait for block confirmations. This allows for easier point-of-sale and P2P Bitcoin payments, and creates a better retail experience for Bitcoin users.
Since Lightning is able to handle billions of transactions per second, it not only makes things like automated (micro)payments with Bitcoin more feasible, but significantly more seamless as well. Lightning nodes are even capable of routing transactions on behalf of other users, creating a network of interconnected payment channels.
By circumventing the data and network limitations of Bitcoin, Lightning can facilitate an unlimited number of transactions between two parties with minimal, often negligible, costs to the users.
With BTC as the underlying asset for both Bitcoin and Lightning, the network still benefits from the secure design of Bitcoin’s mainnet.
Since individual transactions within the channel aren’t posted to the mainnet and don’t need to be approved by all nodes, it creates a degree of privacy for users.
Users need to find a Bitcoin wallet compatible with the Lightning Network. While many popular platforms are starting to facilitate easy access to Bitcoin’s Lightning Network for their users, it can be off-putting having to find and work with a new resource just to access the network.
Both opening and closing a payment channel require a Bitcoin transaction, meaning that there’s a cost for users to interact with the protocol. On top of this, there can also be routing fees, where Lightning node operators charge a separate fee for their payment routing services.
Users can’t partially withdraw funds from a payment channel. Once the BTC is transferred there, it must remain locked in that channel until it’s closed by the users.
Potential for bugs, fraud and malicious attacks
Stuck payments - on the Lightning Network, this occurs when a payment can’t be completed and remains in a pending state. This can be due to things like insufficient channel capacity (the payment channel doesn’t have enough funds to process the payment), inadequate routing information (incorrect destination/address info) or unresponsive nodes.
Offline transaction scams - these occur when one participant closes a payment channel while the other party is offline, exploiting the network’s need to remain online. This results in them gaining the ability to misappropriate the channel’s funds without the other party’s knowledge or consent.
Network spam attacks - bad actors can start and close various payment channels all at once. These channels, which need to be validated, can get in the way of legitimate channels, congesting the Bitcoin network with illegitimate transactions.
Stacks: expanding Bitcoin’s functionality
Being a Turing incomplete system, Bitcoin is unable to accomplish many of the more complex processes that popular Turing complete systems like Ethereum were built for. Without overcomplicating it, “Turing completeness” refers to a system’s ability to solve complex computations (where theoretically, a Turing complete system should be able to handle any task, regardless of its complexity, given enough time, memory and appropriate instructions).
Stacks directly addresses this issue. As an independent entity from the Bitcoin blockchain, Stacks serves to enable DeFi, NFTs, decentralized apps (dApps) and smart contracts for Bitcoin, helping to create a true ecosystem of applications that operate around Bitcoin. It achieves this through a combination of three things: its unique gas token (STX), its Proof of Transfer (PoX) consensus model and its programming language (Clarity).
How it works
Stacks is a completely separate blockchain with its own native token and miners. The STX token is used to power the entire platform, fuelling smart contract execution, processing transactions, and registering new digital assets on its blockchain. Through the protocol’s stacking process, users who stack (lock up) their STX tokens to secure the network are rewarded with BTC.
Stacks’ connection to the Bitcoin network lies in its PoX consensus model, with Stacks transactions settling on Bitcoin’s blockchain. A PoX miner would transfer BTC to eligible STX holders (stackers) and in return, they receive the newly minted STX tokens, creating a mutual benefit for all participants. Each new block is mined on Bitcoin’s chain without the need for changes to the chain or notification of its miners. This inherently ties Stacks’ history with Bitcoin’s, allowing Stacks to benefit from Bitcoin’s security.
In addition, Clarity, Stacks’ programming language, is able to read and react to changes in Bitcoin’s global state, meaning that Stacks developers can build programs that directly interact with information found on Bitcoin’s mainnet without altering it.
Additional web3 functionality
Stacks allows developers to create Stacks-based NFTs, fungible tokens and web3 applications that are inherently tied to Bitcoin’s blockchain. These programs are both open and modular, meaning that developers can build on one another’s applications, creating a growing ecosystem of new and dynamic features.
Separate, but connected
Since Stacks has its own blockchain, developers are free to create new applications without being restricted by Bitcoin’s limitations. Through PoX, Stacks can benefit from Bitcoin’s security without having to make any alterations to the core protocol.
Recycled mining power
Through PoX mining, the Stacks network can take advantage of Bitcoin’s Proof of Work (PoW) mining with only a fraction of PoW energy consumption requirements.
Simple programming language
Clarity is a decidable programming language that uses unambiguous syntax, making it secure and easy for developers to interpret and build with.
Passive BTC yield
Through simply stacking STX tokens, users can receive passive BTC rewards for helping to secure the network.
No direct BTC use
With Stacks only connected to Bitcoin via PoX, BTC itself cannot be directly used in many Stacks applications.
Still relatively early in web3 development
Stacks NFT adoption is still relatively low, making up less than 1 percent of the total NFT space. DeFi with Stacks is also in its infancy, making up less than 1 percent of the total DeFi space.
Low mining activity
As of writing, there have been only five active miners for the network over the past 100 blocks. Since the profitability of STX mining fluctuates, miners aren’t as incentivized to consistently participate.
Susceptible to congestion
Stacks is still susceptible to congestion from a relatively low number of concurrent mempool transactions, given that it’s still in an early development phase.
Building a better Bitcoin
Lightning Network and Stacks are both solutions that aim to improve the efficiency and scalability of Bitcoin, each tackling a different problem and approaching their goals through different means. The Lightning Network aims to handle a higher number of small-scale transactions with faster confirmations, while Stacks aims to provide more functionalities, such as smart contracts, and more efficient consensus mechanism.
Support for Bitcoin-focused projects is growing. Teams are working diligently to create environments of easy interoperability between the Bitcoin ecosystem’s many applications. For example, Lightning’s Taro proposal is looking to enable two types of transfers (swaps and sends) for NFTs and fungible tokens, which could create an opportunity for collaborative building between Lightning and Stacks. Also, with the current lack of direct BTC use within Stacks applications, solutions like LNSwap offer decentralized trading as a means of quickly and easily swapping between STX and BTC, simplifying the process of Bitcoin users jumping in and out of the Stacks ecosystem.
We’re still in the early days of web3, and although Bitcoin has had a relatively slow start, solutions like Lightning and Stacks each play a central role in the broader mission of making the Bitcoin blockchain more accessible to all cryptocurrency users.