Skip to content

Instantly share code, notes, and snippets.

@haraldh
Last active October 2, 2018 09:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haraldh/ebe3a6b790ee6a2e6d4bbee0edebfcc4 to your computer and use it in GitHub Desktop.
Save haraldh/ebe3a6b790ee6a2e6d4bbee0edebfcc4 to your computer and use it in GitHub Desktop.
HOWTO: move Bitcoin Cash BCH from your Schildbach/bitcoinj wallet
  1. Empty your BTC wallet for safety reasons and transfer it to a newly created BTC HD Wallet. If you know your HD master private key or the 12 words of the old wallet, go to step 5
  2. Backup: save the encrypted wallet (Safety -> Back up wallet) and move the backup file to your computer (e.g. via file transfer, Dropbox, e-mail...).
  3. Decrypt: open the bash, move to your data directory and use
    $ openssl enc -d -aes-256-cbc -md md5 -a -in bitcoin-wallet-backup > bitcoin_decrypted
    
    as stated above, which will ask for the encryption password.
  4. Install bitcoinj:
        $ git clone https://github.com/bitcoinj/bitcoinj.git
        $ cd bitcoinj
        $ mvn install
        $ cd tools
        $ ./wallet-tool
    
    load the decrypted wallet and dump the private keys:
    $ ./wallet-tool dump --wallet=/mnt/d/path/to/wallet/bitcoin_decrypted --dump-privkeys --password <yourpin> | less
    
    Now look for the line: Seed as words: and write down your mnemonics.
  5. Get Electron Cash and run it
  6. Create a new wallet
    1. "Standard Wallet"
    2. "I already have a seed"
    3. Enter the words from step 4 Options: BIP39 seed
    4. Derivation: m/0'
    5. Set a password
  7. Wait for the synchronization and your BCH to appear
  8. For safety reasons transfer your BCH to another wallet
@Codes4Fun
Copy link

This helped a lot thanks! It would be simpler just to grep for 'Seed as words':

$ ./wallet-tool dump --wallet=/mnt/d/path/to/wallet/bitcoin_decrypted --dump-privkeys --password | grep 'Seed as words'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment