Export/import wallet

+1 vote


I'm trying to export a node's wallet & to import it on another, freshly stated node. I'm performing these steps described in the documentation:

1) Export wallet using the backupwallet function
2) Import the wallet on the new node using importwallet
3) Restart the new node to ensure the wallet is loaded properly

Now, if I use the command listaddresses on the new node no addresses have been added.

Am I missing something or is the backup/import wallet function not working correctly?

asked Dec 23, 2021 by mtn

1 Answer

0 votes

The command pair you need is dumpwallet and importwalletbackupwallet does something different.

answered Dec 23, 2021 by MultiChain
Thank you for your fast reply.
I've tried your solution but I'm still facing some problems.

My setup: Multichain 2.1.2 running in a Docker container

The steps to export the wallet
1) Start Docker-Container
2)create an example chain
3)export the wallet using the dumpwallet command
4) copy the wallet from the container to the host

The steps above work fine. I can see the exported addresses on the host machine.

Now to the export part:
1) Start a fresh Docker-Container
2) Create a fresh demo chain
3) Copy the exported wallet file inside the container
4) Import the exported wallet via  importwallet

Now in theory I should be able to see the old address of the backuped wallet via getaddresses right? Unfortunately, this is not the case. Is there something I missed?
I believe the problem here is that each chain has its own address space, to prevent cross-chain mistakes. So if you try to export/import addresses between chains, the addresses will appear differently. If you want to preserve addresses across chains, you need to ensure these parameters in the second blockchain match those in the first, before starting the chain up:


More details here: https://www.multichain.com/developers/address-key-format/