uniVocity / envlp-cardano-wallet

Apache License 2.0
24 stars 8 forks source link

Add support for Ledger and Trezor devices #1

Open jbax opened 3 years ago

jbax commented 3 years ago

Investigate how to enable support for Ledger hardware wallets. The client code could look something like this:

LedgerWallet wallet = server.wallets()
    .createOrGet("myLedgerWallet")
    .shelley()
    .fromLedger();

It looks like there is some interaction with the following endpoint of the cardano-wallet:

https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Keys

The library already has code that interacts with this endpoint, but it's not clear yet how that is used to enable communication with hardware wallets.

    public void testShelleyWalletGetPublicKey() {
        assertEquals(shelleyWallet.keys().externalUtxoPublicKey(0), "addr_vk1pqkrxdfnuq43gkjq5qdgfyuvj29569njywst5w46lkzzrjazy5rselayhc");
        assertEquals(shelleyWallet.keys().internalUtxoPublicKey(0), "addr_vk1k96j9609ukthxtnq0te87yh7jvhq2d6q6vkyzwmgdw84f9uk3xdq2kh9hy");
        assertEquals(shelleyWallet.keys().mutableAccountPublicKey(0), "stake_vk13s9ax57ttljfuak6w95lae2vvuwp29zhvvyu7t3uj343kv0zuhmq7lq973");
        assertEquals(shelleyWallet.keys().multiSigPublicKey(0), "script_vk129zt5mee3qdzjlf2980yw02aq9q7e2alpqzc8artwdnzt2mchj9svkhawu");
    }

This looks like the way to go:

There are also a few projects in the cardano-foundation repository that seem to be used by daedalus:

I think the easiest way to go about this is to check out what daedalus does by inspecting its code, otherwise simply getting the cardano-hw-cli and invoking the commands via CLI should work just fine.

Daniel-SchaeferJ commented 3 years ago

@jbax I added a project board, mind taking a look at it to edit it/provide feedback to make sure this is what is desired?

https://github.com/Daniel-SchaeferJ/envlp-cardano-wallet/projects/2

jbax commented 3 years ago

Yes but I'm hoping a big chunk of that work is already done by the cardano wallet backend.

What needs to be done first is:

On Sat, Jan 9, 2021, 6:01 AM Daniel Schaefer notifications@github.com wrote:

@jbax https://github.com/jbax I added a project board, mind taking a look at it to edit it/provide feedback to make sure this is what is desired?

https://github.com/Daniel-SchaeferJ/envlp-cardano-wallet/projects/2

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/uniVocity/envlp-cardano-wallet/issues/1#issuecomment-756952403, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWFQPS5Q2BOAOKJHY3D5J3SY5MRDANCNFSM4UQGFZ6Q .