BitShares Forum

Main => General Discussion => Topic started by: bytemaster on September 01, 2014, 07:21:19 pm

Title: BTS Wallet Best Practices and Danger Areas
Post by: bytemaster on September 01, 2014, 07:21:19 pm
Many users have been reporting bugs where balances appear to go missing or orders they cannot cancel.   We are working on solutions to increase the robustness of the wallet in all use cases, but for now most wallet problems are the result of the wallet being used in an "unsupported" manner. 

1) Do not use the same wallet on two computers.
  - If you do this the deterministic key generation will get out of sync.  This can result in missing balances and/or orders using the same key and thus difficult to cancel.  We are enhancing the wallet to be able to handle this more gracefully.   That said, one wallets will not be able to see the receiver of outgoing transactions sent from the other wallet.   

2) Do not attempt to restore from an "old backup"
 -  While technically the purpose of a backup is to prevent you from losing funds, the backups at this point in time are there to allow *future versions* to have a hope at recovering all of your funds.  Backups are generated automatically every time you upgrade the wallet.   When you upgrade only use the "most recent" backup.   Generally speaking you shouldn't ever have to dive into a backup file that is older than your last transaction.  While future versions may allow you to recover all of your funds, your transaction history may never quite recover all of the data you may want. 

3) Do not attempt to use more than one "account" per wallet if you want to be able to easily recover from a backup
  - Based upon the current wallet code, if you use more than one account and attempt to recover keys it will not be able to allocate market orders back to the original account.  You will be able to recover the funds/orders to one of your accounts but it may not be the same account as the original order.

Prior to version 0.4.10 of BTSX, the one time keys used to send funds to someone else were not deterministically generated.  If you attempt to recover from an old backup you will not be able to read the memo or destination account for these funds.  You will still see that it came out of your account.    0.4.10 and later generate the one time keys deterministically which will allow the wallet to brute force determine who the funds went to.   

The moral of the story is this (for average users):

1) Use a wallet on only one computer
2) Only use one account per wallet
3) Backup regularly
4) Don't attempt an import from an "old" backup.

Once the various bugs are fixed these things will become easier to use and your wallet will be less likely to end up in an odd state.
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: soniq on September 01, 2014, 07:25:01 pm
Sticky please!!
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: bitmeat on September 01, 2014, 07:41:18 pm
But people who backed up their wallets prior to 0.4.10 should still be able to recover at some point, right?

I literally had no other way of getting back on track. When installing new software kept crashing with the old data, I wiped the data folder and imported the old JSON wallet with fresh blockchain data. Heck even that was crashing for a few versions. Finally in 0.4.10 it is somewhat back on track.

With the exception of a few orders probably imported from the old wallet that I can't seem to be able to cancel due to "invalid order type"
(details already sent, BM is looking at it)
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: ripplexiaoshan on September 01, 2014, 07:46:44 pm
Very helpful tips.  +5%
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: xeroc on September 01, 2014, 09:03:12 pm
In the meantime .. if you lost funds, you can try this:
http://wiki.bitshares.org/index.php/RecoveringFunds
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: bytemaster on September 01, 2014, 09:13:40 pm
But people who backed up their wallets prior to 0.4.10 should still be able to recover at some point, right?

I literally had no other way of getting back on track. When installing new software kept crashing with the old data, I wiped the data folder and imported the old JSON wallet with fresh blockchain data. Heck even that was crashing for a few versions. Finally in 0.4.10 it is somewhat back on track.

With the exception of a few orders probably imported from the old wallet that I can't seem to be able to cancel due to "invalid order type"
(details already sent, BM is looking at it)

Yes if you wallet was backed up at any point in time we are working on solutions for a full restore.  These best practices are mainly to help prevent problems before the occur.
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: cass on September 01, 2014, 09:20:32 pm
ok and best practise if i'm using more than one account? What can i do to backup etc... ? Or no way to do so yet?
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: bytemaster on September 01, 2014, 09:45:17 pm
ok and best practise if i'm using more than one account? What can i do to backup etc... ? Or no way to do so yet?

If you are using more than one account (I am) then just make sure you restore from a recent backup and that you backup regularly. 
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: cass on September 01, 2014, 10:52:40 pm
ok and best practise if i'm using more than one account? What can i do to backup etc... ? Or no way to do so yet?

If you are using more than one account (I am) then just make sure you restore from a recent backup and that you backup regularly.

ok :) thx
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: Xeldal on September 02, 2014, 01:06:55 am

I've done all of those things

1) I've had private keys for all accounts from a very early release, loaded on multiple computers. Though I've never 'loaded' a backup to more than 1 computer. so maybe that doesn't count
2) I've loaded from an older backup.
3) my wallet has 11 accounts

I've had balance issues for a long time. no problem. Today I'm missing a more sizable portion so I'm looking for reassurance.

I want to know if there's anything I might do that would guarantee I would NOT find the missing balance?
(assuming I maintain the original private keys)

I have backups from various dates/versions.

I don't care about transaction details/memo etc, just the balance.

I've followed the recovery steps in:  http://wiki.bitshares.org/index.php/RecoveringFunds
No dice, yet.

Basically everything from genesis is gone.  All I can see is what I've moved from BTER

(I don't mean to turn this into my support thread. I'm content to wait. Just the one question is relevant)
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: mtang on September 02, 2014, 01:17:58 am
Trying to keep this in mind and let more chinese user know.
 +5% +5%
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: merockstar on September 02, 2014, 03:02:23 pm
3) Do not attempt to use more than one "account" per wallet if you want to be able to easily recover from a backup
  - Based upon the current wallet code, if you use more than one account and attempt to recover keys it will not be able to allocate market orders back to the original account.  You will be able to recover the funds/orders to one of your accounts but it may not be the same account as the original order.

I have 8 accounts on the same wallet :(

Should I follow puppie's tutorial in another thread to create a wallet backup with only my main account?

If I don't care what account the funds get recovered to, only that the funds are there, am I good to go with my current wallet backed up as is (with 8 accounts)?

How important is this step?
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: bytemaster on September 02, 2014, 03:04:47 pm
3) Do not attempt to use more than one "account" per wallet if you want to be able to easily recover from a backup
  - Based upon the current wallet code, if you use more than one account and attempt to recover keys it will not be able to allocate market orders back to the original account.  You will be able to recover the funds/orders to one of your accounts but it may not be the same account as the original order.

I have 8 accounts on the same wallet :(

Should I follow puppie's tutorial in another thread to create a wallet backup with only my main account?

If I don't care what account the funds get recovered to, only that the funds are there, am I good to go with my current wallet backed up as is (with 8 accounts)?

How important is this step?

You are good as long as you backup.  You will not lose funds in any event.  If you don't play with the market you are also OK. 
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: patrickb323 on September 04, 2014, 07:51:21 pm

Instead of using multiple accounts,  I swap between 2 wallets on the same install.  I do this by renaming APP_DATA/config.json file and APP_DATA/wallets/ folder and swap wallets in/out as I wish.

Is this dangerous?  seems to work for me.
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: bytemaster on September 04, 2014, 07:54:22 pm

Instead of using multiple accounts,  I swap between 2 wallets on the same install.  I do this by renaming APP_DATA/config.json file and APP_DATA/wallets/ folder and swap wallets in/out as I wish.

Is this dangerous?  seems to work for me.

Should work just fine, but of course is unsupported. 
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: bytemaster on September 04, 2014, 07:54:51 pm
As of 0.4.12 multiple accounts have independent deterministic key sequences so that is less of an issue.
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: tonyk on September 04, 2014, 08:10:25 pm

Instead of using multiple accounts,  I swap between 2 wallets on the same install.  I do this by renaming APP_DATA/config.json file and APP_DATA/wallets/ folder and swap wallets in/out as I wish.

Is this dangerous?  seems to work for me.
Hm, I just import the wallet I want using the GUI menu, and keep 2 backups.
 [there was a bug where you can not save with the same named backup, so I kept walletA{1,2....20} and walletB{1,2....20}]
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: xeroc on September 04, 2014, 09:15:08 pm
As of 0.4.12 multiple accounts have independent deterministic key sequences so that is less of an issue.
could you elaborate this in more detail? I thought account address have been derived from the account key from the start?

Further, I currently don't get how transaction (in particular the addresses) for market orders are built .. could you also drop some short explanation about those too?
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: cryptillionaire on September 13, 2014, 08:43:34 pm
Do you have any similar advice for users running headless delegates on servers?
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: wackou on September 14, 2014, 10:11:35 pm
Do you have any similar advice for users running headless delegates on servers?
+5%

I run the delegate on a linux vps, but when I need to upgrade I switch to my laptop for producing blocks while recompiling on the vps (not enough RAM to recompile while running the client), so atm I have the same wallet on 2 computers. Is there a way to export the keys from one to the other so as to have a clean merged wallet? Not really a priority but it would be nice to have  :D
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: cryptillionaire on September 15, 2014, 09:30:35 am
Do you have any similar advice for users running headless delegates on servers?
+5%

I run the delegate on a linux vps, but when I need to upgrade I switch to my laptop for producing blocks while recompiling on the vps (not enough RAM to recompile while running the client), so atm I have the same wallet on 2 computers. Is there a way to export the keys from one to the other so as to have a clean merged wallet? Not really a priority but it would be nice to have  :D
Quite a good idea having a fallback wallet to produce blocks whilst upgrading the dedicated client.

I think we should produce a standardized document for all delegates to follow, kind of like a best practices when updating their delegate clients.
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: xeroc on September 15, 2014, 11:23:42 am
I think we should produce a standardized document for all delegates to follow, kind of like a best practices when updating their delegate clients.
Good idea ..
Would you be so kind and start a new wiki page and write down your stuff? I can continue and add my stuff than :)
Already have some scripts that make my life easier during updates :)
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: cryptillionaire on September 15, 2014, 05:37:32 pm
I think we should produce a standardized document for all delegates to follow, kind of like a best practices when updating their delegate clients.
Good idea ..
Would you be so kind and start a new wiki page and write down your stuff? I can continue and add my stuff than :)
Already have some scripts that make my life easier during updates :)
What do you think about the creation of a docker container for bitshares-x?
Check this guide out for bitcoin - https://medium.com/@abrkn/running-the-bitcoin-core-daemon-as-a-docker-container-7d290affa56b Think we could make our own version of this guide?

CoreOS or Project Atomic + Docker = A really good environment for hosting applications on the cloud.
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: xeroc on September 15, 2014, 05:53:44 pm
@cryptillionaire: check this out:
https://bitsharestalk.org/index.php?topic=8147.msg108162#msg108162

modprobe is Nathan, who is one of the developers @ i3
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: CLains on September 19, 2014, 09:10:49 am
Aesthetic issue: I don't like the icon for "console" - my brain flags it as a sort of typo.
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: kingslanding on September 26, 2014, 02:37:34 pm
What's the best practice to handle importing private keys from multiple btc/pts wallets?  Is it best to create a new account for each wallet or can I import them all into one account or does it matter? 

I'm using version 0.4.17 BTSX wallet.
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: chryspano on September 26, 2014, 03:15:07 pm
What's the best practice to handle importing private keys from multiple btc/pts wallets?  Is it best to create a new account for each wallet or can I import them all into one account or does it matter? 

I'm using version 0.4.17 BTSX wallet.

Just don't make too many accounts in one wallet, you will have performance issues when rescanning. I imported my ags and pts wallets in the same btsx account with no problems.
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: xeroc on September 26, 2014, 05:07:56 pm
What's the best practice to handle importing private keys from multiple btc/pts wallets?  Is it best to create a new account for each wallet or can I import them all into one account or does it matter? 

I'm using version 0.4.17 BTSX wallet.
I would recommend to create a new local account (not registered) .. import all your keys there .. and move them all to your registered account ..
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: 21xhipster on October 23, 2014, 09:55:37 pm
That is really stupid question.
I reinstalled my system. I thought that password from BitsharesX is the only thing that i need to restore wallet. Like in NXT.
Is that right that i've lost my funds and account if i didnt export my wallet before?
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: toast on October 23, 2014, 09:59:24 pm
That is really stupid question.
I reinstalled my system. I thought that password from BitsharesX is the only thing that i need to restore wallet. Like in NXT.
Is that right that i've lost my funds and account if i didnt export my wallet before?

That's right, the password is just for encryption and it is not a brain wallet =(
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: speedy on October 31, 2014, 04:26:08 am
I created backups when I first created my wallet, and since then ive done a few transactions but I havent backed up again. Before reading this thread I just assumed that BitShares would be as simple to backup as an Electrum wallet.

Is it always going to be as difficult to backup as this, or is it just the early nature of the software ?

My computer with the wallet on just had its power unit die. If I want to safely move the wallet to a new computer, would it be ok to move the wallet folder to the new machine, and backup from there ?
Title: Re: BTSX Wallet Best Practices and Danger Areas
Post by: xeroc on October 31, 2014, 08:08:50 am
You should be able to access all your funds by recovering your old backup
http://wiki.bitshares.org/index.php/RecoveringFunds

However, you might loss the "metadata" (receiver, memo) of outgoing transactions ..
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: speedy on November 11, 2014, 01:25:12 am
Thanks xeroc I finally got around to restoring my old backup onto my new computer. Everything was fine after I followed that wiki.

I think that some original posts from Bytemaster cause panic and should be edited. I was playing with the market and I was still fine restoring from an old backup.
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: xeroc on November 11, 2014, 09:02:00 am
I think that some original posts from Bytemaster cause panic and should be edited. I was playing with the market and I was still fine restoring from an old backup.
Market transactions require the wallet private key which is in the backup .. but not in the private keys of the individual accounts keys ..

BM's post had the intention to make people cautious about their keys .. it's like an insurance that people not following those guidelines are considered 'advanced' users .. not regular users

Good to see your funds recovered
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: vikram on November 11, 2014, 04:44:21 pm
I think that some original posts from Bytemaster cause panic and should be edited. I was playing with the market and I was still fine restoring from an old backup.
Market transactions require the wallet private key which is in the backup .. but not in the private keys of the individual accounts keys ..

BM's post had the intention to make people cautious about their keys .. it's like an insurance that people not following those guidelines are considered 'advanced' users .. not regular users

Good to see your funds recovered

I think you know but just to make sure; this behaviour will change after the next release: https://github.com/BitShares/bitshares/issues/769
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: xeroc on November 11, 2014, 05:27:33 pm
I knew you guys are working on it ... good to see it implemeted already .. +5% for the devs .. awesome work
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: unsoindovo on November 18, 2014, 07:08:24 pm
hi!!!
windows 7 pro 64bit here..
i update the wallet and all works fine...
nothing lost...
but i get this error log

Code: [Select]
getStackTrace@app.js:26:8827
 ○ request@app.js:30:24118
 ○ get_config@app.js:29:35629
 ○ app.js:29:62715
 ○ j@app.js:6:39741
 ○ app.js:6:27204
 ○ $eval@app.js:6:48397
 ○ $digest@app.js:6:47106
 ○ $apply@app.js:6:48723
 ○ f@app.js:5:92484
 ○ r@app.js:6:4852
 ○ onreadystatechange@app.js:6:5391
10 assert_exception: Assert Exception
now >= start_timestamp:
 {}
 bitshares chain_interface.cpp:81 bts::blockchain::chain_interface::get_max_delegate_pay_per_block

 {}
 bitshares common_api_client.cpp:19 bts::rpc_stubs::common_api_client::blockchain_get_info

it is all ok???

thanks
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: vikram on November 18, 2014, 09:23:21 pm
hi!!!
windows 7 pro 64bit here..
i update the wallet and all works fine...
nothing lost...
but i get this error log

Code: [Select]
getStackTrace@app.js:26:8827
 ○ request@app.js:30:24118
 ○ get_config@app.js:29:35629
 ○ app.js:29:62715
 ○ j@app.js:6:39741
 ○ app.js:6:27204
 ○ $eval@app.js:6:48397
 ○ $digest@app.js:6:47106
 ○ $apply@app.js:6:48723
 ○ f@app.js:5:92484
 ○ r@app.js:6:4852
 ○ onreadystatechange@app.js:6:5391
10 assert_exception: Assert Exception
now >= start_timestamp:
 {}
 bitshares chain_interface.cpp:81 bts::blockchain::chain_interface::get_max_delegate_pay_per_block

 {}
 bitshares common_api_client.cpp:19 bts::rpc_stubs::common_api_client::blockchain_get_info

it is all ok???

thanks

This is okay; it does not affect anything and will be fixed in the next version.
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: unsoindovo on November 19, 2014, 06:45:59 pm
hi!!!
windows 7 pro 64bit here..
i update the wallet and all works fine...
nothing lost...
but i get this error log

Code: [Select]
getStackTrace@app.js:26:8827
 ○ request@app.js:30:24118
 ○ get_config@app.js:29:35629
 ○ app.js:29:62715
 ○ j@app.js:6:39741
 ○ app.js:6:27204
 ○ $eval@app.js:6:48397
 ○ $digest@app.js:6:47106
 ○ $apply@app.js:6:48723
 ○ f@app.js:5:92484
 ○ r@app.js:6:4852
 ○ onreadystatechange@app.js:6:5391
10 assert_exception: Assert Exception
now >= start_timestamp:
 {}
 bitshares chain_interface.cpp:81 bts::blockchain::chain_interface::get_max_delegate_pay_per_block

 {}
 bitshares common_api_client.cpp:19 bts::rpc_stubs::common_api_client::blockchain_get_info

it is all ok???

thanks

This is okay; it does not affect anything and will be fixed in the next version.

thank you Vik!!!!
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: chryspano on November 20, 2014, 04:59:43 pm
Any estimation as to when we will be able to recover wallets no matter how old they are? I forgot to backup my latest wallet and now my most recent one is 2 months old and can't recover all my funds, regenerate keys doesn't work, I think its some market orders that create the problem for me.
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: vikram on November 20, 2014, 10:49:00 pm
Any estimation as to when we will be able to recover wallets no matter how old they are? I forgot to backup my latest wallet and now my most recent one is 2 months old and can't recover all my funds, regenerate keys doesn't work, I think its some market orders that create the problem for me.

With the latest client, you might have some luck trying this: https://bitsharestalk.org/index.php?topic=9194.msg148083#msg148083
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: gn1 on November 27, 2015, 06:35:32 am
1) Do not use the same wallet on two computers.
  - If you do this the deterministic key generation will get out of sync.  This can result in missing balances and/or orders using the same key and thus difficult to cancel.  We are enhancing the wallet to be able to handle this more gracefully.   That said, one wallets will not be able to see the receiver of outgoing transactions sent from the other wallet.   

2) Do not attempt to restore from an "old backup"
 -  While technically the purpose of a backup is to prevent you from losing funds, the backups at this point in time are there to allow *future versions* to have a hope at recovering all of your funds.  Backups are generated automatically every time you upgrade the wallet.   When you upgrade only use the "most recent" backup.   Generally speaking you shouldn't ever have to dive into a backup file that is older than your last transaction.  While future versions may allow you to recover all of your funds, your transaction history may never quite recover all of the data you may want. 

3) Do not attempt to use more than one "account" per wallet if you want to be able to easily recover from a backup
  - Based upon the current wallet code, if you use more than one account and attempt to recover keys it will not be able to allocate market orders back to the original account.  You will be able to recover the funds/orders to one of your accounts but it may not be the same account as the original order.

Please let me know if these 3 golden rules are still the case for BitShares 2.0 wallet (for both Openledger and light client) or not. If it changed, can you please provide the "new" best practices?
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: xeroc on November 27, 2015, 08:35:00 am
1) and 3) are "outdated" .. you are safe to use the same wallet at different computers (though it makes protecting your account/funds more difficult) .. having several accounts is all fine

2) is someone valid still ... who knows when we see a need to integrate new features into the backup functionality ..
but at least you can be sure that with the brain key .. you can recover all accounts that you have CREATED in that wallet (not those that you have imported)
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: karnal on November 27, 2015, 08:54:57 am
How often should one backup?

Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: xeroc on November 27, 2015, 09:12:11 am
unless you have imported private keys manually .... backing up the brain key ONCE should be sufficient ..
However .. the wallet will remind you in the footer to make a new backup whenever you change something in the wallet that effects private keys
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: karnal on November 27, 2015, 11:51:35 am
I have imported keys manually (who here hasn't? the 0.9.x balances).. is it enough to back it up once after that?

As mine stands now, there's a bunch of imported but unclaimed balances, and a few claimed balances.. I backed up the wallet (the .binf ile) after importing the keys.

Are the funds safe this way?
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: karnal on November 29, 2015, 02:35:30 pm
bump
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: roadscape on November 30, 2015, 04:38:32 pm
I have imported keys manually (who here hasn't? the 0.9.x balances).. is it enough to back it up once after that?

As mine stands now, there's a bunch of imported but unclaimed balances, and a few claimed balances.. I backed up the wallet (the .binf ile) after importing the keys.

Are the funds safe this way?

AFAIK...

There is no need to create a new backup after claiming balances, because there are no TITAN keys to worry about.

If you've created a new account to claim to.. then you want to make a fresh backup.

If you have added (unclaimed) balances and want to ensure they stick around, you will want to backup.
Title: Re: BTS Wallet Best Practices and Danger Areas
Post by: xeroc on December 01, 2015, 08:48:43 pm
The wallet will automatically recommend to make new backups in the footer