Best way to import Private Key

Naushad Ahmed
2 min readApr 24, 2021

The command to import private key is
importprivkey <Private_key> <“Label”> <rescan>
Label is optional and rescan is boolean (true/false) is also optional.

The simple way to import a private key is write in the console window
importprivkey <Private_key>
e.g. importprivkey TBbVvQ8u1QEz8dtoKcs4s1m5Ra69ziJWvbMkZBLxFFyqJQCRMUKQ

If you want to add a label to the importing address then name it with invited comas e.g.
importprivkey TBbVvQ8u1QEz8dtoKcs4s1m5Ra69ziJWvbMkZBLxFFyqJQCRMUKQ "Giveaway address"

It will rescan the whole chain and it will take some time. But, if you want to import the key quickly and you know that your address holds only few transactions, let suppose it has 3 transactions in block height 2350578, 2350612 and 2350640. You can check your transactions in block explorer.

Then first write
importprivkey TBbVvQ8u1QEz8dtoKcs4s1m5Ra69ziJWvbMkZBLxFFyqJQCRMUKQ "Giveaway address" false

It will import the private key but will not scan the whole chain. Then write in the console window the following to rescan the chain from block 2350578 to 2350640.
rescanblockchain 2350578 2350640

Now, your wallet will show the balance of imported address. When you import a private key, you import all three type of addresses assigned with that private key. They are Legacy, SegWit and Beach32. You can use these addresses separately, all addresses will have their individual balances. You can see your imported addresses by click on File > Receiving addresses

Syntax of rescan is
rescanblockchain <“start_height”> <“stop_height”>
So, if the address holds only one transaction, let say at block 2350561 then you can write any block number after 2350561, e.g. you can write like this
rescanblockchain 2350561 2350562

LCC Website: https://litecoinca.sh
LCC Discord: https://discord.gg/3AnFpvy
LCC Twitter: https://twitter.com/LitecoinCash

LCC tipping address: lcc1q248637da5dx6yh3c9n6h5gtsa4xgm27med23px

--

--