user47827: I would like my Bitcoin to have the extra security that a 2-of-2 multisig provides. With a single sig I am worried that if a single key gets hacked I will lose my funds. However, with a 2-of-2 multisig I am worried that if I lose either key my funds will be trapped.
How do I write a script such that my funds are locked in a 2-of-2 multisig which converts into a 1-of-2 multisig after 365 days? This way I get the best of both worlds. I have greater security for 365 days and then if I lose one of my keys I can still access my funds after 365 days.

user47827: To construct the script you could use Pieter Wuille's Miniscript site.
If you go to the Policy to Miniscript compiler section there is an example in Policy for a 2-of-2 multisig that turns into a 1-of-2 multisig after 90 days.
and(pk(key_user),or(99@pk(key_service),older(12960)))

You would need to adjust it for your desired example. A Policy that fits your needs would be:
and(pk(key_1),or(99@pk(key_2),older(52560)))

Once you have the Policy you can copy and paste this into the Policy to Miniscript compiler section and get the Miniscript equivalent of this Policy. The Miniscript output is:
and_v(v:pk(key_1),or_d(pk(key_2),older(52560)))

Further down you can copy and paste this Miniscript in, press Analyze and you will get the size of the resulting Script (78 bytes) as well as the actual Script:
<key_1> OP_CHECKSIGVERIFY <key_2> OP_CHECKSIG OP_IFDUP OP_NOTIF
    <50cd00> OP_CHECKSEQUENCEVERIFY
OP_ENDIF

It is worth noting that this example assumes you are more concerned with losing one particular key (key_2 in this example) and you assume will still have access to key 1. If you are just as likely to lose either key (key_1 or key_2) you would want a different script.
I recommend you try this on testnet or Signet first where coins aren't worth anything. Alternatively with a small amount of funds on mainnet that you can afford to lose. You don't want to be losing all your funds due to a mistake or a misunderstanding.

47827: <p>I would like my Bitcoin to have the extra security that a 2-of-2 multisig provides. With a single sig I am worried that if a single key gets hacked I will lose my funds. However, with a 2-of-2 multisig I am worried that if I lose <em>either</em> key my funds will be trapped.</p>
<p>How do I write a script such that my funds are locked in a 2-of-2 multisig which converts into a 1-of-2 multisig after 365 days? This way I get the best of both worlds. I have greater security for 365 days and then if I lose one of my keys I can still access my funds after 365 days.</p>
 47827: <p>To construct the script you could use Pieter Wuille's Miniscript <a href="http://bitcoin.sipa.be/miniscript/" rel="nofollow noreferrer">site</a>.</p>
<p>If you go to the Policy to Miniscript compiler section there is an example in Policy for a 2-of-2 multisig that turns into a 1-of-2 multisig after 90 days.</p>
<pre><code>and(pk(key_user),or(99@pk(key_service),older(12960)))
</code></pre>
<p>You would need to adjust it for your desired example. A Policy that fits your needs would be:</p>
<pre><code>and(pk(key_1),or(99@pk(key_2),older(52560)))
</code></pre>
<p>Once you have the Policy you can copy and paste this into the Policy to Miniscript compiler section and get the Miniscript equivalent of this Policy. The Miniscript output is:</p>
<pre><code>and_v(v:pk(key_1),or_d(pk(key_2),older(52560)))
</code></pre>
<p>Further down you can copy and paste this Miniscript in, press Analyze and you will get the size of the resulting Script (78 bytes) as well as the actual Script:</p>
<pre><code>&lt;key_1&gt; OP_CHECKSIGVERIFY &lt;key_2&gt; OP_CHECKSIG OP_IFDUP OP_NOTIF
    &lt;50cd00&gt; OP_CHECKSEQUENCEVERIFY
OP_ENDIF
</code></pre>
<p>It is worth noting that this example assumes you are more concerned with losing one particular key (<code>key_2</code> in this example) and you assume will still have access to <code>key 1</code>. If you are just as likely to lose either key (<code>key_1</code> or <code>key_2</code>) you would want a different script.</p>
<p>I recommend you try this on testnet or Signet first where coins aren't worth anything. Alternatively with a small amount of funds on mainnet that you can afford to lose. You don't want to be losing all your funds due to a mistake or a misunderstanding.</p>
