{"id":15292399,"url":"https://github.com/metamask/eth-ledger-bridge-keyring","last_synced_at":"2025-04-04T23:07:27.262Z","repository":{"id":32870572,"uuid":"144436858","full_name":"MetaMask/eth-ledger-bridge-keyring","owner":"MetaMask","description":"A wrapper around LedgerJS libraries, to support the KeyringController protocol used by MetaMask","archived":false,"fork":false,"pushed_at":"2024-04-11T12:29:22.000Z","size":13402,"stargazers_count":78,"open_issues_count":25,"forks_count":91,"subscribers_count":47,"default_branch":"main","last_synced_at":"2024-04-14T10:47:52.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MetaMask.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":"metamask","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-08-12T04:11:01.000Z","updated_at":"2024-06-18T18:14:05.830Z","dependencies_parsed_at":"2023-10-26T19:32:59.173Z","dependency_job_id":"6af3bd39-bc52-41c2-8d91-cd3e67839183","html_url":"https://github.com/MetaMask/eth-ledger-bridge-keyring","commit_stats":{"total_commits":95,"total_committers":19,"mean_commits":5.0,"dds":0.8631578947368421,"last_synced_commit":"2b9272877b82527d6294a1974192e12c513319e3"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaMask%2Feth-ledger-bridge-keyring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaMask%2Feth-ledger-bridge-keyring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaMask%2Feth-ledger-bridge-keyring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MetaMask%2Feth-ledger-bridge-keyring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MetaMask","download_url":"https://codeload.github.com/MetaMask/eth-ledger-bridge-keyring/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261603,"owners_count":20910108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-30T16:17:42.184Z","updated_at":"2025-04-04T23:07:27.241Z","avatar_url":"https://github.com/MetaMask.png","language":"TypeScript","funding_links":["https://opencollective.com/metamask"],"categories":[],"sub_categories":[],"readme":"# eth-ledger-bridge-keyring [![CircleCI](https://circleci.com/gh/MetaMask/eth-ledger-bridge-keyring.svg?style=svg)](https://circleci.com/gh/MetaMask/eth-ledger-bridge-keyring)\n\n\u003e [!WARNING]\n\u003e This package has been moved into a\n\u003e [new monorepo](https://github.com/MetaMask/accounts/tree/main/packages/keyring-eth-ledger-bridge).\n\u003e This repository is no longer in use, and pull requests will no longer be accepted.\n\nAn implementation of MetaMask's [Keyring interface](https://github.com/MetaMask/eth-simple-keyring#the-keyring-class-protocol), that uses a Ledger hardware wallet for all cryptographic operations.\n\nIn most regards, it works in the same way as\n[eth-hd-keyring](https://github.com/MetaMask/eth-hd-keyring), but using a Ledger\ndevice. However there are a number of differences:\n\n- Because the keys are stored in the device, operations that rely on the device\n  will fail if there is no Ledger device attached, or a different Ledger device\n  is attached.\n\n- It does not support the `signMessage`, `signTypedData` or `exportAccount`\n  methods, because Ledger devices do not support these operations.\n\n- Because extensions have limited access to browser features, there's no easy way to interact wth the Ledger Hardware wallet from the MetaMask extension. This library implements a workaround to those restrictions by injecting (on demand) an iframe to the background page of the extension, (which is hosted [here](https://metamask.github.io/eth-ledger-bridge-keyring/index.html).\n\nThe iframe is allowed to interact with the Ledger device (since U2F requires SSL and the iframe is hosted under https) using the libraries from [LedgerJS](https://github.com/LedgerHQ/ledgerjs) _hw-app-eth_ and _hw-transport-u2f_ and establishes a two-way communication channel with the extension via postMessage.\n\nThe iframe code it's hosted in the same repo under the branch [gh-pages](https://github.com/MetaMask/eth-ledger-bridge-keyring/tree/gh-pages) and it's being served via github pages. In the future we might move it under the metamask.io domain.\n\n## Usage\n\nIn addition to all the known methods from the [Keyring class protocol](https://github.com/MetaMask/eth-simple-keyring#the-keyring-class-protocol),\nthere are a few others:\n\n- **isUnlocked** : Returns true if we have the public key in memory, which allows to generate the list of accounts at any time\n\n- **unlock** : Connects to the Ledger device and exports the extended public key, which is later used to read the available ethereum addresses inside the Ledger account.\n\n- **setAccountToUnlock** : the index of the account that you want to unlock in order to use with the signTransaction and signPersonalMessage methods\n\n- **getFirstPage** : returns the first ordered set of accounts from the Ledger account\n\n- **getNextPage** : returns the next ordered set of accounts from the Ledger account based on the current page\n\n- **getPreviousPage** : returns the previous ordered set of accounts from the Ledger account based on the current page\n\n- **forgetDevice** : removes all the device info from memory so the next interaction with the keyring will prompt the user to connect the Ledger device and export the account information\n\n## Testing and Linting\n\nRun `yarn test` to run the tests once. To run tests on file changes, run `yarn test:watch`.\n\nRun `yarn lint` to run the linter, or run `yarn lint:fix` to run the linter and fix any automatically fixable issues.\n\n## Attributions\n\nThis code was inspired by [eth-ledger-keyring](https://github.com/jamespic/eth-ledger-keyring) and [eth-hd-keyring](https://github.com/MetaMask/eth-hd-keyring)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetamask%2Feth-ledger-bridge-keyring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetamask%2Feth-ledger-bridge-keyring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetamask%2Feth-ledger-bridge-keyring/lists"}