Skip to content

Using zmigrate dApp to Migrate Funds from Sprout to Sapling Automatically

ParrotGotMeEye edited this page Feb 14, 2019 · 28 revisions

Make Sure Your Computer's Firewall is Turned OFF

Step 1: Start Pirate in native mode

  • Download and run latest Agama from here (Select the installer if you want to install it or use the portable version to start Agama immediately)
  • Make sure you have fully synced and 100% blockchain database downloaded
  • Keep Agama running until you finish with the migration at the next step

Step 2: Migrate

Windows guide click here

Linux:

Open a terminal window and type the following one by one and use your Sapling address. Make sure Pirate wallet is running in Agama and fully synced.

cd ~
wget https://github.com/PirateNetwork/komodo/releases/download/0.3.3b/komodo-zmigrate-beta-linux.tar.xz
tar xf komodo-zmigrate-beta-linux.tar.xz
cd komodo-zmigrate-beta-linux
./pirate getinfo
# check if "blocks" and "longestchain" number matches
./pirate z_getnewaddress
# example output: zs1zh96jj3qqdgrpkhnnuytpdm0lkqzcz9ed05r34phj3sr2n9v2xwenf7me83xgl9e8y9tk2n70yn
./zmigrate PIRATE zs1zh96jj3qqdgrpkhnnuytpdm0lkqzcz9ed05r34phj3sr2n9v2xwenf7me83xgl9e8y9tk2n70yn
# use your zs address there and wait for the process to finish. Scroll down in Agama Send tab to check operation statuses

MacOS (OSX):

Open a terminal window and type the following one by one and use your Sapling address. Make sure Pirate wallet is running in Agama and fully synced.

  1. Install brew. If you already have brew installed, proceed to the next step
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. Install wget
brew install wget
  1. Download the komodo-zmigrate-beta-osx.zip
cd ~
wget https://github.com/PirateNetwork/komodo/releases/download/0.3.3b/komodo-zmigrate-beta-osx.zip
  1. Unzip the downloaded file
unzip komodo-zmigrate-beta-osx.zip
  1. Navigate to the unzipped folder
cd komodo-zmigrate-beta-osx
  1. Check your Agama is fully synced and if "blocks" and "longestchain" number matches using the following command
./pirate getinfo
  1. Create a new Sapling z address
./pirate z_getnewaddress

Sapling z address looks like this zs1zh96jj3qqdgrpkhnnuytpdm0lkqzcz9ed05r34phj3sr2n9v2xwenf7me83xgl9e8y9tk2n70yn 8. Start zmigrate dApp to start processing the migration

./zmigrate PIRATE zs1zh96jj3qqdgrpkhnnuytpdm0lkqzcz9ed05r34phj3sr2n9v2xwenf7me83xgl9e8y9tk2n70yn

Use your zs address above and wait for the process to finish. Scroll down in Agama Send tab to check operation statuses

Wait for the migrate process to finish, which can take few hours depending on the amount of zutxos in your wallet and your system hardware specification.

Example

This example shows what zmigrate dApp done to complete a migration process. The first line is the zmigrate command

./zmigrate PIRATE zs14vt4jpf67eyvsk2ezkhrtg6vj28dztwmxz9gcwk5hv7cw6sm2a7eck7afe7k0a55fh3dq2w867f
./komodo-cli -ac_name=PIRATE: PIRATE zs14vt4jpf67eyvsk2ezkhrtg6vj28dztwmxz9gcwk5hv7cw6sm2a7eck7afe7k0a55fh3dq2w867f
zcaddr.(zcHeNfnK29j68QTzHUTERUUUFoEbpshTEr3NocGhRySgDLxbrj1GDKSR4eCwuG5ovWtt7LLKkoUA6y2HjjGS1a82uAWEjmU) -> z_exportkey.(SKxqmVeX135GzZSAxVwyQ5NTCzG5dFi3bkw6y46bmxdq47sdPVQB)
{"remainingUTXOs":0,"remainingTransparentValue":0,"remainingNotes":46,"remainingShieldedValue":13264.86570064,"mergingUTXOs":0,"mergingTransparentValue":0,"mergingNotes":10,"mergingShieldedValue":2735.78350837,"opid":"opid-93b06a50-3a07-4b26-8406-f2f86e9f8a38"}
{"remainingUTXOs":0,"remainingTransparentValue":0,"remainingNotes":36,"remainingShieldedValue":10726.12372230,"mergingUTXOs":0,"mergingTransparentValue":0,"mergingNotes":10,"mergingShieldedValue":2538.74197834,"opid":"opid-77a6d0c5-bc07-4dd8-aacb-9aaa5c82d90a"}
{"remainingUTXOs":0,"remainingTransparentValue":0,"remainingNotes":27,"remainingShieldedValue":10342.46127011,"mergingUTXOs":0,"mergingTransparentValue":0,"mergingNotes":10,"mergingShieldedValue":3119.44586056,"opid":"opid-99800be0-0617-4eb2-9fe2-c2be38932371"}
{"remainingUTXOs":0,"remainingTransparentValue":0,"remainingNotes":17,"remainingShieldedValue":7334.26207955,"mergingUTXOs":0,"mergingTransparentValue":0,"mergingNotes":10,"mergingShieldedValue":3008.19919056,"opid":"opid-f292f8f7-4fde-4aa1-9022-107b500e426b"}
{"remainingUTXOs":0,"remainingTransparentValue":0,"remainingNotes":8,"remainingShieldedValue":4724.04976884,"mergingUTXOs":0,"mergingTransparentValue":0,"mergingNotes":10,"mergingShieldedValue":5148.95418905,"opid":"opid-0ef81112-4fb8-484a-a653-afa1c0917ea9"}
{"remainingUTXOs":0,"remainingTransparentValue":0,"remainingNotes":0,"remainingShieldedValue":0,"mergingUTXOs":0,"mergingTransparentValue":0,"mergingNotes":9,"mergingShieldedValue":7843.49552940,"opid":"opid-2061d4fd-400b-428f-8711-f18f95ce5e7c"}
start processing zmigrate
found address.(zcHeNfnK29j68QTzHUTERUUUFoEbpshTEr3NocGhRySgDLxbrj1GDKSR4eCwuG5ovWtt7LLKkoUA6y2HjjGS1a82uAWEjmU) with amount 8157.15317961
z_sendmany from.(zcHeNfnK29j68QTzHUTERUUUFoEbpshTEr3NocGhRySgDLxbrj1GDKSR4eCwuG5ovWtt7LLKkoUA6y2HjjGS1a82uAWEjmU) -> '[{"address":"RGVKKUcUu29FjD1seE3YvhbgMNEacdt53X","amount":5000.00010000}]'
z_sendmany.(PIRATE) -> opid.(opid-bc1fe7fb-fd6b-4e8b-9f34-ec56dd94c616)
found address.(zcHeNfnK29j68QTzHUTERUUUFoEbpshTEr3NocGhRySgDLxbrj1GDKSR4eCwuG5ovWtt7LLKkoUA6y2HjjGS1a82uAWEjmU) with amount 3008.19909056
z_sendmany from.(zcHeNfnK29j68QTzHUTERUUUFoEbpshTEr3NocGhRySgDLxbrj1GDKSR4eCwuG5ovWtt7LLKkoUA6y2HjjGS1a82uAWEjmU) -> '[{"address":"RAHWsFzmSzF8kouvvqeUzzx6dH3bvZ44ra","amount":3008.19899056}]'
z_sendmany.(PIRATE) -> opid.(opid-65a9f90a-3abf-47bc-8328-e7f2cfb998a2)
found address.(zcHeNfnK29j68QTzHUTERUUUFoEbpshTEr3NocGhRySgDLxbrj1GDKSR4eCwuG5ovWtt7LLKkoUA6y2HjjGS1a82uAWEjmU) with amount 7992.44931845
z_sendmany from.(zcHeNfnK29j68QTzHUTERUUUFoEbpshTEr3NocGhRySgDLxbrj1GDKSR4eCwuG5ovWtt7LLKkoUA6y2HjjGS1a82uAWEjmU) -> '[{"address":"RHs2WsqZjRasEG1yGSXfBszwNJJPwuDxTz","amount":5000.00010000}]'
z_sendmany.(PIRATE) -> opid.(opid-7a5d2064-20b4-43bd-8660-f6d6be0fb463)
found address.(RAHWsFzmSzF8kouvvqeUzzx6dH3bvZ44ra) with amount 3008.19899056
z_sendmany from.(RAHWsFzmSzF8kouvvqeUzzx6dH3bvZ44ra) -> '[{"address":"zs14vt4jpf67eyvsk2ezkhrtg6vj28dztwmxz9gcwk5hv7cw6sm2a7eck7afe7k0a55fh3dq2w867f","amount":3008.19889056}]'
z_sendmany.(PIRATE) -> opid.(opid-1f2f1201-7cf0-427a-b8d1-66cdaf26ffc1)
found address.(RGVKKUcUu29FjD1seE3YvhbgMNEacdt53X) with amount 5000.00010000
z_sendmany from.(RGVKKUcUu29FjD1seE3YvhbgMNEacdt53X) -> '[{"address":"zs14vt4jpf67eyvsk2ezkhrtg6vj28dztwmxz9gcwk5hv7cw6sm2a7eck7afe7k0a55fh3dq2w867f","amount":5000.00000000}]'
z_sendmany.(PIRATE) -> opid.(opid-c641447a-885f-4c66-9b95-51bb5a43c8b8)
found address.(zcHeNfnK29j68QTzHUTERUUUFoEbpshTEr3NocGhRySgDLxbrj1GDKSR4eCwuG5ovWtt7LLKkoUA6y2HjjGS1a82uAWEjmU) with amount 148.95388905
z_sendmany from.(zcHeNfnK29j68QTzHUTERUUUFoEbpshTEr3NocGhRySgDLxbrj1GDKSR4eCwuG5ovWtt7LLKkoUA6y2HjjGS1a82uAWEjmU) -> '[{"address":"RRtEBaLre9GvHBDsbK3vFE2v95YJGepKVc","amount":148.95378905}]'
z_sendmany.(PIRATE) -> opid.(opid-9f30e745-f1dd-4d0f-a562-8f62d76e137d)
found address.(RHs2WsqZjRasEG1yGSXfBszwNJJPwuDxTz) with amount 5000.00010000
z_sendmany from.(RHs2WsqZjRasEG1yGSXfBszwNJJPwuDxTz) -> '[{"address":"zs14vt4jpf67eyvsk2ezkhrtg6vj28dztwmxz9gcwk5hv7cw6sm2a7eck7afe7k0a55fh3dq2w867f","amount":5000.00000000}]'
z_sendmany.(PIRATE) -> opid.(opid-436c407e-58f0-4a04-88cf-24097bff3446)
found address.(RRtEBaLre9GvHBDsbK3vFE2v95YJGepKVc) with amount 148.95378905
z_sendmany from.(RRtEBaLre9GvHBDsbK3vFE2v95YJGepKVc) -> '[{"address":"zs14vt4jpf67eyvsk2ezkhrtg6vj28dztwmxz9gcwk5hv7cw6sm2a7eck7afe7k0a55fh3dq2w867f","amount":148.95368905}]'
z_sendmany.(PIRATE) -> opid.(opid-d6b4637e-9d86-4b98-9bdd-8faf6ef685d0)
found address.(zcHeNfnK29j68QTzHUTERUUUFoEbpshTEr3NocGhRySgDLxbrj1GDKSR4eCwuG5ovWtt7LLKkoUA6y2HjjGS1a82uAWEjmU) with amount 2843.49522940
z_sendmany from.(zcHeNfnK29j68QTzHUTERUUUFoEbpshTEr3NocGhRySgDLxbrj1GDKSR4eCwuG5ovWtt7LLKkoUA6y2HjjGS1a82uAWEjmU) -> '[{"address":"RTL5jrkecqAuuRt7coFLqM4vKTcjS3CmVj","amount":2843.49512940}]'
z_sendmany.(PIRATE) -> opid.(opid-acf522a6-d4e0-40ea-9db8-7dde32acb57f)
found address.(RTL5jrkecqAuuRt7coFLqM4vKTcjS3CmVj) with amount 2843.49512940
z_sendmany from.(RTL5jrkecqAuuRt7coFLqM4vKTcjS3CmVj) -> '[{"address":"zs14vt4jpf67eyvsk2ezkhrtg6vj28dztwmxz9gcwk5hv7cw6sm2a7eck7afe7k0a55fh3dq2w867f","amount":2843.49502940}]'
z_sendmany.(PIRATE) -> opid.(opid-bda6c631-4f7a-40d6-be98-6705f8106879)
PIRATE zs14vt4jpf67eyvsk2ezkhrtg6vj28dztwmxz9gcwk5hv7cw6sm2a7eck7afe7k0a55fh3dq2w867f ALLDONE! taddr 0.00000000 sprout 0.00000000 mempool empty.0
about to purge all opid results!. ctrl-C to abort, <enter> to proceed

All done! Press ENTER in your keyboard and check Agama for the balance to be reflected.

How the zmigrate dApp works?

  • Sends all funds from Sprout (zc) address to Sprout (zc) address first using z_mergetoaddress call (This will take most of the time as it is pure sprout transacton).
  • After all funds moved to a new sprout address, the dApp starts sending them to unique new R addresses with a batch of 5000.0001 until there are enough to create a batch. Then, starting batching them up to 500.0001 until there is enough left for a batch. Then, it does 50.0001s batch as needed and one final. (This step may take some time as well as it does sprout transaction.)
  • After all funds moved to new transparent addresses, it starts the final steps to move funds to Sapling (zs) addresses.

Important Notes

  • 15th February 2019 is the deadline, you must migrate all your sprout funds to sapling (after the deadline sprout addresses and their operations will be disabled)
  • It can take few hours to complete (specially if you have tons of mined funds in small utxo sizes)
  • Make sure not to close the daemon aggressively in the middle of migration process
  • If you run the stop command, it will finish the current operation, then the daemon will stop
  • Once the process finishes you will see notification message in console
  • Press Enter button on your keyboard to Finish.

zmigrate best practices

  • Finish the process as soon as you can, don't leave it for later
  • Once you are done with migrating the funds, take a backup of the private key of your sapling address(s)
  • Stop the Pirate wallet daemon
  • Backup the wallet.dat file first in a safe place then delete it from data dir
  • Start the wallet again
  • Import the sapling address(s)'s private key and start a fresh wallet

Export Sapling Addr Private Key

Enter the command below with a terminal from the same dir as before with your sapling address to get the private key.

./pirate z_exportkey zs1zh96jj3qqdgrpkhnnuytpdm0lkqzcz9ed05r34phj3sr2n9v2xwenf7me83xgl9e8y9tk2n70yn

You will get an output like below. This is your private key for the sapling z address.

secret-extended-key-main1qw3hr79rqgqqpqyh5dyplsjzm2cg8crykwpjr5j2pc0kle7tqkqanks33ar4nupcuxr0wvp58hzpazclgw2sg2e677augzdjmqj0supayuzuqmk3z5qqwgzmmygzh6up6alstzqneunwmdgnj5tanasqhxy7v620hnvw3fsdmmtnaysua6xdgmxg42j4xhjglqyp68yf76tceun767kw2x86ngfd4kdy559gu5gcz37uud84et4ppakrxl7he3ua4jg3kxz5tzfvjtswxgkgw

Import the sapling private key

Enter the following command in your terminal to import the key.

./pirate z_importkey secret-extended-key-main1qw3hr79rqgqqpqyh5dyplsjzm2cg8crykwpjr5j2pc0kle7tqkqanks33ar4nupcuxr0wvp58hzpazclgw2sg2e677augzdjmqj0supayuzuqmk3z5qqwgzmmygzh6up6alstzqneunwmdgnj5tanasqhxy7v620hnvw3fsdmmtnaysua6xdgmxg42j4xhjglqyp68yf76tceun767kw2x86ngfd4kdy559gu5gcz37uud84et4ppakrxl7he3ua4jg3kxz5tzfvjtswxgkgw