<p>I am using Bitcoin core 0.14.1 testnet. I created a Segwit address. transfer some coins to this address. Now I want to spend it. I created a raw transaction using console command i.e. <em><strong>createrawtransaction</strong></em>. Now I want to sign it. I tried using usual way i.e</p>
<p><em><strong>signrawtransaction</strong></em> 'hex_got_from_rawtx' '[{&quot;txid&quot;:&quot;&quot;,&quot;vout&quot;: index,&quot;scriptPubkey&quot;:&quot;&quot;,&quot;redeemScript&quot;:&quot;&quot;}]' '[&quot;Private_key_of_address_used_in_segwit_address&quot;]'</p>
<p>I am getting the error is: &quot;<em>witness program hash mismatch</em>&quot;</p>
<p>Any idea how can I get rid of it?</p>

CC BY-SA 3.0
2017-07-24T07:11:39.577Z
How did you create the segwit address? Did you use `addwitnessaddress`?
Ava Chow
CC BY-SA 3.0
2017-07-25T07:48:41.623Z
Yes, exactly.I used the same.
DOLLY PATWA
CC BY-SA 3.0
2017-07-25T09:40:31.437Z
But I got to know that, I can't be able to retrieve back the address. I.e. I used addwitnessaddress "Address" then I got one address which is result of above query. Now I forgot the original  address and not able to retrieve it. Without this I can't sign rawtx i.e. dumpprivkey is only valisd on address not witness address.
DOLLY PATWA
CC BY-SA 3.0
2017-07-25T16:34:38.880Z
Was the address you used in `addwitnessaddress` an address from the Bitcoin Core wallet or from elsewhere?
Ava Chow
CC BY-SA 3.0
2017-07-27T11:32:04.767Z
Yes The address was from bitcoin core wallet of mine only. If I use validateaddress "Multisig_address" then I am getting back all the addresses which I have used to create Multisig_address but if I use validateaddress "Segwit_address" then I am not getting the address which i have used to create Segwit_address.
DOLLY PATWA
<bitcoin-core><testnet><segregated-witness><p2wpkh><signrawtransaction>
To sign raw transaction with Segwit Address in the TestNet
DOLLY PATWA
# To sign raw transaction with Segwit Address in the TestNet

(Asked by: username_0 on 2017-07-24)

I am using Bitcoin core 0.14.1 testnet. I created a Segwit address. transfer some coins to this address. Now I want to spend it. I created a raw transaction using console command i.e. ***createrawtransaction***. Now I want to sign it. I tried using usual way i.e

***signrawtransaction*** 'hex\_got\_from\_rawtx' '[{"txid":"","vout": index,"scriptPubkey":"","redeemScript":""}]' '["Private\_key\_of\_address\_used\_in\_segwit\_address"]'

I am getting the error is: "*witness program hash mismatch*"

Any idea how can I get rid of it?

**Tags:** bitcoin-core, testnet, segregated-witness, p2wpkh, signrawtransaction

> **Comments:**
> **username_1**: How did you create the segwit address? Did you use `addwitnessaddress`?  
> **username_0**: Yes, exactly.I used the same.  
> **username_0**: But I got to know that, I can't be able to retrieve back the address. I.e. I used addwitnessaddress "Address" then I got one address which is result of above query. Now I forgot the original  address and not able to retrieve it. Without this I can't sign rawtx i.e. dumpprivkey is only valisd on address not witness address.  
> **username_1**: Was the address you used in `addwitnessaddress` an address from the Bitcoin Core wallet or from elsewhere?  
> **username_0**: Yes The address was from bitcoin core wallet of mine only. If I use validateaddress "Multisig_address" then I am getting back all the addresses which I have used to create Multisig_address but if I use validateaddress "Segwit_address" then I am not getting the address which i have used to create Segwit_address.  

---

## 0 answers

