Skip to content

Badger v0.6.0 Upgrade

Gabriel Cardona edited this page Apr 19, 2019 · 46 revisions

TLDR

In order to take Badger to a new level we're changing how we handle accounts and tokens. Existing non primary accounts, also called secondary accounts, are no longer supported in Badger v0.6.0. If you have BCH or tokens on a non-primary Badger account please consolidate those funds to your primary account before upgrading. After upgrading you can create new non-primary accounts and send your funds back.

We realize this is inconvenient. The benefits of upgrading how we handle accounts/tokens include:

  • BIP44 compliant for wallet interoperability with Badger Mobile and greater ecosystem
  • Protects tokens from being burned in BCH txs
  • First step toward full HD wallet
  • First step toward enabling cash shuffle.

Introduction

The Badger ecosystem is growing very quickly. Daily we're seeing new Badger Button integrations and recently we crossed 1000 BCH tokens. With the upcoming launch of Badger Mobile there is some housekeeping which we need to do to ensure interoperability between Badger Desktop and Badger Mobile. The most pressing change to be aware of as you upgrade to the latest Badger is that existing secondary accounts are deprecated and need to be consolidated with your primary Badger account.

What is a non-primary Badger Account?

When you first create Badger it loads with your primary account. You can create secondary, or non-primary, accounts via the dropdown menu at the top right. Secondary accounts are any account other than 'Account 1'

Due to a change we're making in the underlying hdpaths any secondary accounts will point to different addresses after you upgrade. No funds will be lost but they won't show up in Badger. To resolve that issue you need to consolidate your secondary accounts into your primary Badger account.

I haven't yet upgraded and I have a non primary account

Copy Simple Token Address

First thing to do is consolidate your tokens to primary account. For that you want to sign in to Badger and click your simpleledger address to copy it to your clipboard.

Switch to secondary account

Next use the drop down menu and select the secondary account which you want to consolidate. In this example it's called 'Account 2'

Choose Token

Once in your secondary account select the token which you want to consolidate and click 'Send.' In this example it's $SPICE tokens

Fill out form

Paste the simpleledger address from step 1 in to the 'To' field. Next type in the total amount of tokens that you wish to send in to the 'Amount' field and click 'Next'

Confirm input values

Confirm the last 4 digits of the simpleledger address are the same as from step 1. Also confirm the correct amount of tokens are being sent. Finally click the 'Confirm' button to send the tokens.

Switch to primary account

You should see your tokens disappear from your non-primary account. Using the dropdown menu next switch back to your primary account to confirm the tokens arrived.

Switch to secondary account

Once back on your primary account confirm the tokens arrived from the previous step. Next click your cashAddress to copy it to your clipboard and then via the dropdown menu switch back to a non primary account which has BCH.

Consolidate BCH

After switching to your non-primary account confirm BCH is selected and click 'Send'

Fill out form

First paste the cashAddress of your primary account in to the 'To' field. Next type in the amount. You want to send your total amount minus 0.00000500 BCH to handle any fees. Last click 'Next'

Confirm input values

On the confirmation screen first confirm the BCH is going to account 1. Then confirm it's the correct amount and click 'Confirm' to send the BCH to your primary account.

Success

You should now have your tokens and BCH consolidated on your primary account. Repeat the above steps for any other non-primary accounts which you need to consolidate.

I've already upgraded and I have a non primary account

If you have already upgraded before consolidating secondary accounts and now you're no longer seeing funds in your secondary accounts don't worry, your funds aren't lost! This section will show you how to install the previous build of Badger to consolidate funds.

First thing to notice after upgrading to Badger v0.6.0 is the bitcoincash and simpleledger addresses are no longer from the same HD Node. You can note that the first few characters after the prefix are no longer the same. This is because we are now deriving BCH addresses from the 145 path and token addresses from the 245 path—more technical info below.

From the drop down menu located at the top right click 'Create Account'

This will open the New Account page. Here leave the name as 'Account 2' and click 'Create'

After creating the first non-primary account notice the cashAddress and slpAddress aren't the same as your first secondary account before upgrading Badger. Also notice that you don't have any token or BCH balances.

Install Badger v0.5.1

You need to uninstall the latest version of Badger and re-install Badger v0.5.1. You can find Badger v0.5.1 builds for Chrome, Firefox, Edge and Opera. In this tutorial we'll show how to install on Chrome but the steps are similar for Firefox, Edge and Opera.

Chrome Extension

First load the following URL in Chrome: chrome://extensions/. Find 'Badger Wallet' v0.6.0 and click 'Remove.' Make sure you have your mnemonic backed up before removing Badger.

Enable Developer Mode

At the top part of the browser tab confirm that 'Developer Mode' is toggled on.

Load Unpacked

Next download Badger v0.5.1 for Chrome, Firefox, Edge or Opera. In this demo we're using Chrome. Once downloaded click 'Load Unpacked' and select the recently downloaded Badger directory.

Success

Now that you've downgraded to the recent build of Badger follow the steps I haven't yet upgraded and I have a non primary account .

Technical Details

Currently we store all utxo for BCH and SLP on m/44'/145'/0'/0/0. From the mnemonic we derive the HDNode at that path and display both the cashAddress and slpAddress.

SLP recently got the 245 derivation reserved in BIP44. Since our intention is for Badger to be fully HD, we're working on a change to send all slp change to the 245 slp address. We're also going to start displaying the 245 slp address for receiving tokens. We'll continue to check if a user has any token balance on 145, so that no existing integrations break, but we'll start displaying and using as change the 245 slp address.

Going forward our intention is to have Badger be fully HD per the BIP44 spec. We're going to use the following BCH and SLP derivation paths. In the following examples n would be incrementing to create a new address for each transaction.

BCH

  • External addresses: m/44'/145'/0'/0/n
  • Internal addresses: m/44'/145'/0'/1/n

SLP

  • External addresses: m/44'/245'/0'/0/n
  • Internal addresses: m/44'/245'/0'/1/n

Getting Started

Download

You can find Badger v0.5.1 builds for Chrome, Firefox, Edge and Opera.

Summary

The Badger ecosystem is growing quickly. Migrating our HD paths, though inconvenient, is something which we need to do in order to enable many more great features including the launch of Badger Mobile. If you have any questions please join our Discord or Telegram channels where we have hundreds of developers chatting around-the-clock.