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

  1. On your wallet that currently holds the address and private key, you will need to open up your PIVX Core wallet
  2. Go to Settings > BIP38 Tool
  3. 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
  4. 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
  5. After some time, the encryption will complete and display the BIP38 encrypted form of your address's private key
  6. Remember to relock your wallet and then if needed for staking unlock it 'for anonymization and staking only'


Decrypting the Key (optional)

  1. On your wallet that currently holds the address and private key, you will need to open up your PIVX Core wallet
  2. Go to Settings > BIP38 Tool
  3. Navigate to the Decrypt tab
  4. 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.
  5. 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
  6. After some time, the decryption will complete
  7. Remember to relock your wallet and then if needed for staking unlock it 'for anonymization and staking only'




Command Line

Encrypting the Key

  1. 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
  2. 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
  3. Your BIP38 encrypted form of the address's private key will be displayed
  4. Remember to relock your wallet and then if needed for staking unlock it 'for anonymization and staking only'


Decrypting the Key (optional)

  1. 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
  2. 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
  3. After some time the decryption will be complete and your address and the private key will be displayed
  4. Remember to relock your wallet and then if needed for staking unlock it 'for anonymization and staking only'