Modified on: Sun, 4 Mar, 2018 at 5:49 PM

BIP38 is a way to protect a private key using encryption. You are probably already familiar with encrypting your wallet.dat file. This is the same concept, but the encryption applies to the private key instead of the entire wallet file, which holds many private keys. The end result is a string of characters that requires the passphrase to decrypt. Some use cases for BIP38 are:





A more secure form of paper wallet

Extra security when handling private keys because otherwise dumpprivkey outputs the plaintext key













GUI

Encrypting the Key



On your wallet that currently holds the address and private key, you will need to open up your PIVX Core wallet Go to Settings > BIP38 Tool A dialog box will appear that prompts you for the address and passphrase you want to encrypt it with. Complete these prompts and click Encrypt at the bottom left. Note that the passphrase can't include symbols or spaces If you have not fully unlocked your wallet, you will be prompted to do so. "For anonymization and staking" is not sufficient for this operation After some time, the encryption will complete and display the BIP38 encrypted form of your address's private key Remember to relock your wallet and then if needed for staking unlock it 'for anonymization and staking only'





Decrypting the Key (optional)

On your wallet that currently holds the address and private key, you will need to open up your PIVX Core wallet Go to Settings > BIP38 Tool Navigate to the Decrypt tab A dialog box will appear that prompts you for the address and passphrase you want to decrypt it with. Complete these prompts and click Decrypt at the bottom left. If you have not fully unlocked your wallet, you will be prompted to do so. "For anonymization and staking" is not sufficient for this operation After some time, the decryption will complete Remember to relock your wallet and then if needed for staking unlock it 'for anonymization and staking only'













Command Line

Encrypting the Key

For this operation we will need to fully unlock the wallet with the command below. If you don't do this step you will get the message: error: {"code":-13,"message":"Error: Please enter the wallet passphrase with walletpassphrase first."}

pivx-cli walletpassphrase YOURSECURESECRETPASSWORD 0 false Now, we will use the command bip38encrypt. You will need to provide the address and passphrase for encryption. You can get your addresses with the listaddressgroupings command

pivx-cli bip38encrypt addressToBeEncrypted passphraseToEncryptItWith Your BIP38 encrypted form of the address's private key will be displayed Remember to relock your wallet and then if needed for staking unlock it 'for anonymization and staking only'





Decrypting the Key (optional)

For this operation we will need to fully unlock the wallet with the command below. If you don't do this step you will get the message: error: {"code":-13,"message":"Error: Please enter the wallet passphrase with walletpassphrase first."}

pivx-cli walletpassphrase YOURSECURESECRETPASSWORD 0 false Now, we will use the command bip38encrypt. You will need to provide the address and passphrase for encryption. You can get your addresses with the listaddressgroupings command

pivx-cli bip38decrypt addressToBeDecrypted passphraseToDecryptItWith After some time the decryption will be complete and your address and the private key will be displayed Remember to relock your wallet and then if needed for staking unlock it 'for anonymization and staking only'















