{"id":22237483,"url":"https://github.com/bajetech/digitalbits-hd-wallet","last_synced_at":"2025-07-07T20:14:32.563Z","repository":{"id":39180199,"uuid":"404463595","full_name":"bajetech/digitalbits-hd-wallet","owner":"bajetech","description":"🔐  Key derivation for the DigitalBits blockchain (based on Stellar's SEP-0005)  🚀","archived":false,"fork":false,"pushed_at":"2023-03-01T14:58:40.000Z","size":534,"stargazers_count":2,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-09T19:19:15.612Z","etag":null,"topics":["bip39","cryptocurrencies","digitalbits","ed25519","javascript","keys","nodejs","sep-0005"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@bajetech/digitalbits-hd-wallet","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bajetech.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":null,"security":null,"support":null}},"created_at":"2021-09-08T19:01:50.000Z","updated_at":"2022-05-24T08:31:10.000Z","dependencies_parsed_at":"2023-02-17T06:15:50.121Z","dependency_job_id":null,"html_url":"https://github.com/bajetech/digitalbits-hd-wallet","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bajetech%2Fdigitalbits-hd-wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bajetech%2Fdigitalbits-hd-wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bajetech%2Fdigitalbits-hd-wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bajetech%2Fdigitalbits-hd-wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bajetech","download_url":"https://codeload.github.com/bajetech/digitalbits-hd-wallet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227843600,"owners_count":17827987,"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":["bip39","cryptocurrencies","digitalbits","ed25519","javascript","keys","nodejs","sep-0005"],"created_at":"2024-12-03T03:10:06.268Z","updated_at":"2024-12-03T03:10:12.342Z","avatar_url":"https://github.com/bajetech.png","language":"JavaScript","readme":"# digitalbits-hd-wallet\n\n\u003e 🔐 Key derivation for the DigitalBits blockchain (based on Stellar's [SEP-0005](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0005.md)) 🚀\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@bajetech/digitalbits-hd-wallet\"\u003e\n    \u003cimg alt=\"npm (scoped)\" src=\"https://img.shields.io/npm/v/@bajetech/digitalbits-hd-wallet?style=for-the-badge\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://nodejs.org\"\u003e\n    \u003cimg alt=\"Node.js\" src=\"https://img.shields.io/badge/node-\u003e=12-yellowgreen?style=for-the-badge\u0026labelColor=000000\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/bajetech/digitalbits-hd-wallet/actions/workflows/pipeline.yml\"\u003e\n    \u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/workflow/status/bajetech/digitalbits-hd-wallet/digitalbits-hd-wallet%20CI?label=GitHub%20Actions\u0026logo=github\u0026style=for-the-badge\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## IMPORTANT NOTICE\n\n**Update to v1.1.0 or higher**: Versions of this package prior to v1.1.0 are broken! It is very likely that if you attempt to use a pre-1.1.0 release of this package in your projects, they will NOT run! Please be sure to update to v1.1.0 or higher for a working release.\n\n## Installation\n\n```bash\nyarn add @bajetech/digitalbits-hd-wallet  # or npm i @bajetech/digitalbits-hd-wallet\n```\n\n## Usage\n\n```js\nimport DigitalBitsHDWallet from \"@bajetech/digitalbits-hd-wallet\";\n\nconst mnemonic = DigitalBitsHDWallet.generateMnemonic();\nconst wallet = DigitalBitsHDWallet.fromMnemonic(mnemonic);\n\nwallet.getPublicKey(0); // =\u003e GDKYMXOAJ5MK4EVIHHNWRGAAOUZMNZYAETMHFCD6JCVBPZ77TUAZFPKT\nwallet.getSecret(0); // =\u003e SCVVKNLBHOWBNJYHD3CNROOA2P3K35I5GNTYUHLLMUHMHWQYNEI7LVED\nwallet.getKeypair(0); // =\u003e DigitalBitsBase.Keypair for account 0\nwallet.derive(`m/44'/148'/0'`); // =\u003e raw key for account 0 as a Buffer\n\n// wallet instance from seeds\nconst seedHex =\n  \"794fc27373add3ac7676358e868a787bcbf1edfac83edcecdb34d7f1068c645dbadba563f3f3a4287d273ac4f052d2fc650ba953e7af1a016d7b91f4d273378f\";\nconst seedBuffer = Buffer.from(seedHex);\nDigitalBitsHDWallet.fromSeed(seedHex);\nDigitalBitsHDWallet.fromSeed(seedBuffer);\n\n// mnemonics with different lengths\nDigitalBitsHDWallet.generateMnemonic(); // 24 words\nDigitalBitsHDWallet.generateMnemonic({ entropyBits: 224 }); // 21 words\nDigitalBitsHDWallet.generateMnemonic({ entropyBits: 160 }); // 18 words\nDigitalBitsHDWallet.generateMnemonic({ entropyBits: 128 }); // 12 words\n\n// validate a mnemonic\nDigitalBitsHDWallet.validateMnemonic(\"too short and non wordlist words\"); // false\n```\n\n## Mnemonic Language\n\nMnemonics can be generated in any language supported by the underlying [bip39 npm module](https://github.com/bitcoinjs/bip39).\n\nThe full list of language keys are under exports 'wordlists' [here](https://github.com/bitcoinjs/bip39/blob/master/index.js).\n\n### Usage\n\n```js\nimport DigitalBitsHDWallet from \"@bajetech/digitalbits-hd-wallet\";\n\n// traditional chinese - 24 words\nDigitalBitsHDWallet.generateMnemonic({\n  language: \"chinese_traditional\",\n});\n// =\u003e '省 从 唯 芽 激 顿 埋 愤 碳 它 炸 如 青 领 涨 骤 度 牲 朱 师 即 姓 讲 蒋'\n\n// french - 12 words\nDigitalBitsHDWallet.generateMnemonic({ language: \"french\", entropyBits: 128 });\n// =\u003e 'directif terrible légume dérober science vision venimeux exulter abrasif vague mutuel innocent'\n```\n\n## Randomness\n\n- NodeJs: crypto.randomBytes\n- Browser: window.crypto.getRandomValues\n\n(using [randombytes npm module](https://github.com/crypto-browserify/randombytes))\n\n## TypeScript Support\n\nMany thanks to [Kyle Roach](https://github.com/iRoachie) for converting this library to [TypeScript](https://www.typescriptlang.org) via the following [PR](https://github.com/bajetech/digitalbits-hd-wallet/pull/3). TypeScript support is now available as of version **1.2.0**.\n\n## Tests\n\nAll [SEP-0005 test cases](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0005.md#test-cases) are exercised [here](https://github.com/bajetech/digitalbits-hd-wallet/blob/main/test/sep0005.test.js) against [these](https://github.com/bajetech/digitalbits-hd-wallet/tree/main/test/data).\n\n## Credits\n\nThis package was cloned and adapted from [`stellar-hd-wallet`](https://github.com/chatch/stellar-hd-wallet) for use with the [DigitalBits blockchain network](https://digitalbits.io), which is itself adapted from the [Stellar blockchain network](https://www.stellar.org).\n\nSpecifically the following differences from `stellar-hd-wallet` are worthy of mention:\n\n- GitHub Actions is used for a CI workflow instead of Travis CI.\n- All _direct_ package dependencies and dev dependencies are brought up-to-date and the code modified where necessary to use up-to-date APIs.\n- The `xdb-digitalbits-base` package is used instead of `stellar-base`.\n- As of version 1.2.0 the package is written in TypeScript, with built-in TypeScript definitions exported.\n- Yarn is used as the package manager of choice for development of this library.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbajetech%2Fdigitalbits-hd-wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbajetech%2Fdigitalbits-hd-wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbajetech%2Fdigitalbits-hd-wallet/lists"}