Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: dotbitme on July 26, 2017, 06:52:35 PM



Title: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: dotbitme on July 26, 2017, 06:52:35 PM
I am trying to establish a safe way to split coins in a Bitcoin Core wallet after the fork without risking BTC in exchanges or non-Core clients. My initial thinking was to do it like this:

  • The original wallet containing BTC is a normal Bitcoin Core (https://bitcoincore.org/) wallet fully synced.
  • Set up a new Bitcoin Core (https://bitcoincore.org/) wallet as well as a Bitcoin ABC (https://bitcoinabc.org/) wallet.
  • Transfer the BTC from the original wallet to the new Core wallet with OP_RETURN "Bitcoin: A Peer-to-Peer Electronic Cash System" which makes the transaction invalid on the new BCC network (https://github.com/Bitcoin-UAHF/spec/blob/master/uahf-technical-spec.md#req-6-1-disallow-special-op_return-marked-transactions-with-sunset-clause).
  • Stop the original Core wallet (now empty on the original chain) and the ABC wallet and copy the wallet.dat from the original Core wallet to the ABC wallet.
  • Restart the ABC wallet with -rescan. The BCC should now show up in the ABC wallet while the BTC are safe in the new Core wallet as the transfer above is only valid on the BTC side. Transfer the BCC to an exchange and sell for BTC.

Would this even work? I would love some advice.

In the latest BCC specification there is a new way using SIGHASH_FORKID, but I am unsure how to make use of that instead? The OP_RETURN is still valid but obsolete (https://github.com/Bitcoin-UAHF/spec/pull/17).




Title: Re: Spitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: achow101 on July 26, 2017, 07:33:25 PM
There is no need to make a second Bitcoin Core wallet, or to even do anything to split your coins. Since they now have two way replay protection, your coins will be split the moment the chain forks.

What you need to do to spend your ABC coins is to just make a copy of your Core wallet.dat file. Then install the Bitcoin ABC client and put your copied wallet.dat file in the place where you want the ABC datadir to be (do this before starting ABC). Then start ABC and let it sync. When you want to spend your ABC coins, just use the ABC wallet. When you want to spend your Core coins, use the Bitcoin Core wallet.


Title: Re: Spitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: dotbitme on July 26, 2017, 07:39:59 PM
Ahh, so it's that simple now that SIGHASH_FORKID has been added - GREAT!

Thanks for the quick reply


Title: Re: Spitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: cr1776 on July 27, 2017, 12:27:06 AM
Ahh, so it's that simple now that SIGHASH_FORKID has been added - GREAT!

Thanks for the quick reply

You should also be able to copy (not move) the blocks themselves to the appropriate ABC directory and begin from there to save yourself having to resync it all.



Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: dotbitme on July 28, 2017, 09:13:06 AM
One last clarification in the spirit of not trusting BTC private keys to a non-core wallet:

I assume it is possible to first transfer all BTC out of a wallet (after the fork has occurred) and then copy the wallet.dat file to the ABC wallet, rescan and all BCC should show up. Is that correct?


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: achow101 on July 28, 2017, 04:30:16 PM
One last clarification in the spirit of not trusting BTC private keys to a non-core wallet:

I assume it is possible to first transfer all BTC out of a wallet (after the fork has occurred) and then copy the wallet.dat file to the ABC wallet, rescan and all BCC should show up. Is that correct?
Yes.


Title: Re: Spitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: themaxx on August 01, 2017, 06:11:08 AM
What you need to do to spend your ABC coins is to just make a copy of your Core wallet.dat file. Then install the Bitcoin ABC client and put your copied wallet.dat file in the place where you want the ABC datadir to be (do this before starting ABC). Then start ABC and let it sync. When you want to spend your ABC coins, just use the ABC wallet. When you want to spend your Core coins, use the Bitcoin Core wallet.
Any idea where this datadir is on Windows? I have:
C:\Program Files\BitcoinABC
C:\Program Files\BitcoinABC\daemon
C:\Program Files\BitcoinABC\doc

Also, can I share the transaction history with my Bitcoin Core Wallet, or do I need to download a new and separate transaction history? It takes ages to download.


Title: Re: Spitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: achow101 on August 01, 2017, 06:31:23 AM
Any idea where this datadir is on Windows? I have:
C:\Program Files\BitcoinABC
C:\Program Files\BitcoinABC\daemon
C:\Program Files\BitcoinABC\doc
The datadir for Bitcoin ABC is the same as Bitcoin Core's datadir. This is C:\Users\<user>\AppData\Bitcoin.

Also, can I share the transaction history with my Bitcoin Core Wallet, or do I need to download a new and separate transaction history? It takes ages to download.
Yes, but you cannot run both at the same time, and because there will be a fork, I recommend that you don't do that as you will have blocks that are invalid to one software and vice versa. Instead of downloading a new chain, right now, before the fork, you should make a copy of your entire datadir and have Bitcoin ABC use the copied datadir by starting it with the -datadir=<path> option.


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: themaxx on August 01, 2017, 06:55:34 AM
Thanks for your quick answers!


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: moniter on August 01, 2017, 01:45:06 PM
Just a quick followup question: I am in a similar situation as OP with a small caveat - my Bitcoin Core wallet (0.14.2) has not been fully synced; it is currently approx ~47 weeks behind with a 15-hour ETA and does not show the up-to-date BTC balance. Would I be able to follow the same steps outlined but copy the datadir of the original core wallet with 2 weeks remaining on sync as to save some time syncing the entire blockchain all over again, or would this not be compatible due to the potential of the tail-end of the sync occurring post-fork.

To summarize, would the following game-plan be viable?

1. Already created copy of Core wallet.dat file

---- Post-Fork -----

2. Install ABC client in new/separate datadir (might even use a separate computer altogether) from Core and place following:
    a) Copied Core wallet.dat file from pre-fork.
    b) Copied blocks stopped with 2 weeks behind (or some other cushion time) to save ABC sync time.
3. Start Core Wallet and complete sync (remaining ~2 weeks + new blocks).
4. Transfer all BTC by sending to new address.
5. Start ABC and complete sync (~2 weeks of core chain + new ABC blocks) and scan Core wallet.dat file.
6. Now able to spend ABC coins from ABC wallet?

Any clarification is greatly appreciated, thanks!


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: achow101 on August 01, 2017, 07:26:31 PM
2. Install ABC client in new/separate datadir (might even use a separate computer altogether) from Core and place following:
    a) Copied Core wallet.dat file from pre-fork.
    b) Copied blocks stopped with 2 weeks behind (or some other cushion time) to save ABC sync time.
3. Start Core Wallet and complete sync (remaining ~2 weeks + new blocks).
4. Transfer all BTC by sending to new address.
5. Start ABC and complete sync (~2 weeks of core chain + new ABC blocks) and scan Core wallet.dat file.
6. Now able to spend ABC coins from ABC wallet?
Yes to all of the above.


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: moniter on August 01, 2017, 07:38:33 PM
You rock achow101! Thanks for confirming.


Title: Re: Spitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: dennyd999 on August 02, 2017, 01:17:29 AM

Quote
Yes, but you cannot run both at the same time, and because there will be a fork, I recommend that you don't do that as you will have blocks that are invalid to one software and vice versa. Instead of downloading a new chain, right now, before the fork, you should make a copy of your entire datadir and have Bitcoin ABC use the copied datadir by starting it with the -datadir=<path> option.


1.If my Bitcoin Core datadir is allready synchronized after the fork can I steel path this datadir to Bitcoin ABC ?


2. Also is that correct that I can now send my money from wallet.dat from Bitcoin Core and than I can use it with zero balance on it, but Bitcoin ABC still will show preforked BTC ammount even if I send it after fork to another adress.. Is it absolutely right?


Title: Re: Spitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: achow101 on August 02, 2017, 05:00:48 AM
1.If my Bitcoin Core datadir is allready synchronized after the fork can I steel path this datadir to Bitcoin ABC ?
Yes, but I wouldn't recommend it. Using the datadir which has a chainstate of what ABC would consider an invalid chain may result in some really weird behavior. No one has testing doing that before, so no one knows what will happen and what could go wrong.

2. Also is that correct that I can now send my money from wallet.dat from Bitcoin Core and than I can use it with zero balance on it, but Bitcoin ABC still will show preforked BTC ammount even if I send it after fork to another adress.. Is it absolutely right?
Yes. BTC transactions are invalid to BCC nodes and vice versa.


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: dennyd999 on August 02, 2017, 01:29:45 PM
Thanks a lot achow101. :)


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: Alexey555 on August 03, 2017, 10:47:42 AM
Good afternoon!
Sorry for the stupid questions, but finally got confused.
If I have Bitcoin Core on my PC and I install Bitcon ABC on the same PC in another folder with activation of my wallet.dat, will I get the same amount of BBC coin on this purse?
Example: we have 1 BTC, set Bitcon ABC gets 1 BCC? Do I lose my 1 BTC?
Next, I sell 1 BCC somewhere for 0.5 BTC, I transfer to the old Bitcoin Core and I get 1.5 BTC in the TOTAL?
And how much time do I have for such actions, if they are true?
Sorry if I'm stupid. )))) I ask for clarification.


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: fabiorem on August 03, 2017, 03:49:41 PM
I created a second wallet, transferred funds to it, copied the blockchain to a second drive, kept the first wallet in this second drive, unplugged the first drive, got to another OS, installed bitcoin ABC, pointed it to the second drive, and...

Bitcoin ABC is showing BCC as transferred to the second wallet, which is on the original bitcoin-qt.

All the five transactions are there. I spend money with these transactions for nothing, since it didn't split.

How can I split them? I did everything said here: https://bitcointalk.org/index.php?topic=2059111.0 even installed another OS to access it and not mess any files.


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: brockleeroy on August 03, 2017, 04:15:22 PM
One last clarification in the spirit of not trusting BTC private keys to a non-core wallet:

I assume it is possible to first transfer all BTC out of a wallet (after the fork has occurred) and then copy the wallet.dat file to the ABC wallet, rescan and all BCC should show up. Is that correct?
Yes.

I transferred all my BTC out of my Bitcoin Core wallet after the fork occurred so they are in a new Bitcoin Core wallet safe. I then copied my Bitcoin Core wallet.dat file to the new Bitcoin ABC wallet on another computer. It shows my BCC balance as 0 in Bitcoin ABC wallet. Any advice would be greatly appreciated.


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: njcarlos on August 05, 2017, 06:50:37 AM
I transferred all my BTC out of my Bitcoin Core wallet after the fork occurred so they are in a new Bitcoin Core wallet safe. I then copied my Bitcoin Core wallet.dat file to the new Bitcoin ABC wallet on another computer. It shows my BCC balance as 0 in Bitcoin ABC wallet. Any advice would be greatly appreciated.
Bump... did you find out what the issue was? Maybe you needed to rescan?


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: alexcrys on August 05, 2017, 05:13:40 PM
I transferred all my BTC out of my Bitcoin Core wallet after the fork occurred so they are in a new Bitcoin Core wallet safe. I then copied my Bitcoin Core wallet.dat file to the new Bitcoin ABC wallet on another computer. It shows my BCC balance as 0 in Bitcoin ABC wallet. Any advice would be greatly appreciated.
Bump... did you find out what the issue was? Maybe you needed to rescan?

I have the same problems balance 0, but on blockchair my wallet have BCC, how to rescan ? thx


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: brockleeroy on August 08, 2017, 07:29:39 PM
I transferred all my BTC out of my Bitcoin Core wallet after the fork occurred so they are in a new Bitcoin Core wallet safe. I then copied my Bitcoin Core wallet.dat file to the new Bitcoin ABC wallet on another computer. It shows my BCC balance as 0 in Bitcoin ABC wallet. Any advice would be greatly appreciated.
Bump... did you find out what the issue was? Maybe you needed to rescan?
[/quote

I figured it out. I backup up my wallet.dat, uninstalled bitcoin abc, deleted the users/username/AppData/Roaming/Bitcoin appdata directory. Then copied the backed up wallet.dat back in that directory. Reinstalled Bitcoin abc. It synced and now it works. Yay!


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: mountcrypt on August 09, 2017, 11:17:15 AM
Hi guys,

Sorry for the n00b question, but I'd really appreciate some guidance on the below:

I sent the majority of my BTC to my Mycelium wallet pre-August 1.

Since then I've sent it to various exchanges (Bittrex and Coinbase) with the intention to trade. But then I discovered I can actually claim Bitcoin Cash against my Bitcoin. WOOP!

So I've sent my BTC back from the exchanges to Mycelium. Can I still claim my Bitcoin Cash against those BTC, even though they've been sent to exchanges and back since August 1st?

I tried to do some research prior to asking here. There are detailed outlines of how to retrieve your BCC from a Mycelium wallet (listed below for those interested) but I can't find an answer for this particular situation.

I was hoping someone experienced from the community could advise me before I begin the retrieval process, given that there's a level risk involved with most procedures.

Thanks in advance!

- - - - - -
Guides to retrieving BCC from your BTC in a Mycelium wallet (which I'm assuming only work for cases where the BTC has been in the wallet since pre-August 1 and hasn't moved around)

https://steemit.com/btc/@libert/step-by-step-guide-on-claiming-bitcoincash-from-mycellium-wallet-201783t112141477z
https://bitcointalk.org/index.php?topic=2058473.0


Title: Re: Splitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: HCP on August 09, 2017, 01:52:31 PM
If your BTC was in a wallet where you have access to the private keys when Block #478558 was mined on the BTC network... then you should be able to "claim" an equal amount of BCC regardless of what you did with your BTC after this time. You could have sold all your BTC for DOGE coin, or sent it all to a BTC burner address or spent it all on blackjack and hookers.

The BTC and BCC chains split at Block #478559... so the two chains share a common history up until Block #478558.

You don't need your coins back in your Mycelium wallet to start... in fact, you're technically safer if they are NOT in your Mycelium wallet (and you never use that wallet again and generate a completely new wallet with new keys)... that way, only your BCC is in danger if the BCC wallet you use to claim your BCC is rouge and steals your keys


Title: Re: Spitting coins in a Bitcoin Core wallet after potential fork August 1st
Post by: robertbruce on August 09, 2017, 02:41:38 PM
There is no need to make a second Bitcoin Core wallet, or to even do anything to split your coins. Since they now have two way replay protection, your coins will be split the moment the chain forks.

What you need to do to spend your ABC coins is to just make a copy of your Core wallet.dat file. Then install the Bitcoin ABC client and put your copied wallet.dat file in the place where you want the ABC datadir to be (do this before starting ABC). Then start ABC and let it sync. When you want to spend your ABC coins, just use the ABC wallet. When you want to spend your Core coins, use the Bitcoin Core wallet.

thank-you for your posts achow101 and dotbitme...

Would this twist on this method save a step. My goal is to move my bch to a paper wallet...

copy over the datadir and wallet.dat to a new directory
start bitcoin core, point it to new directory
load with new paperwallet address in the receiving list
sync it
send prefork btc to new address, wait for confirms
close Bitcoin core
install bitcoin abc, let it overwrite the files, sync it,
load with key from prefork btc, bch shows up,
send to new paper-wallet address that was loaded in bitcoin core

doing it this way i wouldnt have to go back to bitcore coin and would save a transaction... i havn't used bitcoin core yet, but from what i understand if i let it create a receiving address of it's own im going to have to extract the key and or do the passphrase thingy to get it simply from one addy to another... within the same wallet...