pull down to refresh

I had quite a fun night last night because I needed to find out some mystery missing sats! Sericiouly, nothing motivates you to learn more when your precious sats went missing.

The Background Story

I received a new payment in BTCpay yesterday - someone paid for my course, onchain and already has six confirmations, but it's not showing up in my external wallet ( I'm using Blue Wallet as watch-only ), which is so strange; I thought maybe something is wrong with my internet or VPN at first, but checked both are fine; Then I thought maybe some bug in BW because it's quite slow updating, so I created a watch-only wallet in Green wallet to have a check, still, no new tx, how is this possible? And what happened to run my own bank if I can't even locate my own money. πŸ€”
Then I started looking around in BTCpay, got the tx, and it says 6 confirmations, so someone did pay and I located the address that received the payment, and I also found a series of strange details as I kept digging. πŸ•΅πŸΌ
  • BTCpay confirmed the payment and showed the correct balance, yet no new tx in my watch-only wallet. 1
  • The newly created addresses from BTCpay don't even match the addresses in my external wallet. 2
  • The master key in the BTCpay shows xpub, while my external wallet is showing zpub. 3
Did my BTCpay get hacked, and someone changed the master key?
If you want to exercise your troubleshooting skills, here is how I set up my BTCpay - I'm using Voltage to host it, with a master key from an external wallet to configure the onchain wallet, and the problem is someone paid over onchain and confirmed, the BTCpay dashboard also showing the correct balance, but no new tx in my external wallet, so need to find out the missing tx and the sats.
Curious to see what you would do if you were me. Feel free to pause here for a little creativity and Bitcoin knowledge exercise! πŸ‘€
...

Here is What I did

I contacted @Darthcoin to see what he thinks, and he told me that it could be caused by the derivation paths, and he patiently explained to me that xpub, zpub, and ypub are the same, only the derivation path and address format are different - BIP32/44 use xpub, BIP49 use ypub, BIP84 use zpub.
Oh, so basically it can create many addresses under different derivation paths within the same seeds! It's so interesting, but at the same time, it gets quite complicated, as there are so many paths; He also shared this link for me to play around: https://iancoleman.io/bip39/ and told me to try importing that xpub/zpub under different derivations paths in Electrum or Sparrow. So, the new direction to solve this problem is to locate the addresses under other derivations paths. I then used the master key to import the watch only wallet to both Electrum and Sparrow.
Results:
  • I couldn't see the path choice in Electum when importing the wallet using Xpub or Zpub.
  • I've managed to verify that both the Xpub showing in BTCpay and Zpub showing in my wallet are actually the same in Sparrow, and that's relieving!
And it makes sense why the balance in BTCpay is showing correctly, so no one hacked it, but the new tx went missing in my wallet! One more detail to share, when choosing which script type to restore, you can simply check the address: if it starts with bc1p, then it is taproot; if it starts with bc1q, then it is native.
I even tested with different derivation paths that I found and tried to locate the new tx, but all failed. Then I kept checking and reading because I knew that I wouldn't get a good sleep if I didn't solve this problem. It was about 9pm, so I decided to brew a pot of Turkish coffee to relax and rethink.
Nothing can't be solved with a good cup of tea or coffee In Turkey:)

Calm Down and Rethink

After a cup of coffee, I could think with a much clearer mind and started searching if anyone had a similar issue, but I didn't find anything; then I went back to look at both docs from Voltage and BTCpay, and guess what I found!
Wow, I've never heard of this problem, but it sounds like it! I then also contacted BTCpay to see if there was any bug or update, and someone sent me the same link that I found, which gave me more confidence that this should be the solution for this tx missing problem.
It's not easy to solve the gap limit problem. You have two options:
  1. Increase the gap limit in your existing (external) wallet
  2. Use internal BTCPay Server wallet
I would like to keep using my own external wallet, so onto the NEXT - increase the gap limit! and currently, you can do this only in two wallets: Electrum or Wasabi, and I chose Electrum.

πŸ› οΈ Process

Step 1.
The first thing I did was move the old sats into a new wallet, because I needed to input the seed words online, and it's always good to minimize the risk in case I messed something up. Sent and done.
Step 2.
I then followed here
a. Enter the following commands in the Electrum console and press enter on your keyboard.
wallet.change_gap_limit(100)
b. Restart and check.
wallet.gap_limit
>>> 20
c. Strange, so I tried again; patience you MUST have!
wallet.change_gap_limit(100)
d. Restart and check again.
wallet.gap_limit
>>> 100
Vola! and then the wallet magically showed the same balance in Electrum as in the BTCpay, it was showing the old balance before ( without the new tx ) , but now it's synced!
Step 3.
I sent all the sats to a new wallet because after inputting the seeds online, the old wallet had served its purpose.
Step 4.
I configured a new master key into BTCpay and wrote down this fun experience to share!

⚑️ Takeaways

  • Addresses created within the same seeds are unlimited.
Honestly, I don't think people need to have many wallets. Keeping things simple and learning how to master them is the way - the fact that only 12 seed words can create unlimited addresses blows my mind!
  • Freedom is indeed not free.
You need to troubleshoot your own problems and have no one to call or cry on in the Bitcoinlandia! But it's really rewarding and satisfying, you just need to stay calm and enjoy the learning, and be patient.
  • Problems can be good learning opportunities, embrace them!
Given that we are still at the early stage of Bitcoin and the majority of people would rather buy ETFs than self-custody Bitcoin themselves, that gives real Bitcoiners many good advantages to test and learn more.
Solving problems is like exercise - the more you solve or have been through, the stronger you are, and the more you learn:)

Footnotes

  1. It turned out that is something called the gap limit problem. ↩
  2. BTCPay Server uses a derivation scheme to represent the destination of the funds received by your invoices. The destination of those funds will be your wallet, located by the extended public key that you provide. ↩
  3. BTCPay Server supports yPub and zPub formats. Please note that these will be converted to xPub once the wallet setup is completed. This has no effect on how you receive or send funds. ↩
470 sats \ 1 reply \ @DarthCoin 1 Feb
I so glad you figure it out and also learned new things! This is the spirit of a real bitcoiner. Very good follow up guide ! Well done. I hope others will learn from this experience.
I was quite freaked out when you told me on PM that "your btcpay could be hacked".
reply
I was quite freaked out when you told me on PM that "your btcpay could be hacked".
hahha, because many details didn't make sense. 🀯 but now they do!
reply
I learned the footnotes thanks to @ekzyis πŸ€“
and it turned out that there are so many cool things in Markedown to play around too.
  1. showing red is with ``
2. code is with ```
  1. footnote is with this. 1

Footnotes

  1. dis ↩
reply
614 sats \ 1 reply \ @kepford 1 Feb
Another excellent post @Natalia. Thank you for sharing what you learned.
reply
run a lightning node because of how highly I value sovereignty as well as the knowledge I'm gaining from the experience.
I like how you said it here - learning opportunities can be created!
reply
It's hard communicating such things on the wallet side too. Would be painful to always try syncing hundreds of addresses each time the user opens the wallet.
That's why we have a resync button in our admin settings of the wallet that goes up to 150. Otherwise it's just the next 10-20 addresses, and even that's too much IMO.
reply
It's quite an interesting problem, isn't it? and not many people talked about it, that's why I shared all the things that I tried:)
But the good thing is that not too hard to solve it as a user - a bit of a hassle, but it's doable.
reply
Great! You had already mentioned this in the saloon yesterday. This is a critical issue that everyone should be aware of. I was already familiar with the concept of deviation paths (#316839), but I didn't know that Electrum had this feature (gap_limit). When I started making on-chain transactions, I was hesitant to use other addresses because some wallets don't even identify addresses based on the deviation path.
reply
reply
The more you learn, the more you realize you don't know anything. Keep doing what you're doing, especially sharing your knowledge with others.
reply
I will keep doing experiments. 🫑
more doing = more learning = more sharing
reply
= more stack = more sats 🀠
reply
you got my secret hack! πŸ•΅πŸΌ
more doing = more learning = more sharing = more sats
reply
reply
207 sats \ 3 replies \ @go 1 Feb
Why don't you use the built-in wallet for BTCPay?
reply
good question, because πŸ‘€
  1. I'm using a third-party hosting - voltage
You are not an admin on this server. While you are able to import or generate a wallet via seed with your account, please understand that you are trusting the server admins not just with your privacy but also with trivial access to your funds.
I could have used my Umbrel node for it, but it is too much hassle, and I'm traveling around sometimes and can't make sure my node is online 24/7.
  1. The built-in wallet is hot wallet by default, but by using an external wallet, I can easily set up a cold wallet myself or change it anytime when I feel like it.
  2. Diversification - I try to avoid depending on the same service too much; if something goes wrong, then it would be easier for me to identify the problem; In this case, I could tell there was something wrong with my external wallet.
reply
33 sats \ 1 reply \ @go 1 Feb
Thank you. I'm setting a website up and was wrestling through your post(s) and appreciate the time you've taken to broadcast your process
reply
glad to be helpful - for me it's also learning more by sharing:)
reply
Thanks. I got a question from a friend the other day whether Bitcoin is for masses or geeks. It’s still for geeks at this point! Such things can’t happen.
reply
It’s still for geeks at this point!
2010 β€” No one uses it. 2012 β€” Only computer nerds use it. 2013 β€” Only drug dealers use it. 2014 β€” Only money launderers use it. 2017 β€” Only gamblers use it. 2019 β€” Only a small percentage of the population uses it. 2020 β€” Only small companies use it. 2021 β€” Only small countries use it. 2024 β€” Only ETF issuers use it.
It’s still for geeks at this point!
but the good news is that I don't have any tech background; what I do is I try to minimize the risk with small tests until I feel comfortable and know what I am doing, and keep learning and leveling up. πŸ‘€
Having to increase gap limit is such an annoying bug. WalletWasabi has this issue too at times and it is GARBAGE UX that a user should EVER have to change hidden config files to regain basic functionality.
reply
Some people have had similar problems. A great place for these kind of questions is https://Bitcointalk.org. People will really take the time to try to understand your problem.
Check out this thread. There are some similarities. ;-)
reply