Nov 23, 2023 | Updated Nov 23, 2023
Script is a purposefully non-Turing complete language and this makes smart contracts on Bitcoin limited in their functionality.
Layer-2 blockchains and solutions are present for Bitcoin to improve its smart contract offerings while keeping its security intact.
Bitcoin is the worlds first blockchain and cryptocurrency. Its primary use case is peer-to-peer payment transfers. Often Bitcoin is referred to as digital gold, with it offering a secure and decentralized way to store and manage value. This core value proposition is what led Bitcoin to become the most popular and widely used crypto network so far. And its these same core values that many other networks have taken inspiration from while creating new use cases and innovations.
To explain, while Bitcoin was created purely to store and manage value in a decentralized manner, other networks expanded into other territories, creating ways to host decentralized applications. Decentralized apps (DApps) have taken the world by storm, and as such, there has been a push to create these types of apps that work using the most popular network, Bitcoin. However, this was not the reason Bitcoin was created, thus its a bit more complex than many smart-contract-ready networks like Ethereum.
So how do Bitcoins versions of smart contracts work? And what kinds of functions are available using this method?
Lets explore the concept of Bitcoin smart contracts and dive into the different types of smart contracts on the Bitcoin network.
Yes, the Bitcoin blockchain supports smart contracts. Developers can use Script, a scripting language, to write and deploy smart contracts on Bitcoin.
So, why is Bitcoin never the first thing people think when the topic of smart contracts pops up?
Often, youll hear people say Bitcoin is not Turing complete. But in fact, thats not quite true. Instead, its all to do with something called opcodes. Or more, Bitcoins lack of them.
Opcodes are essentially small pieces of code that represent functions that can be executed on a specific network. On some blockchains, for example, Ethereum, some of these opcodes have the power to read and write the current state of the blockchain. Then from there, you can combine many of these opcodes to create complex automated tasks triggered by a blockchain transaction. These groups of opcodes are better known as smart contracts and are responsible for countless blockchain apps and platforms.
However, Bitcoin script doesnt contain these types of opcodes. That also means that Bitcoin doesnt have a recorded current state at any given moment. Instead, it simply records who owns what, and allows people to send and receive coins via UTXOs, with a limited choice of conditions of how that value transfer executes.
So, now you know why Bitcoin smart contracts arent exactly what you might expect, so lets see how they work.
Bitcoin smart contracts, like their counterparts on other networks, are simply pieces of code that automatically execute when some predefined conditions are met. So, you can imagine, they work in a similar way.
Firstly, its important to know that Bitcoin operates using its own computing language: Script. And script uses something like a lock and key system to execute smart contracts. The sender sets a condition or rule in order for the transaction to be processed acting as the lock. To follow, the recipient must provide a matching key also a piece of code in Scriptthat fulfills the condition set by the sender.
Now, what kind of conditions can be set?
Lets find the answer to this by exploring the various types of smart contracts present on Bitcoin.
This is the most common type of transaction. The sender addresses Bitcoin to the receivers public keys hash. To access the funds, the receiver must prove they own the corresponding private key.
This is like locking a box and giving the key to one person.
MultiSig requires more than one signature for a transaction to be valid. An example is a 2-of-3 MultiSig, which needs at least two signatures from a group of three to execute a transaction. This adds an extra layer of security and is often used by businesses.
This is like a safe that needs two or more keys turned at the same time.
This allows a transaction to be created at any given time, but only be valid at a specified future date or block height. Its a way to postdate a Bitcoin transaction and is useful for various financial agreements. Its a sort of timelock that pertains to transactions.
Time-locked transactions were made possible with BIP-65 and BIP-112s introduction of new opcodes concerning the nLockTime and nSequence fields.
Essentially, these opcodes allow an entry to specify the earliest time it can be added to a blockstopping the transaction from completing until a certain number of blocks, or amount of time has passed. In short, these time-locked opcodes are important, as without them the entire Lightning network could not exist!
Instead of locking outputs to a public key, P2SH locks them to a scripts hash. The spender needs to provide the script matching the hash and satisfy its conditions. This enables complex scripts without burdening the sender with their details. P2SH came into play with the BIP-16 upgrade.
For instance, you challenge a friend with a puzzle. If they solve it, they get the bitcoins.
P2TR is a privacy-preserving complex script that allows multiple parties to create a signature that looks like a single one, enhancing privacy and efficiency.
It is a combination of P2PKH and P2SH with a lot more privacy. This was part of the BIP-341 proposal, popularly known as the Taproot upgrade.
Miniscript was introduced to make the complex spending conditions (that Bitcoin was already capable of) much easier for developers to use and implement. In short, its a simple coding language that facilitates a number of functionalities. Essentially it allows your Bitcoin wallet to handle more advanced actions like requiring multiple keys for an account or having a wallet with some spending conditions that are only active after some amount of time.
While this isnt strictly a smart contract, this is one of the more flexible custody schemes miniscript offers.
Now that you know about some advanced functions, lets dig into something more tangible.
What about NFTs on Bitcoin do they even exist in the first place?
The Ordinals protocol launched on Bitcoin in January 2023, enabling Ordinal NFTs by attaching data to individual Satoshis. Each Satoshi gets a unique number through an intuitive ordering system.
Ordinal NFTs reside fully on the Bitcoin blockchain without the need for a separate token. However, that means, inscribed Satoshis now compete for block space on the network, resulting in a spike in network fees.
BRC-20 a token standard for Bitcoin Ordinals uses JSON data to facilitate various token functions. At present, the BRC-20 token standard offers three primary functions:
The BRC-20 token standard is relatively new and young. Hence, the functionalities are limited and not entirely user-friendly.
Bitcoin L2s or layer-2 solutions can help Bitcoin overcome this limitation.
Bitcoin smart contracts have limited functionalities. However, layer-2 blockchains on Bitcoin allow developers to code more complicated smart contracts.
To better understand how they work, lets look at a few examples of Bitcoin layer 2 chains.
The Lightning Network (LN) is a layer 2 scaling solution for Bitcoin, designed to facilitate fast and low-cost transactions by conducting most of the transactions off-chain. It operates using payment channels which are like private off-chain tunnels between users that facilitate payments.
Apart from instant payments and low fees, LN enables the creation of more complex smart contracts like Hashed Time-Locked Contracts (HTLCs) within Lightning Apps or LApps. These contracts are programmable, most often implemented for functions such as micropayments, instant swaps, and streaming payments.
The Lightning network is also home to Discreet Log Contracts (DLCs). To clarify these contracts allow two parties to engage in a bet, using a connection to an oracle to verify real-life events. While the oracle is crucial for the settlement of these bets, it is not directly involved in the transactions that create and settle the contract. These are directly negotiated among the parties making the bet.
Stacks is a chain that works alongside Bitcoin. It enables developers to build smart contracts and decentralized applications (dApps) on top of Bitcoin.
They employ Proof of Transfer (PoX) an approach to allowing the Stacks blockchain to process its transactions while leveraging Bitcoins security.
Smart Contracts on Stacks
Using Stacks, developers can create a wide range of applications, from decentralized finance (DeFi) platforms to non-fungible tokens (NFTs) and decentralized social networks.
It acts as a more diverse and expansive ecosystem while maintaining the robustness and security of Bitcoin as the base layer.
Two applications of Stacks-based smart contracts on Bitcoin are:
Hiro Wallet: It is a non-custodial wallet enabling secure connections and transactions within the Stacks ecosystem. Bitcoin users can participate in Stacking, a reward system that distributes BTC to users for supporting the network and locking STX tokens for a specified period.
Bitcoin Naming Service (BNS): BNS, a decentralized name system for Bitcoin, similar to Ethereums ENS, saw a recent surge in registrations. To own a BTC name, users have to interact with the smart BNS contract on the Stacks chain.
Understanding how Bitcoin smart contracts work is imperative to participate safely in crypto and DeFi. Its even better when a user can understand smart contract code to assess if a smart contract is safe to interact with.
And as with using smart contracts on any blockchain, you should prioritize the security of your private keys. The best way to do that is to use Bitcoin applications through a hardware wallet like Ledger.
Ledger hardware wallets keep private keys offline at all times and also enable clear signing. This helps users clearly read the transaction details before they approve it.
Moreover, Ledger hardware wallets offer support to Hiro Wallet by which users can pair them and start stacking STX and delegating them to trustworthy validators.
Now you know everything about smart contracts on Bitcoin, youre ready to dive in. So get yourself a Ledger, connect to Ledger Live, and start exploring the Bitcoin ecosystem. The time for education is now, and accessing Bitcoin from the Ledger ecosystem is secure and easy to understand.
Continue reading here:
Bitcoin Smart Contracts and Apps: Do They Even Exist? - Ledger
- Cosmos (ATOM), Chainlink (LINK), and RenQ Finance (RENQ) are ... - Crypto News Flash [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- Grupo Pro Arte y Cultura Announces Winners of the 2022 Mayte ... - GlobeNewswire [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- Solana vs Ethereum: How to Choose One With Better Features and ... - Cryptopolitan [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- Can Circle [USDC] turn things around with new plan? All you need to know - AMBCrypto News [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- Polygon Wallet Suite allows users to safely bridge, swap, and ... - Crypto News Flash [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- Global X rolls out three new crypto ETPs - ETF Strategy [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- The Arbitrum Foundation Announces Launch of Arbitrum Orbit: Layer 3 Chains for All - Yahoo Finance [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- Travolution Summit 2023: 'Blockchain will... - Travolution [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- Aave: The Basics Global X ETFs - Global X [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- Revolutionizing the Travel and Hospitality Industry with Blockchain ... - Hospitality Net [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- The arbitrability of Web3 disputes: An effective court of First World ... - Lexology [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- What Is Stacks? Smart Contracts on Bitcoin[Outlook &Upate] - DataDrivenInvestor [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- Smart Contracts in Healthcare Market Projected to Hit USD 5.6 ... - GlobeNewswire [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- Are Smart Contracts Integral to Blockchain or Just Useful Tools ... - Cryptopolitan [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- EU Parliament approves the Data Act, which requires - Kitco NEWS [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- Discover Tanglechains.org: Your go-to source for EVM and Smart Contract Chains on Shimmer and IOTA - Crypto News Flash [Last Updated On: March 16th, 2023] [Originally Added On: March 16th, 2023]
- How Can Blockchain 4.0 Technology Revolutionize Interactions with ... - Cryptopolitan [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- Australia's largest bank breaks blockchain barrier with Ethereum ... - Cryptopolitan [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- How Will Bitcoin DeFi Gain Importance in 2023? Cryptopolitan - Cryptopolitan [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- Helio Protocol: The revolutionary USD Destablecoin backed by BNB - AMBCrypto News [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- Project claiming to be AI-powered drains $1M from users - Cointelegraph [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- HashKey Group taps SlowMist for blockchain security and AML/CFT ... - FinanceFeeds [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- Revolutionary DeFi Protocol IPOR to be listed on Bitget on Mar 22nd ... - Yahoo Finance [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- Boba Network Announces Integration with NOWPayments - Cryptonews [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- Blockchain Could Soar Beyond 100,000 Transactions per Second With the Right Math - The Daily Hodl [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- Here's why blockchain is the future of the telecoms industry - Crypto Reporter [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- 5 Must-Have Blockchain Developer Skills - Blockchain Council [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- EU Data Act requires smart contracts to have kill switch, not be ... - Ledger Insights [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- Euro Parliament approves Data Act that requires kill switches on smart contracts - Cointelegraph [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- Europe introduces smart contract kill switch what it means for DeFi systems - AMBCrypto News [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- Smart Contracts in Peril? EU's Data Act Vote Stirs Controversy in the Web3 World - CryptoGlobe [Last Updated On: March 20th, 2023] [Originally Added On: March 20th, 2023]
- Inery Blockchain to Implement AI, Mainnet Rescheduled for Q2 2023 - EIN News [Last Updated On: March 22nd, 2023] [Originally Added On: March 22nd, 2023]
- The Emergence of Web3 and Its Impact on TradFi - LCX [Last Updated On: March 22nd, 2023] [Originally Added On: March 22nd, 2023]
- Stacks 2.1 deployed: Is BTC the catalyst STX needed all along - AMBCrypto News [Last Updated On: March 22nd, 2023] [Originally Added On: March 22nd, 2023]
- Blockchain-Based Debt Protocol Obligate Records First Bond Issuance on Polygon Network - Yahoo Finance [Last Updated On: March 22nd, 2023] [Originally Added On: March 22nd, 2023]
- What Is a Hybrid Blockchain, and How Does It Differ from a Regular ... - MUO - MakeUseOf [Last Updated On: March 22nd, 2023] [Originally Added On: March 22nd, 2023]
- Solana-based DEX Orca bans US users from trading in its platform - CoinGeek [Last Updated On: March 22nd, 2023] [Originally Added On: March 22nd, 2023]
- The Role of Self-Regulation in the Cryptocurrency Industry: Where do we go from here? - Finance Magnates [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- Cardano (ADA) is ready for a massive pump, Polygon (MATIC), and ... - NewsBTC [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- Best Web3 open-source tools 2023 - CryptoTicker.io - Bitcoin Price, Ethereum Price & Crypto News [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- How New Technology Will Disrupt The Oil And Gas Industry - Markets Insider [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- How Can Ethereum Account Abstraction Improve the Network's ... - Cryptopolitan [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- Stellar (XLM) Price Prediction 2025-30: Will XLM shake off its bearish ways? - AMBCrypto News [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- TRON: Stake 2.0 launch announced to significantly improve the ... - Crypto News Flash [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- Smart Contracts in Healthcare Market Size and Growth Most Recent Manufacturers Insight View with Top Countries - openPR [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- Future of Finance: EYs Brody on why tech history shows there can be only one winning blockchain - Fortune [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- Top 10 Blockchain Platforms to Consider in 2023 - Analytics Insight [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- Safemoon LP Drained of $9M in Smart Contract Attack - BanklessTimes [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- Chainlink (LINK) Price Prediction 2025-2030: Can LINK reach $10 in 2025? - AMBCrypto News [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- The Flare Time Series Oracle (FTSO) Ready to Serve Smart ... - Blockchain Reporter [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- How IOTA Smart Contracts Could Skyrocket the Value of MIOTA? - CryptoTicker.io - Bitcoin Price, Ethereum Price & Crypto News [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- Smart Contracts Deployed on Ethereum Have Plummeted 66 ... - BanklessTimes [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- How ChatGPT is Revolutionizing Smart Contract and Blockchain - Techopedia [Last Updated On: April 2nd, 2023] [Originally Added On: April 2nd, 2023]
- Oriental Overseas Insurance Company: Committed to Building a ... - Digital Journal [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- Trouble for the new crypto of Arbitrum - The Cryptonomist [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- Tokentus investment AG invests USD 300,000 in Hydra Ventures, one of the first Investment DAO Fund-of-Funds in the Web3 Space - Marketscreener.com [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- Introducing DogeFarm: The Pioneering Decentralized Real Yield ... - GlobeNewswire [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- California Governor Gavin Newsom Is Giving the Crypto Industry ... - Jacobin magazine [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- If History Repeats, Cardano (ADA) Price Will Reach ATH Very Soon ... - Coinpedia Fintech News [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- Crypto 4 A Cause Set to Deploy its Blockchain Within the Year After Successful Sandbox Georli Testnet Trial - EIN News [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- dcSpark CTO: 'Cardano Will Be a Top EVM Chain Next Month' - CryptoGlobe [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- Utah DAOs and Donts: New Law Provides Limited Liability for ... - JD Supra [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- Steps to A Blockchain Industry Consulting Career: Maximizing ... - Cryptopolitan [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- Justice Dept. Seizes Over $112M in Funds Linked to Cryptocurrency ... - Department of Justice [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- Stacks [STX] gains newfound attention from investors, but will its uptrend last - AMBCrypto News [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- Cryptocurrencies To Watch: Week of April 3 - Investopedia [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- The Role of Enterprise Ethereum: Applications, Benefits, and Challenges - Finance Magnates [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- Astar Network To Launch Smart Contracts 2.0 on the Mainnet on April 6th - The Defiant - DeFi News [Last Updated On: April 4th, 2023] [Originally Added On: April 4th, 2023]
- Is 2023 The Year For Shiba Inu (SHIB) And RenQ Finance (RENQ)? - Benzinga [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]
- Coinbases Base network gets OpenZeppelin security integration - Cointelegraph [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]
- What is the Best Cardano DEX, and Why is it WingRiders? - DataDrivenInvestor [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]
- Attention Crypto Scammers: AI is on the Hunt - BeInCrypto [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]
- VeChain explores Billion-$-KI industry with OpenAI - Crypto News Flash [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]
- Automotive Blockchain Market is expected to represent Significant ... - Digital Journal [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]
- Uncomfortable with the security of web3 transactions? Fire might be ... - Refresh Miami [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]
- Blockchain As A Service Market is expected to Exhibit a Massive ... - Digital Journal [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]
- Pi Network Reveals Tech and Product Updates for Pioneers - BSC NEWS [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]
- Unleashing the Potential: Tools and Apps on the Ethereum Blockchain - Captain Altcoin [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]
- XRP Ledger Makes Progress Towards Supporting Native Smart ... - The Crypto Basic [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]
- Cardano (ADA) launches the future of smart contracts with Aiken in ... - Crypto News Flash [Last Updated On: April 24th, 2023] [Originally Added On: April 24th, 2023]