Tim Daubenschütz
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Burner Wallet "lost private keys" post-mortem ###### tags: `work` `dedication` `unfinished` `buffer` On 6/8/2019, David Mihal discovered an issue where a private key was reset to "0" and funds were lost. David and Tim investigated, and broke down the incident to the following issues: ## Issue #1: burner-core typo: User: David on localhost:3000, running both the normal Burner Wallet, as well as the beta Burner Wallet 2.0 (https://github.com/dmihal/burner-wallet/tree/burner-2-prototype). A typo in the module LocalSigner resulted in new private keys not being saved to localStorage or cookies. The LocalSigner class defines a variable `_savekey` in the constructor. This variable is intended to disable saving keys to localStorage in unit tests (since unit tests do not have a global localStorage). However, the method `_saveAccount()` was reading the property `savekey` instead of `_savekey`. This caused the saving of private keys to be overwritten in all cases. It is likely that this issue in itself did not affect any user funds for the following reasons: 1. The integration of the @burner-wallet/core module into the Burner Wallet did not remove or replace any of the existing key-handling code, which is still handled within Dapparatus 2. This bug would not cause the key to be erased or overwritten, it would only cause new keys to not be saved. 3. The bug was discovered while testing the Burner Wallet 2.0, which depends entirely on @burner-wallet/core for key support. Burner Wallet 2.0 is not deployed publicly anywhere, and has only been tested by David. 4. The public burner wallet on xdai.io has not been released in nearly a month, meaning no public users are exposed to any of these code changes. This typo [was fixed](https://github.com/austintgriffith/burner-core/commit/63465b062a7ec64ea7be44964deb08997cf2d0e9#diff-295791e4e0b980616599227d1bb31148L82) in the @burner-wallet/core package and released as version 0.0.5. The integration of @burner-wallet/core [has been reverted on the master branch on Github](https://github.com/austintgriffith/burner-wallet/commit/1e3a2b50568a7ab63221d20e9d0ca1bed3820f7b). The change can be re-introduced once it is determined that there is no risk to user keys or funds. ## Issue #2: Chromium regenerates `metaPrivateKey` User: Tim on localhost:3000 but using xdai network Browser: Chromium Version 70.0.3538.77 (Official Build) (64-bit) OS: Mac OS X 10.12.6 Metamask: No (never installed or activated) Commit: [here](https://github.com/austintgriffith/burner-wallet/commit/1e3a2b50568a7ab63221d20e9d0ca1bed3820f7b) While testing David Mihal's [PR for burner-core integration](https://github.com/austintgriffith/burner-wallet/pull/211) Tim opened the burner-wallet on his Chromium for the first time on Thursday, 06/06/2019. During the testing session, Tim sent roughly $1 worth of XDAI to this wallet running on the XDAI live network. He also copied over the Chromium wallet's private key to his Firefox wallet. A day later, when testing the PR a second time, Tim noticed that in Chromium the balance was "gone" (all coins showed a balance of $0). Tim initially didn't follow up on the issue as he thought it was a problem with his computer rather than the burner-wallet code base. After David reported to Tim on Saturday 08/06/2019 and they decided to investigate the original issue collectively in a call, the noticed that `metaPrivateKey` in Tim's Chromium would always regenerate when Tim relaunched the process in Mac OS. To reproduce: - Update your local burner-wallet to the relevant commit mentioned at the top of this section - Delete localStorage for Chromium and domain (e.g. http://localhost:3000) - open http://localhost:3000 in Chromium - open debug tool and inspect `metaPrivateKey` - memorise couple of places of the `metaPrivateKey`` - close all Chromium related processes - reopen Chromium and notice that `metaPrivateKey` has changed Tim failed to reproduce this behavior on the exact same burner-wallet configuration in Chrome Version 74.0.3729.169 (Official Build) (64-bit) and Firefox Version 67.0. In fact, since Tim had copied his Chromium `metaPrivateKey` to his Firefox, his funds are still available there. Tim and David hence concluded in the call on Saturday 08/06/2019 that the issue of Chromium regenerating `metaPrivateKey` is either limited to Tim's computer or Tim's Chromium A follow up investigation on this issue is urgently advised. If you're able to reproduce this result as described here, please reach out. ## Issue #3: Private keys are lost when run with Metamask Existing issue: https://github.com/austintgriffith/burner-wallet/issues/101 Suspicious code: https://github.com/austintgriffith/dapparatus/blob/5370af55966e3843bae9ac7c0e1067dea27e1168/src/dapparatus.js#L68 The initial incident that prompted this investigation seems to be the result of a combination of two issues: 1) Running the Burner Wallet with Metamask installed will cause the private keys in localStorage and cookies to be set to the string "0", causing the loss of funds in the metaaccount. 2) Burner Wallet 2.0 does not support Metamask, and is entirely dependent on metaaccounts and keys stored in localstorage. For compatability, @burner-wallet/core uses the same private keys as Dapparatus. This caused the keys that were generated for Burner Wallet 2.0 to be erased when the Burner Wallet 1.0 was run with Metamask installed. ## Safety recommendations for other contributors - Please make sure to update your local master branch to the latest master on GitHub austingriffith/burner-wallet ## Conclusion (interim) - xdai.io wallets are not affected as code hasn't been updated since May 18th - very recent forks from austingriffith/burner-wallet master that use burner-core 0.0.4 might be affected (very unlikely that somebody is running this though...) - Chromium regeneration problem: No conclusion can be drawn before it cannot be reproduced by other users ## Potential next steps - Deeper investigations into the above described issues + fixes - Updates to quality assurance processes such that these type of bugs are extremely unlikely to make it to the live site - All contributors should always be aware of what version is running in production. Pushing to production should be announced upfront and publicly - The burner-wallet doesn't auto-update for the user. Instead the user decides when to update the wallet's software - This will be difficult to implement for a web app. We may be able to keep the user on a cached version of the app using service workers, but eventually they will have to update. (David) - Backward-compatability tests to secure existing wallets from bugs like these - Forced private key backups for all users of xdai.io

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully