<p>Certainly. You can do this with <code>OP_CHECKSEQUENCEVERIFY</code> which allows for relative timelocks.</p>

<p>The basic structure would look something like this:</p>

<pre><code>IF
    &lt;pubkey A&gt;
ELSE
    "30d" CHECKSEQUENCEVERIFY DROP
    &lt;pubkey B&gt;
ENDIF
CHECKSIG
</code></pre>

<p>Read <a href="https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki" rel="nofollow noreferrer">BIP 112</a> for more information.</p>

CC BY-SA 4.0
2018-10-20T16:31:55.437Z
2018-10-20T16:31:55.437Z
Ava Chow
<p>I am thinking about how to secure your Bitcoin savings. </p>

<p>One idea I had was to create sort of a "backup" address B for an address A which stores the bitcoins. So what I want to achieve is that you are able to spend your bitcoins with the private key of A at any time. But in case you lose access to the private key of A you are also able to spend the bitcoins with the private key of B but only after a certain amount of time (i.e. blocks) has passed.</p>

<p>Would something like that be possible with the Bitcoin scripting language? And if so, how would one achieve this?</p>

<p>Thanks in advance.</p>

<blockchain><script><transaction-verification><smartcontracts><locktime>
Is it posible to create a transaction output that can either be reddemed by privK of Addr A or by privK of Addr B AFTER certain blockheight?
greenphone
# Is it posible to create a transaction output that can either be reddemed by privK of Addr A or by privK of Addr B AFTER certain blockheight?

(Asked by: username_0 on 2018-10-20)

I am thinking about how to secure your Bitcoin savings.

One idea I had was to create sort of a "backup" address B for an address A which stores the bitcoins. So what I want to achieve is that you are able to spend your bitcoins with the private key of A at any time. But in case you lose access to the private key of A you are also able to spend the bitcoins with the private key of B but only after a certain amount of time (i.e. blocks) has passed.

Would something like that be possible with the Bitcoin scripting language? And if so, how would one achieve this?

Thanks in advance.

**Tags:** blockchain, script, transaction-verification, smartcontracts, locktime


---

## 1 answers

### Answer by username_1 on 2018-10-20. Score: 1

Certainly. You can do this with `OP_CHECKSEQUENCEVERIFY` which allows for relative timelocks.

The basic structure would look something like this:

```
IF
    <pubkey A>
ELSE
    "30d" CHECKSEQUENCEVERIFY DROP
    <pubkey B>
ENDIF
CHECKSIG

```

Read [BIP 112](https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki) for more information.


---

