CounterpartyXCP / counterwallet

Counterparty web wallet
https://counterwallet.io
147 stars 162 forks source link

Funded Addresses Hidden #799

Open ghost opened 7 years ago

ghost commented 7 years ago

I used the counterwallet tool from blockscan to look through old wallets out of curiosity. When I open them in Counterwallet there are many addresses missing it seems - I found at least $300 that was not visible. Quite a shock tbh.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/38809688-funded-addresses-hidden?utm_campaign=plugin&utm_content=tracker%2F542579&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F542579&utm_medium=issues&utm_source=github).
unsystemizer commented 7 years ago

It's the old "my address is missing" problem and a known workaround is to manually add addresses in CW. I am on tablet so I won't search now but I think this issue exists and is still open. Edit: I looked, that issue is not open any more. Were you able to add regular addresses in CW to display those addresses?

ghost commented 7 years ago

I was able to add regular addresses in CW, which displayed some. How can I be entirely sure that all have been listed? If I, theoretically reach the max {50?} I assume it will be always the same ones? The way I understand it, infinite address could be generated from the seed? One of my wallets even displayed the dialog "you are opening a brand new wallet, if you see this" and then it opened... and showed used wallets with money in them.

unsystemizer commented 7 years ago

I think 22 is the max in CW (could be tested with a testnet wallet, just keep adding them till you can't).

They are always in the same order, it's deterministic. It's like a branched out tree and CW uses just one determined branch with up to N. See this:

https://counterpartytalk.org/t/only-20-addresses-show-up-in-my-counterparty-wallet/1052/30

We could expand the script that is used for address/privkey recovery, to get the first 22 and then check balance for all of them. That would make it possible to get it done quickly. Even better would be to fix this bug.

unsystemizer commented 6 years ago

A bit more on this: a) Today I logged in and spotted that some addresses were missing (not the first 3, but the rest) b) I thought this is a great chance to debug this, so I turned on Dev Tools in my browser and started to add new addresses in the wallet. After I reached the first empty address, I saved the log.

But I didn't turn on verbose debugging, so it turns out it was completely useless... I used the current version of Counterwallet on the main counterwallet.io site.

image

jQuery.jqlog.entryDefaults.level = jQuery.jqlog.levels.debug;
jQuery.jqlog.targets.console = jQuery.extend({}, jQuery.jqlog.targetDefaults, {
    name: "console",
    version: "1.3",
    log: function(b) {
        var a = b.format();
        if (window.console)
            switch (b.level) {
            case jQuery.jqlog.levels.info:
                console.info(a);
                break;
            case jQuery.jqlog.levels.warn:
                console.warn(a);
                break;
            case jQuery.jqlog.levels.error:
                console.error(a);
                break;
            default:
                console.log(a)
            }

Lesson for Next Time