Bitcoin

bitcoind – P2WSH Bitcoin Core watchdog script bean error

I’m trying to use P2WSH output. Here are the steps I took:

  1. I generated P2WSH output via bitcoin-cli. Details of the P2WSH output are as follows:
Type
V0_P2WSH
scriptPubKey (asm)
OP_0 OP_PUSHBYTES_32 a2b95877500eb4180401640c5649c55ce578584f865e4f1609f9971ca19d6f40
scriptPubKey (hex)
0020a2b95877500eb4180401640c5649c55ce578584f865e4f1609f9971ca19d6f40
Spending tx
Unspent

You can also see it here: https://blockstream.info/testnet/tx/3010534df31914f938014d34d0bd402ce1a741a46624b28abcfd2462126331a5?expand

  1. To use that output, first create a transaction via bitcoin-cli as follows:
bitcoin-cli createrawtransaction (\"txid\":\"3010534df31914f938014d34d0bd402ce1a741a46624b28abcfd2462126331a5\",\"vout\":0) (\"tb1q77vr56qx6y5vs2zzt9qc85ge62j30r6vaccfxl\":0.0000007)

This will output the following serialization:

0200000001a53163126224fdbc8ab22466a441a7e12c40bdd0344d0138f91419f34d5310300000000000fdffffff014600000000000000160014f7983a6806d128c82842594183d119d2a5178f4c00000000
  1. Now you want to sign your message.
bitcoin-cli signrawtransactionwithwallet "0200000001a53163126224fdbc8ab22466a441a7e12c40bdd0344d0138f91419f34d5310300000000000fdffffff014600000000000000160014f7983a6806d128c82842594183d119d2a5178f4c00000000" (\"txid\":\"3010534df31914f938014d34d0bd402ce1a741a46624b28abcfd2462126331a5\",\"vout\":0,\"scriptPubKey\":\"0020a2b95877500eb4180401640c5649c55ce578584f865e4f1609f9971ca19d6f40\",\"witnessScript\":\"4c02efef754c14f7983a6806d128c82842594183d119d2a5178f4cac\",\"amount\":0.0000007)

However, this method doesn’t work because I always get the following error:


  "hex": "0200000001a53163126224fdbc8ab22466a441a7e12c40bdd0344d0138f91419f34d5310300000000000fdffffff014600000000000000160014f7983a6806d128c82842594183d119d2a5178f4c00000000",
  "complete": false,
  "errors": (
    
      "txid": "3010534df31914f938014d34d0bd402ce1a741a46624b28abcfd2462126331a5",
      "vout": 0,
      "witness": (
      ),
      "scriptSig": "",
      "sequence": 4294967293,
      "error": "Witness program was passed an empty witness"
    
  )

I don’t understand why I’m getting it. Witness Program Passed Blank Witness An error occurred. This is because you are explicitly passing the monitoring script on the command line. Are there any bugs? Or am I missing something?

The hashed witness script is:
OP_PUSHDATA1 EFEF OP_DROP OP_PUSHDATA1 f7983a6806d128c82842594183d119d2a5178f4c OP_CHECKSIG
serialized
4c02EFEF754c14f7983a6806d128c82842594183d119d2a5178f4cac

Related Articles

Back to top button