Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

Add bech32 support + on-screen visualization #101

Closed
3 tasks done
jleni opened this issue Feb 4, 2019 · 11 comments
Closed
3 tasks done

Add bech32 support + on-screen visualization #101

jleni opened this issue Feb 4, 2019 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@jleni
Copy link
Member

jleni commented Feb 4, 2019

We would like to add support for bech32 addresses + on screen visualization.
This will require the following changes. We can plan for that in this issue.

  • Include Bech32 support
  • Ledger API (available to gaia-cli / voyager )
    • support to show on-screen the public key for a certain HD path
    • support to show on-screen the bech32 address for a certain HD path
  • Adjust corresponding clients
    • ledger-cosmos-go
    • ledger-cosmos-js

Optional:

  • Menu options?:
    • This requires a convenient way to navigate account/index, etc. It might be confusing and not easy to manage with just two buttons.
    • public key and address
    • scroll along the HD index?

Open questions
The following is an initial list of open questions that we need to address in order to finalize the spec:

  • HRP (Human readable part) handling
    • Is the HRP stored in the device or passed in every call?
    • Does the app has a default HRP="cosmos"?
    • How should we deal with different coins sharing the same HD path branches?
    • We assume that pub keys are HRP+"pub", etc.. the postfixes follow the SDK standard.

Looking forward to your comments!

@jleni
Copy link
Member Author

jleni commented Feb 4, 2019

@fedekunze do you have some additional feedback on this?

@jleni jleni changed the title Add bech32 support Add bech32 support + on-screen visualization Feb 4, 2019
@cwgoes
Copy link
Contributor

cwgoes commented Feb 4, 2019

The CLI/REST-side functionality shouldn't be a problem.

Can we make sure this works across networks? I guess setting the HRP every call would be one way to do that - but I wonder if that weakens security somewhat, if an application were to masquerade with another network's HRP. Storing the HRP on the device and allowing it to be set (perhaps with PIN entry) might be better in that aspect. I guess another question is whether we expect users to use the same Cosmos app for several Cosmos networks, or install one app instance per network (in which case we could set the HRP in the app directly, although that would require some cooperation from the Ledger store).

@jleni
Copy link
Member Author

jleni commented Feb 4, 2019

Yes, that was something we discussed with @jackzampolin.

When a ledger app is published, the first X items in the HD path are fixed and restricted by a ledger certificate/signature.

Cosmos networks are not indicated in the HD path, so the cosmos app with access to 44'/118'/.... can sign any cosmos network.

With respect to HRP. We could pass on calls but it is important to keep in mind that:

  • network X, hrp: 'netx' path 44'/118'/0'/0/0
  • network Y, hrp: 'nety' path 44'/118'/0'/0/0

will share the same public/private keys but their bech32 addresses will look different.

@zmanian
Copy link
Member

zmanian commented Feb 4, 2019

We largely expect that keys will be portable between Cosmos networks. It's possibly that other chains will keep the same HRPs.

I'm trying to think if changing the HRP is a viable mechanism for an attack. My sense is that the HRP is not an attack surface and it would simplify things for app developers if the app accepts any HRP sent by an app.

@zmanian
Copy link
Member

zmanian commented Feb 4, 2019

We probably need to have an API that enables send 2 HRPs. 1 for addresses and 1 for public keys.

@jleni
Copy link
Member Author

jleni commented Feb 4, 2019

I thought we could use a base HRP and others are created by concatenating: HRP+"pub", etc.

@zmanian
Copy link
Member

zmanian commented Feb 4, 2019

@jleni
Copy link
Member Author

jleni commented Feb 12, 2019

As discussed in Slack, only addresses will be shown in the user app.

@jleni
Copy link
Member Author

jleni commented Feb 15, 2019

The first round is ready.

@jleni
Copy link
Member Author

jleni commented Feb 28, 2019

Update:

I would advise closing this issue if others agree

@jleni jleni added the enhancement New feature or request label Mar 1, 2019
@cwgoes
Copy link
Contributor

cwgoes commented Mar 11, 2019

Agreed (I don't have permissions to close it) - thanks @jleni.

@jleni jleni closed this as completed Mar 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants