Smart contracts, code allowing you to create automatic processes for products and services secured by a decentralized distributed ledger called a blockchain, are causing many developers to think differently about building applications. On the Ethereum blockchain, an influx in applications that are secured by a decentralized blockchain emerged. Use cases of these applications vary in a wide spectrum that goes from finance, to health care, to entertainment.
However, Bitcoin, the most decentralized and secure blockchain, does not allow for interaction with smart contracts. Based on the current successful application landscape on Ethereum's blockchain, and the $500 billion Bitcoin capital in circulation, this as a missed opportunity to onboard more people to Bitcoin.
However, not allowing for smart contracts was a conscious decision, as the to this day unknown creator of Bitcoin named Satoshi Nakamoto intended Bitcoin's codebase to be as simple as possible. Together with its decentralized nature, this makes Bitcoin near impossible to be hacked. Yet, in his words, a separate network that does allow for smart contract, while sharing Bitcoin's CPU power and with that its security, is a possible solution. Enter Bitcoin layers.
Bitcoin layers are separate networks that allow for the use of smart contracts, while the transaction data output of these smart contract settle on the Bitcoin main chain. An example of this is called Stacks, a layer 2 for Bitcoin that anchors its blocks consisting of transaction data to Bitcoin's chain. Stacks does this via a Bitcoin function called the "signature transaction", that enables you to send the hash of all transaction data to the Bitcoin L1.
In simple terms, in order for someone with malicious intent to alter transaction data from smart contracts on the Layer 2, one would need to change the hash settled on Bitcoin and with that alter Bitcoin's state. To put into perspective how difficult is this is, altering Bitcoin historical Bitcoin blocks will cost someone over $7.9 billion in equipment.
Clarity, Stacks' L2 smart contract language, enables you to create these smart contracts that settle on Bitcoin. Due to its core characteristics, Clarity made it easy for front-end developers to create applications with smart contract that settle on Bitcoin. Most front-end developers take roughly 10 hours to learn the basics of Clarity. The result? The start of a broader bitcoin economy with a wide variety of applications built on Bitcoin layers. Let's explore some of these Bitcoin applications created with Stacks' L2 clarity smart contracts.