I don't like that anyone who reads my encrypted ethereum JSON key file knows my address and balance. Can I delete the "address" field and still be able to import that file into geth and MyEtherWallet?
This is not something I can recommend doing in good faith. Do. Please. DO NOT DO THIS WITH A REAL WALLET THAT HOLDS REAL ETH.
I started with a file called
UTC--2016-05-13T04-31-42.137297157Z--f367f6e5f828fe85f5d95839ebb3f005f2368182 which is a brand new account generated via Mist. I copied it to my desktop.
I attempted to access it via MyEtherWallet. It worked without issue.
I then deleted the address segment:
"address":"f367f6e5f828fe85f5d95839ebb3f005f2368182",-- again, I could open it in MyEtherWallet without issue.
I then renamed the file to just
testand again attempted to open it in MyEtherWallet. It worked without issue.
I then went back to my keystore folder, where the original file sits.
I deleted the address field and nothing appeared to change in the Mist interface.
I then renamed the file to
testand the wallet immediately disappeared from my Mist UI.
I reverted the name change, moved the file to my desktop (it disappeared from Mist) and then moved to back to Mist. So I had a file with the original name, but no address field. It showed back up in Mist.
I then changed the name of the file to:
UTC--2016-05-13T04. It disappeared from Mist. (still no address in the file).
I then changed the file name to:
f367f6e5f828fe85f5d95839ebb3f005f2368182. It reappeared. (still no address in the file).
Getting curious, I then changed the filename to
f367f6e5f828fe85f5d95839ebb3f005f2368183. The wallet displayed changed to that address with the new addressicon.
In neither case did I actually attempt to send any ETH from the wallet. While MyEtherWallet requires you to decrypt it before it pings the geth node to pull the balance, I'm not sure what Mist does. MyEtherWallet does not appear to care about the address field as it derives it from the decrypted private key.
In Mist, the filename MUST contain the address in order to show up. Curiously, whatever address is in the Mist filename is the address that will display in Mist. This leads me to believe that Mist reads the address from the filename without accessing the file itself and displays the balance, etc. When you try to send is when it actually attempts to decrypt it.
Interesting FUN FACTS!
You can save a blank file with the filename of any address (ie:
b794f5ea0ba39494ce839613fffba74279579268) into your keystore folder and it will appear in Mist as if it is your address. Here is a screenshot of my Mist, showing me the proud owner of 10m ETH:
Again, I would NOT recommend doing this under any circumstance. Just don't open your JSON file. Ever. Especially, not in MS Word (yes, I've seen people who have done this.)