Bitcoin Forum
May 13, 2024, 11:04:20 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Electrum 4.0.9 wallet sync problem  (Read 71 times)
k9electrum (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 3


View Profile
April 08, 2021, 06:51:41 AM
Merited by hugeblack (2)
 #1

Hi, I have a wallet file (lets say Wallet A) and I use the master public key of Wallet A to create a watch-only wallet file (lets say wallet B).

I try to load wallet B in daemon and create some new addresses of wallet B by electrum command 'createnewaddress', and addresses created can be found in 'listaddresses' in Wallet B.
However, those addresses newly created cannot be found in Wallet A. Is there any way to synchronize Wallet A with the newly created addresses? Thanks.
According to NIST and ECRYPT II, the cryptographic algorithms used in Bitcoin are expected to be strong until at least 2030. (After that, it will not be too difficult to transition to different algorithms.)
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715641460
Hero Member
*
Offline Offline

Posts: 1715641460

View Profile Personal Message (Offline)

Ignore
1715641460
Reply with quote  #2

1715641460
Report to moderator
NeuroticFish
Legendary
*
Offline Offline

Activity: 3668
Merit: 6394


Looking for campaign manager? Contact icopress!


View Profile
April 08, 2021, 07:18:18 AM
 #2

Did you by chance created multiple addresses like this and they're all unfunded?
Because you may have passed the default gap limit and all you may have to do is to increase that.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5601


Self-proclaimed Genius


View Profile
April 08, 2021, 07:22:13 AM
 #3

It didn't synchronize because Electrum will only generate addresses beyond the "gap limit" if the last address was already used.
In your case, the new address created in wallet B using createnewaddress is the 21st in the address index.
That command will produce a new receiving addresses that's not in the already-generated 20.

If you need to receive bitcoins, use add_request "amount" instead and that will return with an unused address within the gap limit.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
k9electrum (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 3


View Profile
April 08, 2021, 07:24:22 AM
 #4

I have changed the gap limit of Wallet B only. But this change does not reflect on Wallet A too. Do I need to also manually change the gap limit of Wallet A?
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4186



View Profile
April 08, 2021, 07:27:00 AM
 #5

I have changed the gap limit of Wallet B only. But this change does not reflect on Wallet A too. Do I need to also manually change the gap limit of Wallet A?
Yes. If you don't change the gap limit, it won't be shown in wallet A.

Rule of the thumb is that as long as the addresses in Wallet B are also in Wallet A, any subsequent addresses generated will not deviate as well. I'm not sure how the gap limit of the offline wallet would work since it technically won't know which addresses aren't used?

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5601


Self-proclaimed Genius


View Profile
April 08, 2021, 07:33:09 AM
 #6

I have changed the gap limit of Wallet B only. But this change does not reflect on Wallet A too. Do I need to also manually change the gap limit of Wallet A?
Are both wallets online? If both wallets are online, then you don't need to increase both wallets' gap limits.
They'll both produce more addresses if needed as long as you're not skipping some addresses unused, use the command in my first reply to get an unused address.

If A is offline, you'll need to manually produce the addresses but since it's offline, I can't see any reason to synchronize its addresses list since it'll be able to sign transactions for walletB anyways.

What's your use-case BTW?

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NeuroticFish
Legendary
*
Offline Offline

Activity: 3668
Merit: 6394


Looking for campaign manager? Contact icopress!


View Profile
April 08, 2021, 07:40:31 AM
Merited by hugeblack (2)
 #7

From the topic title, I think that OP may be (wrongly) thinking that the wallets will sync between each other.

OP: maybe you would be nice and tell the actual setup (what is offline and what is online) and what you want to actually achieve.
(For example, if you want to make a merchant solution and you expect to generate huge number of addresses, Electrum may not be your best option.)

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
k9electrum (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 3


View Profile
April 08, 2021, 08:09:19 AM
 #8

Quote
Are both wallets online? If both wallets are online, then you don't need to increase both wallets' gap limits.
Wallet A is offline in my program. In actual case, I will not have the right to make any transaction from Wallet A in my role. Therefore I get a watch-only Wallet B.

Quote
From the topic title, I think that OP may be (wrongly) thinking that the wallets will sync between each other.
Yes I do think that the wallets will sync between each other.

In my case, I need to generate some addresses for a number of users (which is greater than default number 20). My program also subscribe to those addresses for notifying when bitcoins are transferred to those addresses. Therefore get an unused address from Electrum may not be a good solution to me in current approach as some addresses may remain unused at last.

Actually I understand that Electrum may not be a good choice to handle a huge number of addresses. But in this situation if someone having rights is going to make transaction from Wallet A, the gap limit of wallet A is required to be changed as the same as Wallet B first in order to take the correct balance? 
NeuroticFish
Legendary
*
Offline Offline

Activity: 3668
Merit: 6394


Looking for campaign manager? Contact icopress!


View Profile
April 08, 2021, 08:29:55 AM
 #9

Yes I do think that the wallets will sync between each other.

They don't sync with each other. They are independent entities. Any of them, and only if it's online, syncs with the Electrum servers (which are sync-ed with the blockchain).
Since the watch only wallet has the master public key, it can hold the same addresses as the offline wallet, but only the online wallet will know what happens on the blockchain.
And the offline wallet needs help (gap limit) to enlarge the number of addresses it sees, but that's actually not necessary, since it'll remain offline anyway, and, as @nc50lc said, the offline wallet can sign the transactions anyway. And that's the only use (besides security) for the offline wallet.

In my case, I need to generate some addresses for a number of users (which is greater than default number 20). My program also subscribe to those addresses for notifying when bitcoins are transferred to those addresses. Therefore get an unused address from Electrum may not be a good solution to me in current approach as some addresses may remain unused at last.

Actually I understand that Electrum may not be a good choice to handle a huge number of addresses. But in this situation if someone having rights is going to make transaction from Wallet A, the gap limit of wallet A is required to be changed as the same as Wallet B first in order to take the correct balance?  

The offline wallet will not know the updates in balances / incoming-outgoing transactions. Since it's offline, it doesn't receive that information from the Electrum server.
The offline wallet is only good for signing transactions (i.e. spend), and those transactions have to be made with the online wallet (which is the only one that knows the correct transactions/balances/inputs)


If you only want to notify users, the online watch-only wallet should do most of the job: see the incoming transactions, notify the users. The offline wallet is still useful for security and signing.
But if you plan big number of addresses, you'll have to go with Bitcoin Core.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
hugeblack
Legendary
*
Offline Offline

Activity: 2506
Merit: 3652


Buy/Sell crypto at BestChange


View Profile WWW
April 08, 2021, 08:52:33 AM
Merited by NeuroticFish (1)
 #10

Actually I understand that Electrum may not be a good choice to handle a huge number of addresses. But in this situation if someone having rights is going to make transaction from Wallet A, the gap limit of wallet A is required to be changed as the same as Wallet B first in order to take the correct balance? 
B wallet is nothing but a representation of A wallet without the risk of having a private key if both wallets are synchronized (connected to the Internet) then there is no point in creating B wallet.

You can use btcpayserver[1] if you want to receive notifications and you can also increase the gap limit (assuming you intend to do something related to creating a website or payment interface.

[1] https://docs.btcpayserver.org/ElectrumWallet/

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4186



View Profile
April 08, 2021, 09:16:17 AM
 #11

Actually I understand that Electrum may not be a good choice to handle a huge number of addresses. But in this situation if someone having rights is going to make transaction from Wallet A, the gap limit of wallet A is required to be changed as the same as Wallet B first in order to take the correct balance? 
Balance in Wallet A will never be updated. The sole purpose of Wallet A is to sign the transaction and nothing else. Wallet B has to have the correct information and you will be able to have it since that is the wallet that is able to craft the transaction to be signed in Wallet A.

It really wouldn't matter if the addresses doesn't appear in both wallets, if the corresponding master private key is in Wallet A, the addresses generated will never deviate. The wallet will also be able to tell which private keys to generate and sign as the PSBT generated by Electrum shows the full derivation path so the gap limit is not an issue at all.


Code:
{
-snip-
            "value": -snip-,
            "n": 1,
            "scriptPubKey": {
              "asm": "-snip-",
              "hex": "-snip-",
              "reqSigs": 1,
              "type": "witness_v0_keyhash",
              "addresses": [
                "-snip-"
              ]
            }
          }
        ]
      },
      "bip32_derivs": [
        {
          "pubkey": "-snip-",
          "master_fingerprint": "-snip-",
          "path": "m/0'/1/0"
        }
-snip-

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!