<p>Ok, I lost a full day on it. But the solution was annoyingly simple, the hash is invalid, just provide the proper private key. I just messed up in my mind, I was pursuaded my arguments were correct.</p>

CC BY-SA 4.0
2022-08-27T22:04:06.997Z
2022-08-27T22:04:06.997Z
andre
<p>I use unsynced bitcoin core wallet because data is too costly and I do not trust anything other than bitcoin core, people told me to do so.</p>
<p>Playing around I originated this transaction id: e11bdbf2ecaa4309ba7664fe53876d04c47b2faf6aa428c7fd7c1bd574c0c85e
I want to spend them to another address.
So I constructed a new transaction and wanted to sign it, I believe I have to redeem a P2wpkh script to unlock the funds :</p>
<pre><code>signrawtransactionwithkey &quot;02000000015ec8c074d51b7cfdc728a46aaf2f7bc4046d8753fe6476ba0943aaecf2db1be10000000000ffffffff01e485010000000000160014a6d3b75abe310aaa1dbcfe6a78d1d96307cd11c400000000&quot; '''[&quot;Myprivatekey&quot;]''' '''[{&quot;txid&quot;: &quot;e11bdbf2ecaa4309ba7664fe53876d04c47b2faf6aa428c7fd7c1bd574c0c85e&quot;,&quot;vout&quot;: 0,&quot;scriptPubKey&quot;: &quot;001491a4d1774ba4d8d19c2a880ab42460589ed6c98f&quot;, &quot;amount&quot;: 0.00099812}]'''
</code></pre>
<p>But bitcoin core tells me that there is witness program hash mismatch.
Can someone please help me.
Cordially</p>

<transactions><bitcoin-cli><p2wpkh>
p2wpkh spending problem
andre
# p2wpkh spending problem

(Asked by: username_0 on 2022-08-27)

I use unsynced bitcoin core wallet because data is too costly and I do not trust anything other than bitcoin core, people told me to do so.
Playing around I originated this transaction id: e11bdbf2ecaa4309ba7664fe53876d04c47b2faf6aa428c7fd7c1bd574c0c85e
I want to spend them to another address.
So I constructed a new transaction and wanted to sign it, I believe I have to redeem a P2wpkh script to unlock the funds :
signrawtransactionwithkey "02000000015ec8c074d51b7cfdc728a46aaf2f7bc4046d8753fe6476ba0943aaecf2db1be10000000000ffffffff01e485010000000000160014a6d3b75abe310aaa1dbcfe6a78d1d96307cd11c400000000" '''["Myprivatekey"]''' '''[{"txid": "e11bdbf2ecaa4309ba7664fe53876d04c47b2faf6aa428c7fd7c1bd574c0c85e","vout": 0,"scriptPubKey": "001491a4d1774ba4d8d19c2a880ab42460589ed6c98f", "amount": 0.00099812}]'''

But bitcoin core tells me that there is witness program hash mismatch.
Can someone please help me.
Cordially

**Tags:** transactions, bitcoin-cli, p2wpkh


---

## 1 answers

### Answer by username_0 on 2022-08-27. Score: 1

Ok, I lost a full day on it. But the solution was annoyingly simple, the hash is invalid, just provide the proper private key. I just messed up in my mind, I was pursuaded my arguments were correct.


---

