Bitcoin Smart Contracts
Like any contract, a smart contract explicates the terms of an agreement between multiple parties. A contract is ‘smart’ if its terms are embedded in code that runs on blockchain technology. Currently, contracts are judged and executed by people. As such, they are vulnerable to human error, bias, and trickery. Smart contracts allow all parties to consent to an utterly objective ‘third party’: the smart contract executes the contract code immutably, reliably, and securely.
Bitcoin Reigns Supreme Again?
Bitcoin isn’t well-known for its ability to support smart contract capabilities (although it’s been argued that Bitcoin transactions themselves are a kind of smart contract execution, but that’s another story). Alt coins such as Ethereum and Solana are more associated with smart contracts than Bitcoin is, but this could change in the coming years–thanks to Stacks.
Stacks is a blockchain on which Bitcoin smart contracts live. Because the security and monetary protocol of alt coins are often lacking, smart contracts that rely on them are subject to the same criticisms. Bitcoin-based smart contracts, on the other hand, do not suffer such drawbacks. As an anonymous writer put it, “Bitcoin smart contracts, like other smart contracts, ensure trustless transactions. But beyond that, those transactions ultimately settle on Bitcoin, making the history of transactions more durable through Bitcoin’s battle-tested security.”
Stacks employs a programming language called Clarity that developers can use in crafting smart contracts. Clarity is well-known to be easily debuggable, and it is ‘readable’ by people. In short, Clarity is easy for developers to use, assess, and improve their smart contracts.
Perhaps surprisingly, Bitcoin smart contracts are more cost-effective than smart contracts with other cryptocurrencies. This is largely since Bitcoin transaction fees are lower than those of competitors. For example, in 2022, Bitcoin’s typical transaction fee has reached a high of $4.46, while that of Ethereum has reached $52.46. Furthermore, Stacks smart contracts settle on Bitcoin in bulk, which further reduces the per-transaction cost.
Executing smart contracts involves running the code, verifying transactions, and keeping tabs on who owns what. This all requires computational effort and time, which are not free. Therefore, miners who keep smart contracts in operation are paid in tokens. In Stacks’ case, these tokens are called STX. The price of STX–or that of smart contract tokens more generally–depends on market forces with respect to the network on which the smart contract lives.
Admittedly, Bitcoin’s source code was not designed for smart contract implementation. As such, there are challenges that technologies like Stacks and others need to overcome. For example, Bitcoin was written in a ‘Turing incomplete’ language. While this kept the code relatively simple, it also means that Bitcoin’s native software language excludes any means to implement logical loops and conditionals. Furthermore, Bitcoin is slower than other cryptocurrencies, which is not preferable for those who want their contracts executed as quickly as possible. For example, the average block time for Bitcoin is ten minutes, while it is less than thirty seconds for Ethereum.
As has been implied by my exposition about Stacks, developers are solving these shortcomings with Layer 2 technologies. Somewhat confusingly, Stacks is technically a Layer 1 technology, since it relies on its own blockchain. Still from the perspective of a smart contract user, Stacks is a Bitcoin Layer 2 technology.
The worldwide smart contract market size is expected to reach $345.4 million within three years. One of the primary defenses alt coin advocates make is that, “Sure, Bitcoin has its advantages, but our coin is superior in supporting smart contracts.” As Stacks continues to evolve, even this argument may fall by the wayside in the coming years, much as the “Bitcoin is bad for the environment” narrative is crumbling before our eyes.
Mine Bitcoin Remotely.
Your Solution for Hosted Bitcoin Mining.