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

clamd won't let me import two encrypted bitcoin wallets #216

Open
dooglus opened this issue Aug 22, 2015 · 2 comments
Open

clamd won't let me import two encrypted bitcoin wallets #216

dooglus opened this issue Aug 22, 2015 · 2 comments
Labels

Comments

@dooglus
Copy link
Collaborator

dooglus commented Aug 22, 2015

I have 2 test wallets, both encrypted, with different passwords. Whichever one I import first works, but the other one doesn't:

$ clamd importwallet ~/.bitcoin/wallet.dat.tmp.password.fred 'fred' false
$ clamd importwallet ~/.bitcoin/wallet.dat.tmp.password.fred.fred 'fred fred' false
error: {"code":-14,"message":"Error: The wallet passphrase entered was incorrect for the wallet you are attempting to import."}
$ clamd stop
Clam server stopping
$ clamd
Clam server starting
$ clamd importwallet ~/.bitcoin/wallet.dat.tmp.password.fred.fred 'fred fred' false
$ clamd importwallet ~/.bitcoin/wallet.dat.tmp.password.fred 'fred' false
error: {"code":-14,"message":"Error: The wallet passphrase entered was incorrect for the wallet you are attempting to import."}

I restarted the daemon and it changed its mind about which one had the "incorrect passphrase"...

@dooglus
Copy link
Collaborator Author

dooglus commented Aug 22, 2015

I've been attempting to find the cause of this bug, but didn't make much progress yet.

ReadKeyValueImport() In walletdb.cpp is running this line:

pwallet->mapMasterKeys[nID] = kMasterKey;

for each wallet I import, but the kMasterKey always has the same value for the nDeriveIterations member; the value is the nDeriveIterations for whichever wallet I import first.

@dooglus
Copy link
Collaborator Author

dooglus commented Aug 22, 2015

One of the two wallets I'm testing with was created by copying the other wallet and then changing its passphrase.

I just tried creating two new wallets from scratch and encrypting them separately, and am able to import them both into a single clamd session.

Could the problem be that the first pair of wallets have the same salt?

kMasterKey nDeriveIterations 190170 crypted 6c6059465da8360bb951517dc33e397ac70eafcc1b554ad40ed53da2f203e9d211b3e4590d460dc7c74b3754069a301e salt e64cdd95073b1f70
kMasterKey nDeriveIterations 218307 crypted b5dbeb28c9e4dd8700a82c2457fe31c8f8acc300f763191c7d278e6cd6c268d09d0a9d8b14aa2aa510bfb6ccb9723be7 salt e64cdd95073b1f70

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

2 participants