synthetix-mintr icon indicating copy to clipboard operation
synthetix-mintr copied to clipboard

Add Live Derivation path for Ledger

Open 0xclem opened this issue 5 years ago • 3 comments

Ledger derives ETH addresses from two different paths:

  • Ledger Live: m/44'/60'/0'/0
  • Chrome apps/ Mew: m/44'/60'/0'

Right now we're only using Chrome/MEW. Ledger Live derivation needs to be added. I've recently made the change into synthetix-js so the Ledger constructor is able to take a custom derivation path parameter.

const LEDGER_DERIVATION_PATH = "44'/60'/0'/";

class LedgerSigner extends Signer {
  constructor({ provider, chainId, addressIndex, derivationPath } = {}) {
    super();
     ...
    this.derivationPath = derivationPath || LEDGER_DERIVATION_PATH;
  }

So it is now possible to do something like:

const signer = new snxJSConnector.signers['Ledger']({derivationPath: 'xx/xx/xx'})

Here's the design which means to be implemented in the Wallet selection screen:

Screen Shot 2019-11-18 at 1 57 28 pm

0xclem avatar Nov 18 '19 01:11 0xclem

@bachstatter I would say this one is probably highest priority as we've got lots of users asking for it in Discord.

0xclem avatar Nov 18 '19 03:11 0xclem

Screen Shot 2019-11-18 at 2 11 35 pm

@bachstatter here's the copy (I don't think it needs translation).

0xclem avatar Nov 18 '19 03:11 0xclem

I've tested minted and burning on both page one and page 2 with a trezor and it all seems to work fine!

0xjocke avatar Nov 20 '19 12:11 0xjocke