What is a zPIV seed?

PIVX's dzPIV (deterministic zPIV) technology greatly simplifies your backup scheme.  Instead of a new backup after every mint, you can back up the seed once and you'll have a failsafe copy for all activity based on that seed in case it's ever needed.
For more information about dzPIV, see the guide here 



How to backup your seed
GUI (Graphic User Interface)

  1. If your wallet is encrypted, unlock the wallet with Settings-> Unlock Wallet. Make sure that you uncheck for staking an anonymization only
  2. Go Tools -> Debug Console -> Console
  3. Type getzpivseed
  4. Your zPIV seed will be output to the console. The seed is a 64 character hexadecimal string (256bit). It is not a mnemonic phrase. Backup this seed in a safe location, preferably offline.

CLI (Command Line Interface)

  1. Make sure your wallet is fully unlocked (not just for staking) by using the command.  On linux, use a space at the beginning so your passphrase isn't saved in your shell history
     ./pivx-cli walletpassphrase YourLongUniquePassphraseHere 0 false

  2. Use getzpivseed to output your seed string.  Store this securely and never share it because it provides access to all your current and future zPIV
    ./pivx-cli getzpivseed
    {
      "seed": "c9a39dbb0a8e15f7c7f46701984dba3e5569f748"
    }




How to restore your seed


Using the zPIV Seed to restore the information about your zPIV is computationally expensive, it can take several hours to restore all of the coins. Although it requires a lot of computation, it does provide a good fail safe in the case of wallet corruptions, machine failure, or other situations.


Importing a seed

Important Warning: It is extremely important that if you are importing a seed, you should be aware that you are setting the wallet's current seed to 'inactive'. Right now the wallet is only coded to handle one seed at a time. If the wallet you import to has zPIV generated by a different seed, then these zPIV will not be spendable until you switch the seed back.

Using the RPC command setzpivseed to replace the wallets existing seed with the seed you are importing. Please read the warning above before doing this!

As seen above, a dzPIV is comprised of your master zPIV seed and the count the coin is in the sequence. If you know that you have only generated a few zPIV, the wallet will likely automatically detect those for you because it will pregenerate the public value of the zPIV (called PublicCoin within the codebase) and will search the blockchain for any knowledge of that zPIV.


Extended Search

    If the automatic import does not work, there are likely gaps in your generation sequence. For example when staking zPIV, you may have had 20 orphans in a row, thus bumping the count up by 20 without any of those Public Coins making it onto the blockchain. In this situation, you are able to tell your wallet to search a certain count range on the blockchain.

In this example, I think my wallet generated up to count 100. I import my zPIV seed to a fresh wallet.dat using RPC command setzpivseed

 

setzpivseed 9e....f12


    The wallet automatically generates mints 1-20 and checks the chain for those values. If it finds that count 15 was used and on the blockchain, it will then generate up to 35 (keeping a buffer of 20) and check if any of those were added to the chain. The wallet loops through that process until no coins are found in the buffer of 20.

After the wallet stops syncing dzPIV, I type in command dzpivstate which will return something like this:



dzpivstate
{
  "dzpiv_count": 1,
  "mintpool_count": 0
}


 

    My wallet stopped generating at 35, but I suspect my mints could be all the way up to count 100. I tell the wallet to generate up to count 100. I want the wallet to start at count 35 because I have already generated up to count 35. I want my wallet to generate an additional 65 zPIV so that it will check up to count 100. Searching for zPIV takes computation, so I am going to run it on two threads. I type the following command searchdzpiv 


searchdzpiv 35 65 2


    When the process is finished it will return the message done. I can now use dzpivstate to see what the current count is (the last found zPIV added to the blockchain + 1). I can also go to the Privacy Dialog and check that my zPIV have been added.