Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A way to bulk generate addresses when restoring wallet. #3363

Open
Crypto2 opened this issue Feb 8, 2021 · 7 comments
Open

A way to bulk generate addresses when restoring wallet. #3363

Crypto2 opened this issue Feb 8, 2021 · 7 comments
Assignees
Labels

Comments

@Crypto2
Copy link

Crypto2 commented Feb 8, 2021

When you are restoring a wallet with the RPC there isn't a way I see to regenerate all your addresses except to POST to /addresses in an endless loop that can be hours/days long.

Would be good if there was an RPC to restore up to a specified index, and maybe when you generate an address it returns in the current index as well so that could be stored for later reference.

@DrBlast
Copy link
Member

DrBlast commented Mar 18, 2021

@Crypto2 what kind of business case do you have that you need to create about million addresses per day? Why don't you want to use one of our libs or create your own to sign and broadcast transaction using lib, not node? It could be much faster if you are using a library

@Crypto2
Copy link
Author

Crypto2 commented Mar 18, 2021

I'm not generating millions/day, I said that's how long it takes to restore a wallet if it crashes/corrupts and you have to restore from seed and you had a bunch of addresses in the wallet.

There isn't a Waves SDK in my language so I can't use one of them.

@DrBlast
Copy link
Member

DrBlast commented May 18, 2021

What language do you use? I've tried to restore addresses, it took about 10ms per address.

@Crypto2
Copy link
Author

Crypto2 commented May 19, 2021

PHP, this is over the RPC to the internal wallet. Individual addresses are fast, it's just when you have thousands+ of them it adds up to a lot of time.

For example if you had 100,000 addresses * 10 ms = 1,000,000 ms / 60,000 (1 hour) = 16.6 hours.

@DrBlast
Copy link
Member

DrBlast commented May 25, 2021

deemru wrote a lib for php: https://github.com/deemru/WavesKit

1 hour contains 3600 seconds = 3600000 ms
1,000,000 / 3600000 = 0.27

@Crypto2
Copy link
Author

Crypto2 commented May 27, 2021

That doesn't really help existing systems that use the internal wallet, versus rewriting the whole integration to use a new lib. (When we did the integration Waves was super new and nothing really existed for it yet in PHP.)

I can tell you in real-world we have ~1 million addresses and even using multiple threads it took over 24 hours to regenerate the addresses even using the sequence API that supports like 100 at a time.

@DrBlast
Copy link
Member

DrBlast commented May 31, 2021

Why don't you backup wallet.dat? You can restore file with already created addresses if smth failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants