<p>Your question indicates some experience with bitcoin, so I am going to be very technical. You may want to look up &quot;smart contracts&quot; as keywords. In the bitcoin world we talk about checklocktimeverify and checksequenceverify, together with some multisig (as escrow service). There are many examples, e.g. here (this is basically what I posted in bitcointalk):</p>
<pre><code>IF
    2 &lt;Alice's pubkey&gt; &lt;Bob's pubkey&gt; &lt;Escrow's pubkey&gt; 3 CHECKMULTISIG
ELSE
    &quot;30d&quot; CHECKSEQUENCEVERIFY DROP
    &lt;Alice's pubkey&gt; CHECKSIG
ENDIF
</code></pre>
<p>or something like this:</p>
<pre><code> if
  &lt;merchant pubkey&gt; checksigverify
 else
  &lt;timestamp&gt; checklocktimeverify drop
 endif
 &lt;customer pubkey&gt; checksig
</code></pre>
<p>imho, n-of-m multisig is the easiest form of a contract. Escrow service is the next layer (as in examples above). They can make sure, that BTC is only payed, when a specific condition is met.</p>
<p>And then one can create very specific constructs like:</p>
<blockquote>
<p>CHECKSEQUENCEVERIFY: lock some Satoshis until a specific number of
block have passed, before one can use them</p>
<p>CHECKLOCKTIMEVERIFY: lock some Satoshis until a specific number of
block appears (aka my son is 18 years old...), but use a 2-3 multisig
to release the funds in case funds are required earlier</p>
</blockquote>
<p>It goes even up to the point where you can create tx spends, where the hash of a condition must be equal to a previously defined value.
I see some limitations when trying to use Oracles (aka data from &quot;outsides&quot;), maybe data from exchanges, or from real live (in case of death).</p>
<p>Some more example in Andreas' book &quot;Mastering Bitcoin&quot; (second edition) in the chapter &quot;Timelocks&quot;.</p>
<p>or here:</p>
<blockquote>
<p><a href="https://bitcointalk.org/index.php?topic=1300723.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=1300723.0</a></p>
<p><a href="https://bitcointalk.org/index.php?topic=1558207.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=1558207.0</a></p>
<p><a href="https://bitcointalk.org/index.php?topic=1952248.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=1952248.0</a></p>
</blockquote>
<p>or here:</p>
<blockquote>
<p><a href="https://www.reddit.com/r/Bitcoin/comments/4kit49/is_it_safe_to_use_cltv_for_recurring_payments/" rel="nofollow noreferrer">https://www.reddit.com/r/Bitcoin/comments/4kit49/is_it_safe_to_use_cltv_for_recurring_payments/</a></p>
<p><a href="https://www.reddit.com/r/Bitcoin/comments/4p4klg/bitcoin_core_project_the_csv_soft_fork_has/d4i01he/" rel="nofollow noreferrer">https://www.reddit.com/r/Bitcoin/comments/4p4klg/bitcoin_core_project_the_csv_soft_fork_has/d4i01he/</a></p>
</blockquote>
<p>and here:</p>
<blockquote>
<p><a href="https://en.bitcoin.it/wiki/Timelock" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Timelock</a></p>
<p><a href="https://en.bitcoin.it/wiki/Contracts" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Contracts</a></p>
</blockquote>

CC BY-SA 3.0
2017-10-28T21:23:14.317Z
2017-10-28T21:23:14.317Z
2020-06-16T11:10:03.350Z
pebwindkraft
<h3>Possible solution(s)</h3>

<p>Depending on the <strong>kind of goods</strong> you sell, the <strong>size of your company</strong> and the <strong>prize of the goods</strong> you sell you could look into <a href="https://ethereum.org" rel="nofollow noreferrer">Ethereum</a> and smart contracts.</p>

<p>If the goods are not digital you can't use smart contracts unless you add <a href="https://en.wikipedia.org/wiki/Digital_twin" rel="nofollow noreferrer"><em>Digital Twins</em></a> to them. <strong>Digital Twins</strong> will work for <strong>cars</strong>, maybe <strong>branded clothing</strong> and similar goods, but not for <strong>oranges</strong> or <strong>peanuts</strong>.</p>

<p>Hope I could help you a little bit, but it's difficult with so little information about your site.</p>

CC BY-SA 3.0
2017-10-28T21:26:24.020Z
I propose to downvote, cause the answer "look into Ethereum" is showing a fatal non knowledge of the bitcoin environment, and seems to repeat a common myth, that only Ethereum can provide smart contracts. Bitcoin already has smart contracts that provide, what the user is asking for.
pebwindkraft
CC BY-SA 3.0
2017-10-28T21:32:31.063Z
Editing the post with links to Bitcoin smart contracts would be far more helpful than downvoting. Was the Digital Twin not helpful as well?

And yes: There was a fatal non knowledge of BTC smart contracts on my side. Thanks for bringing this to my attention. I will take a look at them right now.
Zauz
CC BY-SA 3.0
2017-10-28T23:16:55.190Z
accepted and removed downvote. And as Schrotti sounds so German: Entschuldigung. :-)
pebwindkraft
CC BY-SA 3.0
2017-10-28T21:14:32.753Z
2017-10-28T21:35:24.190Z
2017-10-28T21:35:24.190Z
Zauz
<p>I plan to open an ecommerce website from which I will accept BTC as payment. However users dont want to pay with BTC without getting the goods since my site is just starting up. What are the options I have?</p>

<bitcoin-wallet-app><ecommerce>
Can I lock a transaction from being used until a particular condition is met
ROn SC
# Can I lock a transaction from being used until a particular condition is met

(Asked by: username_0 on 2017-10-28)

I plan to open an ecommerce website from which I will accept BTC as payment. However users dont want to pay with BTC without getting the goods since my site is just starting up. What are the options I have?

**Tags:** bitcoin-wallet-app, ecommerce


---

## 2 answers

### Answer by username_1 on 2017-10-28. Score: 2 | Accepted answer

Your question indicates some experience with bitcoin, so I am going to be very technical. You may want to look up "smart contracts" as keywords. In the bitcoin world we talk about checklocktimeverify and checksequenceverify, together with some multisig (as escrow service). There are many examples, e.g. here (this is basically what I posted in bitcointalk):

```
IF
    2 <Alice's pubkey> <Bob's pubkey> <Escrow's pubkey> 3 CHECKMULTISIG
ELSE
    "30d" CHECKSEQUENCEVERIFY DROP
    <Alice's pubkey> CHECKSIG
ENDIF

```

or something like this:

```
 if
  <merchant pubkey> checksigverify
 else
  <timestamp> checklocktimeverify drop
 endif
 <customer pubkey> checksig

```

imho, n-of-m multisig is the easiest form of a contract. Escrow service is the next layer (as in examples above). They can make sure, that BTC is only payed, when a specific condition is met.

And then one can create very specific constructs like:

> CHECKSEQUENCEVERIFY: lock some Satoshis until a specific number of
> block have passed, before one can use them
>
> CHECKLOCKTIMEVERIFY: lock some Satoshis until a specific number of
> block appears (aka my son is 18 years old...), but use a 2-3 multisig
> to release the funds in case funds are required earlier

It goes even up to the point where you can create tx spends, where the hash of a condition must be equal to a previously defined value.
I see some limitations when trying to use Oracles (aka data from "outsides"), maybe data from exchanges, or from real live (in case of death).

Some more example in Andreas' book "Mastering Bitcoin" (second edition) in the chapter "Timelocks".

or here:

> <https://bitcointalk.org/index.php?topic=1300723.0>
>
> <https://bitcointalk.org/index.php?topic=1558207.0>
>
> <https://bitcointalk.org/index.php?topic=1952248.0>

or here:

> <https://www.reddit.com/r/Bitcoin/comments/4kit49/is_it_safe_to_use_cltv_for_recurring_payments/>
>
> <https://www.reddit.com/r/Bitcoin/comments/4p4klg/bitcoin_core_project_the_csv_soft_fork_has/d4i01he/>

and here:

> <https://en.bitcoin.it/wiki/Timelock>
>
> <https://en.bitcoin.it/wiki/Contracts>


---

### Answer by username_2 on 2017-10-28. Score: 1

### Possible solution(s)

Depending on the **kind of goods** you sell, the **size of your company** and the **prize of the goods** you sell you could look into [Ethereum](https://ethereum.org) and smart contracts.

If the goods are not digital you can't use smart contracts unless you add [*Digital Twins*](https://en.wikipedia.org/wiki/Digital_twin) to them. **Digital Twins** will work for **cars**, maybe **branded clothing** and similar goods, but not for **oranges** or **peanuts**.

Hope I could help you a little bit, but it's difficult with so little information about your site.

> **Comments:**
> **username_1**: I propose to downvote, cause the answer "look into Ethereum" is showing a fatal non knowledge of the bitcoin environment, and seems to repeat a common myth, that only Ethereum can provide smart contracts. Bitcoin already has smart contracts that provide, what the user is asking for.  
> **username_2**: Editing the post with links to Bitcoin smart contracts would be far more helpful than downvoting. Was the Digital Twin not helpful as well?  And yes: There was a fatal non knowledge of BTC smart contracts on my side. Thanks for bringing this to my attention. I will take a look at them right now.  
> **username_1**: accepted and removed downvote. And as Schrotti sounds so German: Entschuldigung. :-)  

---

