wallet gets damaged

+2 votes

Dear tech team,

I'm developing an application with MC and I wish to delivery my customer a cold wallet saved in crypto hw usb. My customer uses the crypto usb opening it and running the cold wallet so that my application can access the wallet through a socket in order to get new addresses, signing and so on.

Everything works fine but the crypto key has a timeout so that after a while it locks the hw. In such case when I try to open the wallet I got the following issue:

corruption: checksum mismatch

I try to run the wallet with -reindex=1 option but it doesn't solve so I have to install it again.

Unfortunately I can't disable the lock timeout of the crypto key and it is a security feature my customer ask.

Can you suggest a way out?

Thanks for your support

asked Nov 5, 2019 by fabio

1 Answer

0 votes
If I understand correctly, you are saying that some third party USB hardware key, designed for cryptocurrencies, is locking itself after a period of time, so it cannot be queried for some private key? If I understood correctly, surely the solution is on the USB hardware key, and not something that we can help with? Or did I misunderstand?
answered Nov 5, 2019 by MultiChain
Dear team,
I will add more clear details about it. The USB key is not designed for cryptocurrencies, it is a general one, you can save standard file on it but it lock after a time-out in case the user does nothing on his laptop.

Of course it is acceptable that I can't query multichain wallet stored in it when the usb key is locked.
The issue is that the wallet can be damaged.
In my code when I poll the socket, I explicity close the connection:

 headers = {'content-type': "text/plain",
                   'accept': "application/json",
                   'Connection': "close"

I got the same issue when pulling out the usb from the laptop without stopping the wallet.

Is there any setting I could use in order to solve it?
I want to try to lock the wallet immediately after the usage, I will keep you posted about it

[update 2019-11-06]

locking the wallet doesn't help.
So here is the procedure to reproduce my issue:
- insert USB key
- start the wallet with the following:
  multichaind-cold <your MC name> -reindex=1
- remove USB without stopping the server

- insert again USB
- start the wallet with the following:
  multichaind-cold <your MC name> -reindex=1

- I got the following message:

MultiChain 2.0.1 Offline Daemon (latest protocol 20009)

Corruption: checksum mismatch
In general, you cannot run MultiChain in a situation where any of the files that it manages internally can no longer be read or modified. So if you want to store private keys on a USB device that locks, you should manage them yourself, rather than having MultiChain's directory there. For example you can use the createkeypairs API to generate a key pair, add its address to the node using importaddress, and then manage the private key in your own way.