Bitcoin

Script – Conditional spend from P2WSH address

What am I doing wrong? Sinse I discovered that Bitcoin is a programmable currency and am trying to exploit its potential. I used this site https://improvein.github.io/bitcoin-forge/?#/script/create to create a conditional script that holds two time locks on two pub keys.

OP_IF 1694275749 OP_CHECKLOCKTIMEVERIFY OP_DROP 03cd18ace3a339fcd0039fd87d7a7a8377537cd9a9f2afa2a3e76f40e53112a535 OP_CHECKSIG OP_ELSE 1694277749 OP_CHE EVERIFY OP_ DROP 036bb176ed8fe2e38949a63ff964eed3c5e79fd88ac011cad1eecf22702ea65d23 OP_CHECKSIG OP_ENDIF

Script 63051694275749b1752103cd18ace3a339fcd0039fd87d7a7a8377537cd9a9f2afa2a3e76f40e53112a535ac67051694277749b17521036bb176ed8fe2e389 4 9a63ff964eed3c5e79fd88ac011cad1eecf22702ea65d23ac68

I used this script to create it with this tool https://improvein.github.io/bitcoin-forge/?#/address/create Payment to witness script hash address bc1qes2v6ts5ckxuz5mkwdeukcn62hkac05kf97gugc4jnu3kj3wg5as3nes34

We are now using the Bitcoin Core CLI to sign inputs and create raw transactions. And I was completely stacked at this point. How and what to sign and how to put this puzzle to unlock the deal.

The scope of this script is to provide a family member with some funds locked in the future with the ability to spend them using either of the two private keys. If he loses the key, he can use it with the op_else condition. I will provide some data

gettxout 14290ef656c05f8e0c06b6d99a6ae72c77a8809b3a69dd5fb00f07ce9cee1637  vout 133



  "bestblock": "0000000000000000000528fb0e92c1e79378a1b241eb144ca0f97054fdf42dfb",
  "confirmations": 155,
  "value": 0.00007726,
  "scriptPubKey": 
    "asm": "0 cc14cd2e14c58dc153767373cb627a55eddc3e96497c8e231594f91b4a2e453b",
    "desc": "addr(bc1qes2v6ts5ckxuz5mkwdeukcn62hkac05kf97gugc4jnu3kj3wg5as3nes34)#k8s5es0p",
    "hex": "0020cc14cd2e14c58dc153767373cb627a55eddc3e96497c8e231594f91b4a2e453b",
    "address": "bc1qes2v6ts5ckxuz5mkwdeukcn62hkac05kf97gugc4jnu3kj3wg5as3nes34",
    "type": "witness_v0_scripthash"
  ,
  "coinbase": false

lock script


  "asm": "1692429480 OP_CHECKLOCKTIMEVERIFY OP_DROP OP_IF 03cd18ace3a339fcd0039fd87d7a7a8377537cd9a9f2afa2a3e76f40e53112a535 OP_CHECKSIG OP_ELSE 1692602280 OP_CHECKLOCKTIMEVERIFY OP_DROP 036bb176ed8fe2e38949a63ff964eed3c5e79fd88ac011cad1eecf22702ea65d23 OP_CHECKSIG OP_ENDIF",
  "desc": "raw(04a86ce064b175632103cd18ace3a339fcd0039fd87d7a7a8377537cd9a9f2afa2a3e76f40e53112a535ac6704a80fe364b17521036bb176ed8fe2e38949a63ff964eed3c5e79fd88ac011cad1eecf22702ea65d23ac68)#r3dcxvh2",
  "type": "nonstandard",
  "p2sh": "38cTqVJf1jPBDCjg8wKdFx476uHX3qgEaB",
  "segwit": 
    "asm": "0 69672524bb7737429280e9c862b3fdcea0dc22037cbaaa755d6132b4841811e4",
    "desc": "wsh(raw(04a86ce064b175632103cd18ace3a339fcd0039fd87d7a7a8377537cd9a9f2afa2a3e76f40e53112a535ac6704a80fe364b17521036bb176ed8fe2e38949a63ff964eed3c5e79fd88ac011cad1eecf22702ea65d23ac68))#7uzehfsr",
    "hex": "002069672524bb7737429280e9c862b3fdcea0dc22037cbaaa755d6132b4841811e4",
    "address": "bc1qd9nj2f9mwum59y5qa8yx9vlae6sdcgsr0ja25a2avyetfpqcz8jqg69shh",
    "type": "witness_v0_scripthash",
    "p2sh-segwit": "3NqDPiKTsbYA18GRWzrsE5wYYxGhH9XS96"
  

And the second question

Since a 32-bit signed integer can represent a maximum of 2,147,483,647 seconds, which is approximately 68 years, this is how the segwit time locking script works, taking into account the “2038 problem” when problems arise. The Unix era began on January 1, 1970, so adding 68 years to this date gives us January 19, 2038. So the question is: After January 19, 2038, can the time of locked up funds be spent in the same way as it is today?

Related Articles

Back to top button