cosmos / ledger-cosmos-obsolete

Ledger Nano S support for Tendermint/Cosmos
Apache License 2.0
42 stars 29 forks source link

Add bech32 support + on-screen visualization #101

Closed jleni closed 5 years ago

jleni commented 5 years ago

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.

Optional:

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

Looking forward to your comments!

jleni commented 5 years ago

@fedekunze do you have some additional feedback on this?

cwgoes commented 5 years ago

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 commented 5 years ago

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:

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

zmanian commented 5 years ago

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 commented 5 years ago

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

jleni commented 5 years ago

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

zmanian commented 5 years ago

I guess that's a safe assumption. https://github.com/cosmos/cosmos-sdk/blob/develop/docs/spec/addresses/bech32.md

jleni commented 5 years ago

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

jleni commented 5 years ago

The first round is ready.

jleni commented 5 years ago

Update:

I would advise closing this issue if others agree

cwgoes commented 5 years ago

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