Skip to content
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

Ledger Signer #1185

Merged
merged 2 commits into from
Jul 26, 2024
Merged

Ledger Signer #1185

merged 2 commits into from
Jul 26, 2024

Conversation

PhilippeR26
Copy link
Collaborator

Motivation and Resolution

Solves #1168
LedgerTitle
As Starknet is now handled by the Ledger Nano S+ / X, we can create a signer that handle the private keys of this hardware wallet.

Usage related changes

After installing the Starknet Ledger DAPP in your Ledger, you can use the Ledger as signer.
The way to proceed depends of the type of connection, and of the framework used (see the guide for more details).
For example, in a Node script, using a Ledger Nano + :

import TransportNodeHid from '@ledgerhq/hw-transport-node-hid';
const myLedgerTransport: Transport = await TransportNodeHid.create();
const myLedgerSigner = new LedgerSigner(myLedgerTransport, 0);
const pubK = await myLedgerSigner.getPubKey();
const fullPubK = await myLedgerSigner.getFullPubKey();
// ...
// deploy here an account related to this public key
// ...
const ledgerAccount = new Account(myProvider, ledger0addr, myLedgerSigner);

Then you can use all usual methods of the Account class. When a signature is necessary, a message is displayed on the Ledger screen, and a manual validation is requested.
By this way, the private key of the account is never exposed.

The signature guide has been amended to include the Ledger Signer.

Development related changes

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Linked the issues which this PR resolves
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

@PhilippeR26 PhilippeR26 requested a review from tabaktoni July 24, 2024 18:14
Copy link
Collaborator

@tabaktoni tabaktoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇 LFG
LGTM!

@tabaktoni tabaktoni requested a review from penovicp July 25, 2024 15:20
@tabaktoni tabaktoni changed the base branch from develop to next-version July 26, 2024 11:08
@tabaktoni tabaktoni merged commit 6e5e89a into starknet-io:next-version Jul 26, 2024
1 check passed
Copy link

🎉 This issue has been resolved in version 6.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants