{"id":26241481,"url":"https://github.com/witnet/ts-slip32","last_synced_at":"2025-10-08T19:53:46.498Z","repository":{"id":57363252,"uuid":"136718443","full_name":"witnet/ts-slip32","owner":"witnet","description":"TypeScript implementation of the SLIP-0032 extended serialization format for BIP-32 wallets","archived":false,"fork":false,"pushed_at":"2018-06-22T10:34:13.000Z","size":80,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-02T16:49:30.868Z","etag":null,"topics":["bech32","bip32","bitcoin","blockchain","hd-wallet","satoshilabs","slip-0032","witnet"],"latest_commit_sha":null,"homepage":"https://github.com/satoshilabs/slips/blob/master/slip-0032.md","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/witnet.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-06-09T11:43:58.000Z","updated_at":"2021-06-11T02:56:03.000Z","dependencies_parsed_at":"2022-09-06T22:21:59.121Z","dependency_job_id":null,"html_url":"https://github.com/witnet/ts-slip32","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/witnet%2Fts-slip32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/witnet%2Fts-slip32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/witnet%2Fts-slip32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/witnet%2Fts-slip32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/witnet","download_url":"https://codeload.github.com/witnet/ts-slip32/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710435,"owners_count":21149189,"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":["bech32","bip32","bitcoin","blockchain","hd-wallet","satoshilabs","slip-0032","witnet"],"created_at":"2025-03-13T08:30:37.793Z","updated_at":"2025-10-08T19:53:41.467Z","avatar_url":"https://github.com/witnet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003ets-slip32\u003c/h1\u003e\n\n\u003cdiv\u003e\n    \u003ca href=\"https://gitter.im/witnet/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\u003e\u003cimg src=\"https://badges.gitter.im/witnet/community.svg\" alt=\"Join the chat at https://gitter.im/witnet/community\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://travis-ci.org/witnet/ts-slip32\"\u003e\u003cimg src=\"https://travis-ci.org/witnet/ts-slip32.svg?branch=master\" alt=\"Build Status\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/witnet/ts-slip32/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/witnet/ts-slip32.svg\" alt=\"MIT\" /\u003e\u003c/a\u003e\n    \u003cbr /\u003e\u003cbr /\u003e\n    \u003cp\u003e\u003cstrong\u003ets-slip32\u003c/strong\u003e is a typescript implementation of the SLIP-0032 extended serialization format for BIP-32 wallets.\u003c/p\u003e\n\u003c/div\u003e\n\n## Installation\n\nFrom npm:\n```bash\nnpm install slip32\n```\n\nFrom git:\n```bash\ngit clone https://github.com/witnet/ts-slip32.git\ncd ts-slip32\nyarn\nyarn build\n```\n\n## Usage\n\nThe main two functions are described in `slip32.d.ts`:\n```typescript\n/**\n * Import key from Slip32 format\n * @param {string} slip32\n * @returns {{keyPath: KeyPath; extendedKey: ExtendedKey\u003cPrivateKey | PublicKey\u003e}}\n */\nexport declare const importKeyFromSlip32: (slip32: string) =\u003e {\n    keyPath: number[];\n    extendedKey: ExtendedKey\u003cPrivateKey | PublicKey\u003e;\n};\n\n/**\n * Export key to Slip32 format\n * @param {KeyPath} keyPath\n * @param {ExtendedKey\u003cPrivateKey\u003e | ExtendedKey\u003cPublicKey\u003e} extendedKey\n * @returns {string}\n */\nexport declare const exportKeyToSlip32: (keyPath: number[], extendedKey: ExtendedKey\u003cPrivateKey | PublicKey\u003e) =\u003e string;\n```\n\nThe aforementioned functions use the following interfaces and types, defined in `keys.d.ts`:\n\n```typescript\n/**\n * Key interface\n * The buffer should have a length of 32 bytes\n */\nexport interface Key {\n    bytes: Uint8Array;\n}\n\n/**\n * Chain code (32 bytes)\n */\nexport declare type ChainCode = Uint8Array;\n\n/**\n * Private Key (33 bytes)\n */\nexport interface PrivateKey extends Key {\n    type: \"private\";\n}\n\n/**\n * Public Key (33 bytes)\n */\nexport interface PublicKey extends Key {\n    type: \"public\";\n}\n\n/**\n * Extended keys, as introduced by BIP-0032, pair a key with a chain code\n */\nexport declare type ExtendedKey\u003cKey\u003e = {\n    key: Key;\n    chainCode: ChainCode;\n};\n```\n\n## Example\n\n```typescript\nimport * as Slip32 from \"slip32\"\n\nconst keyToImport = \"xprv1qxqqqqqq78qr7hlewyyfzt74vasa87k63pu7g9e6hfzlzrdyh0v5k8zfw9sqpsyv7vcejeyzcpkm85jel7vmujlhpquzf4f3sh3nry0w0n4jh7t0jhc039\"\n\n// Import key as {keyPath: KeyPath, extendedKey: ExtendedKey\u003cPrivateKey | PublicKey\u003e}\nconst importedKey = Slip32.importKeyFromSlip32(keyToImport)\n\n// Export key as string\nconst exportedKey = Slip32.exportKeyToSlip32(importedKey.keyPath, importedKey.extendedKey)\n```\n\n## License\nThis library is free and open-source software released under the [MIT](LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwitnet%2Fts-slip32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwitnet%2Fts-slip32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwitnet%2Fts-slip32/lists"}