<p>In a proposed edit of the question, the question author (under a different ID) wrote:</p>
<blockquote>
<p>Update The fix with the manual edit worked! No for-loop needed haha. I removed the sh() around wpkh and calculated/replaced the hash as you suggested. Did impotmulti and rescanblockchain and now the bc1 address shows up. Thanks!</p>
<p>Now i have to figure out if the funds are spendable with a trezor.</p>
</blockquote>
<p>(This Community Wiki answer created so that Q is removed from unanswered questions list)</p>

CC BY-SA 4.0
2020-02-28T16:14:24.513Z
2020-02-28T16:14:24.513Z
2020-06-16T11:10:03.350Z
RedGrittyBrick
<p>First of all thanks for all the awesome tools. Especially Andrew Chow and Sjoors Provoost, for my use case.<br>
Now, I´m a little confused. A transaction I sent from a mobile wallet to a watch only wallet in core is not showing.<br>
I am on bitcoin core 0.19.01 on Raspbian , running hwi.py v1.0.3 and using a Trezor One.  </p>

<p>The steps i followed:<br>
1. in bitcoin core GUI, create an unencrypted wallet without private keys (i.e. watch only)<br>
2. unlock trezor using pin challenge on wallet.trezor.io<br>
3. export public keys from trezor using HWI  </p>

<pre><code>./hwi.py --fingerprint xxxxxx getdescriptors --account 0
</code></pre>

<p>returns the expected .json with 1 pkh, 1 sh(wpkh) ,1 wpkh each for receive and internal (change?)</p>

<ol start="4">
<li>create .json file to parse as argument to importmulti like so  </li>
</ol>

<pre><code>'[{"range": [0, 1000], "timestamp": "now", "keypool": true, "watchonly": true, "desc": "sh(wpkh([..../0/*...", "internal": false},   
{"range": [0, 1000], "timestamp": "now", "keypool": true, "watchonly": true, "desc": "sh(wpkh([..../1/*...", "internal": true}]'
</code></pre>

<p>by copy pasting the sh(wpkh lines in the output from getdescriptors<br>
5. run importmulti jsonstring_above --> success and success for both xpub´s<br>
6. rescanblockchain --> found all the addresses previously sent to my trezor, they all start with 3 - all the money is there, the watch only wallet works 
   SO FAR SO GOOD   </p>

<ol start="7">
<li>in this wallet, generated a receiving address with default bech32 format (starting with bc1)</li>
<li>scanned the qr code with mycelium (can send an receive bech32) and sent the transaction (was only a small amount for testing)</li>
<li>it went into the next block and got confirmed 3-4 times in 10 minutes</li>
<li>went back to core and ran <code>rescanblockchain block_height_a_few_hours_back</code><br>
but there's no new transaction. Core didn't notify me when it hit the mempool or the blockchain.<br>
The send address in mycelium is the same as generated in core.</li>
<li>tried importing the wpkh xpubs to the wallet using importmulti, also success and success, rescanblockchain, but still no sign of the transaction.</li>
</ol>

<p>So my question: where my money at? :) Can you help please? 
 How can the watch only wallet derive bech32 addresses just by knowing the pubkeys? And why does it not see/report transactions it has created itself? It makes for a strange user experience.  Also the fact that the receive address is no showing/verified on the trezor makes it a bit scary process. This seems like the place where scammers would attack a noob like me.</p>

<p>That wallet.trezor.io does not support bech32 receive addresses doesn´t help confidence, altough that's not directly related to my issue I think.</p>

<p>Hope this makes sense. Thanks already for the help!!</p>

<hr>

<h2>Update</h2>

<p>Thanks, Andrew!
I had to first index the transactions, took a little while. Below is the output of the commands. I am not sure what they mean though. </p>

<pre><code>
22:06:56
￼
gettransaction 1f10f68c1c21fbab3ddda0138cfb3dfec55e158f630c56997ea690adaece56e2


22:06:56
￼
Invalid or non-wallet transaction id (code -5)


22:07:14
￼
getrawtransaction 1f10f68c1c21fbab3ddda0138cfb3dfec55e158f630c56997ea690adaece56e2 


22:07:14
￼
0100000000010159e285bec79b5287fc82eb200fe460537a3a299ee39b65755a8c61ad8a1443820000000000ffffffff0260e3160000000000160014bb7017605d2c404a9e161ae9a8b8d82166dcee3f9eac1f0000000000160014a38c7bd94c6daf16408338d1b424a1a7635faaf702483045022100deae3ae36d8373cffc4a925ac2ef68e12c855ce6451abcd9f91b651b73fda14602200b72c3b452eb97cb10a766976d3718e516d177e979ed576ba4c661decea90663012102b682a49236776bff9a29b844d4b1234202a628abdb10deab7924d87a682c5c7f00000000
</code></pre>

<p>The receive address I created shows in Bitcoin core as bc1qhdcpwcza93qy48skrt563wxcy9ndem3lu43d9r</p>

<p>The Blockstream block explorer shows that this is the address where the transaction was sent:
<a href="https://blockstream.info/tx/1f10f68c1c21fbab3ddda0138cfb3dfec55e158f630c56997ea690adaece56e2?expand" rel="nofollow noreferrer">https://blockstream.info/tx/1f10f68c1c21fbab3ddda0138cfb3dfec55e158f630c56997ea690adaece56e2?expand</a>
As far as I understand, it checks out.</p>

<p>Any idea why I cannot list it in Bitcoin core in the transactions list?</p>

<hr>

<p>This is what the command return in core. I don't see the derivation path. Am I missing something obvious? The part with "ismine":false   is a little stressful lol.
Any idea?</p>

<pre><code>
20:33:00
￼
getaddressinfo bc1qhdcpwcza93qy48skrt563wxcy9ndem3lu43d9r


20:33:00
￼
{
  "address": "bc1qhdcpwcza93qy48skrt563wxcy9ndem3lu43d9r",
  "scriptPubKey": "0014bb7017605d2c404a9e161ae9a8b8d82166dcee3f",
  "ismine": false,
  "solvable": false,
  "iswatchonly": false,
  "isscript": false,
  "iswitness": true,
  "witness_version": 0,
  "witness_program": "bb7017605d2c404a9e161ae9a8b8d82166dcee3f",
  "ischange": false,
  "labels": [
  ]
}

</code></pre>

<p>I unlocked the trezor and tried this in the bash console. Based on what I understood about the displayaddress arguments.
The error messages are not clear to me.</p>

<pre><code>$./hwi.py --fingerprint xxxxx displayaddress --path m/49h/0h/0h/1/*
{"error": "('Invalid BIP32 path', 'm/49h/0h/0h/1/*')", "code": -7}
$./hwi.py --fingerprint xxxx displayaddress --desc sh(wpkh([xxxxx/49h/0h/0h]xpub6DQ...../0/0))
bash: syntax error near unexpected token `('
</code></pre>

<hr>

<p>I am still confused. </p>

<ol>
<li><p>Why does the Bitcoin Core watch-only wallet not watch transactions that it lists in the 'Receiving Addresses'? Is this the bug you mentioned?   </p></li>
<li><p>I couldn't find the path that was used to derive the address in <code>getaddressinfo</code> output.</p></li>
</ol>

<p>But I get something out of the device that makes more sense.
<code>$ ./hwi.py --fingerprint xxxxxx displayaddress --path m/84h/0h/0h/0/0 --wpkh</code> --> trezor returns a bc1qxxxxxx address that is also in the list seen in Core at 'Receiving addresses'
Same with <code>m/84h/0h/0h/0/1</code>. But I imported 1000 addresses as you can see in my <code>importmulti</code>.
Is there any way to find the <code>m/84h/0h/0h/0/n</code> n-th address that correspond to bc1qhdcpwcza93qy48skrt563wxcy9ndem3lu43d9r? I don't want to have to for-loop 1000 tries with the trezor :D  Thanks!</p>

<p><em>Update</em>
The fix with the manual edit worked! No for-loop needed haha.
I removed the sh() around wpkh and calculated/replaced the hash as you suggested. Did impotmulti and rescanblockchain and now the bc1 address shows up.
Thanks!</p>

<p>Now i have to figure out if the funds are spendable with a trezor. </p>

CC BY-SA 4.0
2020-02-16T17:44:39.173Z
Do either of `gettransaction` or `getrawtransaction` work for your transaction?
Ava Chow
CC BY-SA 4.0
2020-02-19T22:13:16.717Z
Are you able to display that address on your device using `hwi displayaddress`? You can find the derivation path using the `getaddressinfo` RPC. I think this is related to a rescanning bug in Core that I have been unable to nail down.
Ava Chow
CC BY-SA 4.0
2020-02-21T16:11:45.303Z
The `getaddressinfo` output indicates that your wallet isn't actually watching for these addresses. For the `displayaddress` error, your arguments are incorrect. You have given it the derivation path range that imported. You need to give it a single derivation path like `m/49h/0h/0h/1/0`.
Ava Chow
CC BY-SA 4.0
2020-02-22T17:56:24.810Z
The only way to figure out which index it is is to just try them all in a for loop. But there's one other thing I would like you to try first. Can you do the `importmulti` again but changing `sh(wpkh()` descriptor you have into a `wpkh()`? Don't use the `wpkh()` given by HWI. Rather take the `sh(wpkh())`, remove the beginning `sh(` part and the last `)` you see. Also remove the checksum (the `#....` stuff at the end of the descriptor). You will need to first use `getdescriptorinfo` with that modified descriptor to produce a correct checksum. Then you can import it with `importmulti`.
Ava Chow
<trezor><watch-only>
bech32 address not showing in watch-only wallet (using HWI descriptors)
positronic_bot
# bech32 address not showing in watch-only wallet (using HWI descriptors)

(Asked by: username_0 on 2020-02-16)

First of all thanks for all the awesome tools. Especially Andrew username_1 and Sjoors Provoost, for my use case.  
Now, I´m a little confused. A transaction I sent from a mobile wallet to a watch only wallet in core is not showing.  
I am on bitcoin core 0.19.01 on Raspbian , running hwi.py v1.0.3 and using a Trezor One.

The steps i followed:  
1. in bitcoin core GUI, create an unencrypted wallet without private keys (i.e. watch only)  
2. unlock trezor using pin challenge on wallet.trezor.io  
3. export public keys from trezor using HWI

```
./hwi.py --fingerprint xxxxxx getdescriptors --account 0

```

returns the expected .json with 1 pkh, 1 sh(wpkh) ,1 wpkh each for receive and internal (change?)

4. create .json file to parse as argument to importmulti like so

```
'[{"range": [0, 1000], "timestamp": "now", "keypool": true, "watchonly": true, "desc": "sh(wpkh([..../0/*...", "internal": false},   
{"range": [0, 1000], "timestamp": "now", "keypool": true, "watchonly": true, "desc": "sh(wpkh([..../1/*...", "internal": true}]'

```

by copy pasting the sh(wpkh lines in the output from getdescriptors  
5. run importmulti jsonstring\_above --> success and success for both xpub´s  
6. rescanblockchain --> found all the addresses previously sent to my trezor, they all start with 3 - all the money is there, the watch only wallet works
SO FAR SO GOOD

7. in this wallet, generated a receiving address with default bech32 format (starting with bc1)
8. scanned the qr code with mycelium (can send an receive bech32) and sent the transaction (was only a small amount for testing)
9. it went into the next block and got confirmed 3-4 times in 10 minutes
10. went back to core and ran `rescanblockchain block_height_a_few_hours_back`  
    but there's no new transaction. Core didn't notify me when it hit the mempool or the blockchain.  
    The send address in mycelium is the same as generated in core.
11. tried importing the wpkh xpubs to the wallet using importmulti, also success and success, rescanblockchain, but still no sign of the transaction.

So my question: where my money at? :) Can you help please?
How can the watch only wallet derive bech32 addresses just by knowing the pubkeys? And why does it not see/report transactions it has created itself? It makes for a strange user experience. Also the fact that the receive address is no showing/verified on the trezor makes it a bit scary process. This seems like the place where scammers would attack a noob like me.

That wallet.trezor.io does not support bech32 receive addresses doesn´t help confidence, altough that's not directly related to my issue I think.

Hope this makes sense. Thanks already for the help!!

---

## Update

Thanks, Andrew!
I had to first index the transactions, took a little while. Below is the output of the commands. I am not sure what they mean though.

```

22:06:56
￼
gettransaction 1f10f68c1c21fbab3ddda0138cfb3dfec55e158f630c56997ea690adaece56e2

22:06:56
￼
Invalid or non-wallet transaction id (code -5)

22:07:14
￼
getrawtransaction 1f10f68c1c21fbab3ddda0138cfb3dfec55e158f630c56997ea690adaece56e2 

22:07:14
￼
0100000000010159e285bec79b5287fc82eb200fe460537a3a299ee39b65755a8c61ad8a1443820000000000ffffffff0260e3160000000000160014bb7017605d2c404a9e161ae9a8b8d82166dcee3f9eac1f0000000000160014a38c7bd94c6daf16408338d1b424a1a7635faaf702483045022100deae3ae36d8373cffc4a925ac2ef68e12c855ce6451abcd9f91b651b73fda14602200b72c3b452eb97cb10a766976d3718e516d177e979ed576ba4c661decea90663012102b682a49236776bff9a29b844d4b1234202a628abdb10deab7924d87a682c5c7f00000000

```

The receive address I created shows in Bitcoin core as bc1qhdcpwcza93qy48skrt563wxcy9ndem3lu43d9r

The Blockstream block explorer shows that this is the address where the transaction was sent:
<https://blockstream.info/tx/1f10f68c1c21fbab3ddda0138cfb3dfec55e158f630c56997ea690adaece56e2?expand>
As far as I understand, it checks out.

Any idea why I cannot list it in Bitcoin core in the transactions list?

---

This is what the command return in core. I don't see the derivation path. Am I missing something obvious? The part with "ismine":false is a little stressful lol.
Any idea?

```

20:33:00
￼
getaddressinfo bc1qhdcpwcza93qy48skrt563wxcy9ndem3lu43d9r

20:33:00
￼
{
  "address": "bc1qhdcpwcza93qy48skrt563wxcy9ndem3lu43d9r",
  "scriptPubKey": "0014bb7017605d2c404a9e161ae9a8b8d82166dcee3f",
  "ismine": false,
  "solvable": false,
  "iswatchonly": false,
  "isscript": false,
  "iswitness": true,
  "witness_version": 0,
  "witness_program": "bb7017605d2c404a9e161ae9a8b8d82166dcee3f",
  "ischange": false,
  "labels": [
  ]
}

```

I unlocked the trezor and tried this in the bash console. Based on what I understood about the displayaddress arguments.
The error messages are not clear to me.

```
$./hwi.py --fingerprint xxxxx displayaddress --path m/49h/0h/0h/1/*
{"error": "('Invalid BIP32 path', 'm/49h/0h/0h/1/*')", "code": -7}
$./hwi.py --fingerprint xxxx displayaddress --desc sh(wpkh([xxxxx/49h/0h/0h]xpub6DQ...../0/0))
bash: syntax error near unexpected token `('

```

---

I am still confused.

1. Why does the Bitcoin Core watch-only wallet not watch transactions that it lists in the 'Receiving Addresses'? Is this the bug you mentioned?
2. I couldn't find the path that was used to derive the address in `getaddressinfo` output.

But I get something out of the device that makes more sense.
`$ ./hwi.py --fingerprint xxxxxx displayaddress --path m/84h/0h/0h/0/0 --wpkh` --> trezor returns a bc1qxxxxxx address that is also in the list seen in Core at 'Receiving addresses'
Same with `m/84h/0h/0h/0/1`. But I imported 1000 addresses as you can see in my `importmulti`.
Is there any way to find the `m/84h/0h/0h/0/n` n-th address that correspond to bc1qhdcpwcza93qy48skrt563wxcy9ndem3lu43d9r? I don't want to have to for-loop 1000 tries with the trezor :D Thanks!

*Update*
The fix with the manual edit worked! No for-loop needed haha.
I removed the sh() around wpkh and calculated/replaced the hash as you suggested. Did impotmulti and rescanblockchain and now the bc1 address shows up.
Thanks!

Now i have to figure out if the funds are spendable with a trezor.

**Tags:** trezor, watch-only

> **Comments:**
> **username_1**: Do either of `gettransaction` or `getrawtransaction` work for your transaction?  
> **username_1**: Are you able to display that address on your device using `hwi displayaddress`? You can find the derivation path using the `getaddressinfo` RPC. I think this is related to a rescanning bug in Core that I have been unable to nail down.  
> **username_1**: The `getaddressinfo` output indicates that your wallet isn't actually watching for these addresses. For the `displayaddress` error, your arguments are incorrect. You have given it the derivation path range that imported. You need to give it a single derivation path like `m/49h/0h/0h/1/0`.  
> **username_1**: The only way to figure out which index it is is to just try them all in a for loop. But there's one other thing I would like you to try first. Can you do the `importmulti` again but changing `sh(wpkh()` descriptor you have into a `wpkh()`? Don't use the `wpkh()` given by HWI. Rather take the `sh(wpkh())`, remove the beginning `sh(` part and the last `)` you see. Also remove the checksum (the `#....` stuff at the end of the descriptor). You will need to first use `getdescriptorinfo` with that modified descriptor to produce a correct checksum. Then you can import it with `importmulti`.  

---

## 1 answers

### Answer by username_2 on 2020-02-28. Score: 1

In a proposed edit of the question, the question author (under a different ID) wrote:

> Update The fix with the manual edit worked! No for-loop needed haha. I removed the sh() around wpkh and calculated/replaced the hash as you suggested. Did impotmulti and rescanblockchain and now the bc1 address shows up. Thanks!
>
> Now i have to figure out if the funds are spendable with a trezor.

(This Community Wiki answer created so that Q is removed from unanswered questions list)


---

