{"action":"created","issue":{"url":"https://api.github.com/repos/voisine/breadwallet/issues/173","labels_url":"https://api.github.com/repos/voisine/breadwallet/issues/173/labels{/name}","comments_url":"https://api.github.com/repos/voisine/breadwallet/issues/173/comments","events_url":"https://api.github.com/repos/voisine/breadwallet/issues/173/events","html_url":"https://github.com/voisine/breadwallet/issues/173","id":62577879,"number":173,"title":"New wallet not restored in same device iTunes backup/restore","user":{"login":"larrysalibra","id":597182,"avatar_url":"https://avatars.githubusercontent.com/u/597182?v=3","gravatar_id":"","url":"https://api.github.com/users/larrysalibra","html_url":"https://github.com/larrysalibra","followers_url":"https://api.github.com/users/larrysalibra/followers","following_url":"https://api.github.com/users/larrysalibra/following{/other_user}","gists_url":"https://api.github.com/users/larrysalibra/gists{/gist_id}","starred_url":"https://api.github.com/users/larrysalibra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larrysalibra/subscriptions","organizations_url":"https://api.github.com/users/larrysalibra/orgs","repos_url":"https://api.github.com/users/larrysalibra/repos","events_url":"https://api.github.com/users/larrysalibra/events{/privacy}","received_events_url":"https://api.github.com/users/larrysalibra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-18T03:20:29Z","updated_at":"2015-03-18T03:31:26Z","closed_at":null,"body":"TL;DL: Created a new wallet yesterday so a friend could send me some bitcoin. Forgot to write down the recovery phrase. (D'oh!) Backed up my phone to iTunes (for the first time) and restored to the same device. The new wallet was gone & an old supposedly wiped wallet had reappeared. The Bitcoin was gone.\r\n\r\n**Longer narrative**\r\n\r\nLate in 2014 I used breadwallet to give a demonstration to Bitcoin newbies how to set up and use a Bitcoin wallet. I walked them through setting up and using breadwallet on the while my iPhone's screen was mirrored on a projector using AirPlay.  The wallet was compromised from the beginning because the recovery phrase & pin was onscreen before a room full of people. \r\n\r\nFast forward to yesterday - a friend owed me some money and I thought it would be fun to give breadwallet a try. Obviously, I didn't want to use the (empty) compromised wallet, so I wiped it with the recovery phrase. I was outside at lunch without any paper nearby so didn't write down my recovery phrase. (My fault!)\r\n\r\nThe friend sent me the bitcoin he owed me. I immediately sent a small portion of that to another friend at lunch who I owed money from his overpayment at lunch. \r\n\r\nThat evening, I backed up my phone to iTunes in order to do a fresh restore in attempt to fix some lag issues with the camera and icloud photo library. It was an encrypted backup and the first and only iPhone backup on the computer. I totally forget about breadwallet and writing down the recovery phrase until about 5 seconds after the restore started. When the restore completed, the old wallet that was wiped earlier in the day had reappeared in breadwallet and the new wallet was gone.\r\n\r\n---\r\n\r\nI looked through the other issues, and it appears that the wallet is set to be encrypted with the device key and should be restorable to the same device. I'm not sure why an old wiped wallet would get backed up instead of the new wallet. Is there a chance the wipe of the old wallet and creation of the new wallet didn't get flushed to disk?"},"comment":{"url":"https://api.github.com/repos/voisine/breadwallet/issues/comments/82723648","html_url":"https://github.com/voisine/breadwallet/issues/173#issuecomment-82723648","issue_url":"https://api.github.com/repos/voisine/breadwallet/issues/173","id":82723648,"user":{"login":"voisine","id":316879,"avatar_url":"https://avatars.githubusercontent.com/u/316879?v=3","gravatar_id":"","url":"https://api.github.com/users/voisine","html_url":"https://github.com/voisine","followers_url":"https://api.github.com/users/voisine/followers","following_url":"https://api.github.com/users/voisine/following{/other_user}","gists_url":"https://api.github.com/users/voisine/gists{/gist_id}","starred_url":"https://api.github.com/users/voisine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/voisine/subscriptions","organizations_url":"https://api.github.com/users/voisine/orgs","repos_url":"https://api.github.com/users/voisine/repos","events_url":"https://api.github.com/users/voisine/events{/privacy}","received_events_url":"https://api.github.com/users/voisine/received_events","type":"User","site_admin":false},"created_at":"2015-03-18T03:31:26Z","updated_at":"2015-03-18T03:31:26Z","body":"Hi @larrysalibra I was just chatting with Michael about your issue.\r\n\r\nCan you check the timestamp on the backup? It really sounds like you restored from a backup made prior to wiping the old wallet. Is it possible you somehow restored from an older iCloud backup instead?\r\n\r\nWriting to the keychain is handled by apple's security framework, which is pretty paranoid about preventing data loss, so that doesn't seem to be a likely candidate. You were able to send from the new wallet, so it must have been correctly written to the keychain. The seed is retrieved from the keychain when you sign a transaction."}}