Skip to content

Add support for signing messages using LedgerHQ wallet on Ethereum #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 24, 2023

Conversation

hoh
Copy link
Member

@hoh hoh commented Aug 19, 2023

The ability to use private keys stored on a hardware wallet to sign messages would greatly enhance the security of the network, especially since messages can be amended and the virtual machines will potentially have many side effects.

The command / response scheme used by LedgerHQ to address the device is similar to the ISO/IEC 7816-4 smartcard protocol. Each command / response packet is called an APDU (application protocol data unit).

Each APDU is specific to Ledger application, that adds the support for a chain or functionality.

The library ledgereth implements the LedgerHQ ADPU for the Ethereum application.

This branch adds support in the SDK.

Usage:

>>> import asyncio
>>> from aleph.sdk.client import AuthenticatedAlephClient
>>> from aleph.sdk.wallets.ledger.ethereum import LedgerETHAccount
>>> account = LedgerETHAccount.from_address("0x...")
>>> client = AuthenticatedAlephClient(account=account, api_server="https://api2.aleph.im")
>>> await client.create_post(post_content="coucou", post_type="ALEPH_TEST")

Related to aleph-im/aleph-client#13

@hoh hoh added the enhancement New feature or request label Aug 19, 2023
@hoh hoh force-pushed the hoh-ledger-eth branch 2 times, most recently from 558d7cc to 3bc113c Compare August 19, 2023 15:51
Users could not use Ledger hardware wallets to sign messages using an Ethereum key.

The command / response scheme used by Ledger to address the device is similar to the ISO/IEC 7816-4 smartcard protocol. Each command / response packet is called an APDU (application protocol data unit).

Each APDU is specific to Ledger application, that adds the support for a chain or functionality.

Solution: Use the Ledgereth library to send the Ethereum APDUs via ledgerblue.
hoh and others added 2 commits August 22, 2023 17:46
@hoh hoh requested a review from odesenfans August 23, 2023 15:28
@hoh hoh merged commit 6705f95 into main Aug 24, 2023
@hoh hoh deleted the hoh-ledger-eth branch August 24, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants