<p>Some options:</p>
<p><a href="https://github.com/bitcoin-computer" rel="nofollow noreferrer">Bitcoin Computer</a> (<a href="https://www.bitcoincomputer.io/" rel="nofollow noreferrer">https://www.bitcoincomputer.io/</a>):</p>
<blockquote>
<p>Bitcoin Computer is an easy to use smart contract system for Bitcoin.</p>
</blockquote>
<p><a href="https://elementsproject.org/elements-code-tutorial/sidechain" rel="nofollow noreferrer">Elements</a>:</p>
<blockquote>
<p>Elements is a general purpose blockchain platform that can also be
“pegged” to an existing blockchain (such as Bitcoin) in order to
enable the two way transfer of assets from one chain to the other</p>
</blockquote>
<p><a href="https://github.com/fiatjaf/etleneum" rel="nofollow noreferrer">Etlenuem</a> (from etleneum.com):</p>
<blockquote>
<p>On Etleneum you can write code that controls digital value, runs exactly as programmed, and is accessible anywhere in the world.</p>
</blockquote>
<p>n.b.</p>
<blockquote>
<p>...the Etleneum team may delete contracts if they consider them
wrong...</p>
</blockquote>
<p><a href="https://docs.interlay.io/#/getting-started/interbtc?id=mint-and-redeem" rel="nofollow noreferrer">Interlay</a>:</p>
<blockquote>
<p>interBTC is a 1:1 Bitcoin backed asset that can be used to invest,
earn and pay with BTC across the DeFi ecosystem on Polkadot, Ethereum,
Cosmos and many more.</p>
</blockquote>
<p><a href="https://github.com/dfinity/ic/tree/master/rs/bitcoin" rel="nofollow noreferrer">Internet Computer</a> <a href="https://forum.dfinity.org/t/direct-integration-with-bitcoin/6147/324" rel="nofollow noreferrer">Bitcoin</a> <a href="https://github.com/dfinity/bitcoin-developer-preview" rel="nofollow noreferrer">Integration</a>:</p>
<blockquote>
<p>The integration between the Internet Computer and Bitcoin will enable
developers to build canisters that:</p>
<ol>
<li>Securely own Bitcoin</li>
<li>Interact with the Bitcoin Network</li>
</ol>
</blockquote>
<p><a href="https://docs.blockstream.com/liquid/technical_overview.html" rel="nofollow noreferrer">Liquid</a> (<a href="https://liquid.net/" rel="nofollow noreferrer">https://liquid.net/</a>):</p>
<blockquote>
<p>Liquid is a sidechain-based, Bitcoin layer-2 settlement network
linking together cryptocurrency exchanges and institutions around the
world, enabling faster, more confidential Bitcoin transactions and the
issuance of digital assets</p>
</blockquote>
<p><a href="https://github.com/RGB-WG/" rel="nofollow noreferrer">RGB</a> (from <a href="https://rgbfaq.com/" rel="nofollow noreferrer">https://rgbfaq.com/</a>):</p>
<blockquote>
<p>RGB is a scalable &amp; confidential smart contracts system for Bitcoin &amp;
lightning network. They embrace concepts of private &amp; mutual
ownership, abstraction and separation of concerns and represent
&quot;post-blockchain&quot;, Turing-complete form of trustless distributed
computing which does not require introduction of &quot;tokens&quot;</p>
</blockquote>
<p><a href="https://developers.rsk.co/the-stack/" rel="nofollow noreferrer">RSK</a>:</p>
<blockquote>
<p>RSK is the first general purpose smart contract platform secured by
the Bitcoin Network.</p>
</blockquote>
<p><a href="https://www.stacks.co/learn/introduction" rel="nofollow noreferrer">Stacks</a>:</p>
<blockquote>
<p>Stacks is an open-source blockchain network that leverages the
security and capital of Bitcoin for decentralized apps and smart
contracts.</p>
</blockquote>
<p><a href="https://wbtc.network/" rel="nofollow noreferrer">Wrapped BTC</a></p>
<p>An Ethereum ERC20 token that maps 1:1 (minting controlled by custodian) to BTC. Can be utilised in Ethereum smart contracts.</p>

CC BY-SA 4.0
2022-08-16T07:59:15.507Z
@Murch thanks, have deleted others and will use this one for updates
Lee
CC BY-SA 4.0
2022-06-10T13:04:45.287Z
Hi atomh33ls, please don't post multiple copies of the same answer across multiple topics. While some topics are closely related, they often ask about different aspects or facets of an issue. A copied answer usually fails to address the topic's unique parts, so perhaps you could edit each of these to make sure your posts address the questions of the topics you posted on.
Murch
CC BY-SA 4.0
2022-06-10T11:06:44.867Z
2022-07-20T11:07:33.700Z
2022-07-20T11:07:33.700Z
Lee
<p>If you re-enable all opcodes, as <a href="https://xiaohuiliu.medium.com/the-first-high-level-language-smart-contract-on-btc-6db9a4b788d4" rel="nofollow noreferrer">Bitcoin SV have done</a>, Bitcoin smart contracts become <a href="https://medium.com/coinmonks/turing-machine-on-bitcoin-7f0ebe0d52b1" rel="nofollow noreferrer">Turing-Complete</a>, meaning you can build arbitrarily complex smart contracts. For example, you can build <a href="https://docs.scrypt.io/tutorials/oracle" rel="nofollow noreferrer">oracles</a>, <a href="https://xiaohuiliu.medium.com/non-custodial-bitcoin-vaults-880c781effa7" rel="nofollow noreferrer">vaults</a>, <a href="https://medium.com/coinmonks/p2p-bitcoin-settled-derivatives-forward-contracts-94d48b909b94" rel="nofollow noreferrer">derivative contracts</a>, even <a href="https://xiaohuiliu.medium.com/create-your-first-zero-knowledge-proof-program-on-bitcoin-ec159cc501f4" rel="nofollow noreferrer">Zero Knowledge Proof</a>, the most sophisticated contracts in the entire blockchain space. All these can be done using a TypeScript DSL called <a href="https://scrypt.io/" rel="nofollow noreferrer">sCrypt</a>, which compiles down to opcodes/script.</p>

CC BY-SA 4.0
2023-07-22T16:06:30.580Z
2023-07-22T16:06:30.580Z
sinoTrinity
<p>Bitcoin has a scripting language built into it, which allows the creation of many kinds of smart contracts. Examples are <a href="https://bitcointalk.org/index.php?topic=193281.msg2224949#msg2224949" rel="noreferrer">atomic swaps</a>, <a href="https://lightning.network/lightning-network-paper.pdf" rel="noreferrer">Lightning payment channels</a> and <a href="https://bitcoincore.org/en/2016/02/26/zero-knowledge-contingent-payments-announcement/" rel="noreferrer">zero-knowledge contingent payments (ZKCPs)</a>. This <a href="https://eprint.iacr.org/2016/451.pdf" rel="noreferrer">later paper by Banasik, Dziembowski and Malinowski (BDM16)</a> improves the efficiency of these greatly. Threshold multisignatures are also easy to do, interestingly much more easily than in Ethereum.</p>

<p>ZKCPs are extremely general and can execute any contract in which the counterparties and terms of the contract are known at setup time, though it does require they use some new and slow crypto (done off-chain, Bitcoin is never exposed to it).</p>

<p>A more whimsical example is <a href="https://bitcointalk.org/index.php?topic=293382.0" rel="noreferrer">Peter Todd's bounty for anyone who can collide SHA1, SHA256 or RIPEMD160</a>. The SHA1 collision bounty has been taken.</p>

<p>My guess is that the only thing Ethereum can do that Bitcoin actually <em>can't</em> do, is extrospect on the outputs being spent. This would be sufficient to implement <a href="https://bitcointalk.org/index.php?topic=278122.0" rel="noreferrer">covenants</a>, which would be something of a mixed blessing.
Andrew Miller has argued that Ethereum's account model lets it do contracts in a more transaction-efficient way than Bitcoin's UTXO model, which may be true, but the examples I've seen of this (a) lose privacy by storing lots of unrelated state in one account and (b) exploit Ethereum's global key-value store, which is significantly more expensive to maintain than a UTXO set. Extrospection may be efficiently (efficient for verifiers, not for the transacting parties :)) attainable by creative use of ZKCP's, much how the BDM16 paper does atomic swaps with them, but I haven't worked out the details.</p>

<p>As a final note, it is easier, by design, to implement and deploy Ethereum contracts. However, I think the hard part of smart contracting is analyzing the contracts and proving correct behaviour under all inputs. (Both Ethereum's and Bitcoin's script languages fall short on this count, being difficult in general to efficiently reason about.)</p>

CC BY-SA 4.0
2021-06-09T15:32:24.037Z
Regarding the final note, the reader may be interested in Miniscript (http://bitcoin.sipa.be/miniscript/) which aims to give a framework to be able to analyze and reason about Bitcoin smart contracts.
Antoine Poinsot
CC BY-SA 3.0
2017-05-27T13:30:11.000Z
2017-05-27T13:30:11.000Z
Andrew Poelstra
<p>I have recently come across the features of ethereum and the idea of smart contracts.</p>

<p>I like the concept of smart contracts however as a currency, I much prefer the bitcoin to the ether.</p>

<p>Is there any way smart contracts could ever be utilised by bitcoin?</p>

CC BY-SA 4.0
2020-11-30T14:55:52.010Z
To read about the changes introduced by Taproot for smartcontracts, check out: https://bitcoin.stackexchange.com/q/96025/5406
Murch
<script><smartcontracts><covenants>
Bitcoin and Smart Contracts
Kenshin
# Bitcoin and Smart Contracts

(Asked by: username_0 on 2017-05-27)

I have recently come across the features of ethereum and the idea of smart contracts.

I like the concept of smart contracts however as a currency, I much prefer the bitcoin to the ether.

Is there any way smart contracts could ever be utilised by bitcoin?

**Tags:** script, smartcontracts, covenants

> **Comments:**
> **username_1**: To read about the changes introduced by Taproot for smartcontracts, check out: https://bitcoin.stackexchange.com/q/96025/5406  

---

## 3 answers

### Answer by username_4 on 2017-05-27. Score: 13 | Accepted answer

Bitcoin has a scripting language built into it, which allows the creation of many kinds of smart contracts. Examples are [atomic swaps](https://bitcointalk.org/index.php?topic=193281.msg2224949#msg2224949), [Lightning payment channels](https://lightning.network/lightning-network-paper.pdf) and [zero-knowledge contingent payments (ZKCPs)](https://bitcoincore.org/en/2016/02/26/zero-knowledge-contingent-payments-announcement/). This [later paper by Banasik, Dziembowski and Malinowski (BDM16)](https://eprint.iacr.org/2016/451.pdf) improves the efficiency of these greatly. Threshold multisignatures are also easy to do, interestingly much more easily than in Ethereum.

ZKCPs are extremely general and can execute any contract in which the counterparties and terms of the contract are known at setup time, though it does require they use some new and slow crypto (done off-chain, Bitcoin is never exposed to it).

A more whimsical example is [Peter Todd's bounty for anyone who can collide SHA1, SHA256 or RIPEMD160](https://bitcointalk.org/index.php?topic=293382.0). The SHA1 collision bounty has been taken.

My guess is that the only thing Ethereum can do that Bitcoin actually *can't* do, is extrospect on the outputs being spent. This would be sufficient to implement [covenants](https://bitcointalk.org/index.php?topic=278122.0), which would be something of a mixed blessing.
username_4 Miller has argued that Ethereum's account model lets it do contracts in a more transaction-efficient way than Bitcoin's UTXO model, which may be true, but the examples I've seen of this (a) lose privacy by storing lots of unrelated state in one account and (b) exploit Ethereum's global key-value store, which is significantly more expensive to maintain than a UTXO set. Extrospection may be efficiently (efficient for verifiers, not for the transacting parties :)) attainable by creative use of ZKCP's, much how the BDM16 paper does atomic swaps with them, but I haven't worked out the details.

As a final note, it is easier, by design, to implement and deploy Ethereum contracts. However, I think the hard part of smart contracting is analyzing the contracts and proving correct behaviour under all inputs. (Both Ethereum's and Bitcoin's script languages fall short on this count, being difficult in general to efficiently reason about.)

> **Comments:**
> **username_5**: Regarding the final note, the reader may be interested in Miniscript (http://bitcoin.sipa.be/miniscript/) which aims to give a framework to be able to analyze and reason about Bitcoin smart contracts.  

---

### Answer by username_2 on 2022-06-10. Score: 0

Some options:

[Bitcoin Computer](https://github.com/bitcoin-computer) (<https://www.bitcoincomputer.io/>):

> Bitcoin Computer is an easy to use smart contract system for Bitcoin.

[Elements](https://elementsproject.org/elements-code-tutorial/sidechain):

> Elements is a general purpose blockchain platform that can also be
> “pegged” to an existing blockchain (such as Bitcoin) in order to
> enable the two way transfer of assets from one chain to the other

[Etlenuem](https://github.com/fiatjaf/etleneum) (from etleneum.com):

> On Etleneum you can write code that controls digital value, runs exactly as programmed, and is accessible anywhere in the world.

n.b.

> ...the Etleneum team may delete contracts if they consider them
> wrong...

[Interlay](https://docs.interlay.io/#/getting-started/interbtc?id=mint-and-redeem):

> interBTC is a 1:1 Bitcoin backed asset that can be used to invest,
> earn and pay with BTC across the DeFi ecosystem on Polkadot, Ethereum,
> Cosmos and many more.

[Internet Computer](https://github.com/dfinity/ic/tree/master/rs/bitcoin) [Bitcoin](https://forum.dfinity.org/t/direct-integration-with-bitcoin/6147/324) [Integration](https://github.com/dfinity/bitcoin-developer-preview):

> The integration between the Internet Computer and Bitcoin will enable
> developers to build canisters that:
>
> 1. Securely own Bitcoin
> 2. Interact with the Bitcoin Network

[Liquid](https://docs.blockstream.com/liquid/technical_overview.html) (<https://liquid.net/>):

> Liquid is a sidechain-based, Bitcoin layer-2 settlement network
> linking together cryptocurrency exchanges and institutions around the
> world, enabling faster, more confidential Bitcoin transactions and the
> issuance of digital assets

[RGB](https://github.com/RGB-WG/) (from <https://rgbfaq.com/>):

> RGB is a scalable & confidential smart contracts system for Bitcoin &
> lightning network. They embrace concepts of private & mutual
> ownership, abstraction and separation of concerns and represent
> "post-blockchain", Turing-complete form of trustless distributed
> computing which does not require introduction of "tokens"

[RSK](https://developers.rsk.co/the-stack/):

> RSK is the first general purpose smart contract platform secured by
> the Bitcoin Network.

[Stacks](https://www.stacks.co/learn/introduction):

> Stacks is an open-source blockchain network that leverages the
> security and capital of Bitcoin for decentralized apps and smart
> contracts.

[Wrapped BTC](https://wbtc.network/)

An Ethereum ERC20 token that maps 1:1 (minting controlled by custodian) to BTC. Can be utilised in Ethereum smart contracts.

> **Comments:**
> **username_1**: Hi atomh33ls, please don't post multiple copies of the same answer across multiple topics. While some topics are closely related, they often ask about different aspects or facets of an issue. A copied answer usually fails to address the topic's unique parts, so perhaps you could edit each of these to make sure your posts address the questions of the topics you posted on.  
> **username_2**: @username_1 thanks, have deleted others and will use this one for updates  

---

### Answer by username_3 on 2023-07-22. Score: 0

If you re-enable all opcodes, as [Bitcoin SV have done](https://xiaohuiliu.medium.com/the-first-high-level-language-smart-contract-on-btc-6db9a4b788d4), Bitcoin smart contracts become [Turing-Complete](https://medium.com/coinmonks/turing-machine-on-bitcoin-7f0ebe0d52b1), meaning you can build arbitrarily complex smart contracts. For example, you can build [oracles](https://docs.scrypt.io/tutorials/oracle), [vaults](https://xiaohuiliu.medium.com/non-custodial-bitcoin-vaults-880c781effa7), [derivative contracts](https://medium.com/coinmonks/p2p-bitcoin-settled-derivatives-forward-contracts-94d48b909b94), even [Zero Knowledge Proof](https://xiaohuiliu.medium.com/create-your-first-zero-knowledge-proof-program-on-bitcoin-ec159cc501f4), the most sophisticated contracts in the entire blockchain space. All these can be done using a TypeScript DSL called [sCrypt](https://scrypt.io/), which compiles down to opcodes/script.


---

