{"id":18556761,"url":"https://github.com/urbit/urbit-key-generation","last_synced_at":"2025-04-10T01:31:32.228Z","repository":{"id":35098331,"uuid":"143151122","full_name":"urbit/urbit-key-generation","owner":"urbit","description":"Key derivation and HD wallet generation functions for Urbit","archived":false,"fork":false,"pushed_at":"2023-01-06T01:35:09.000Z","size":2732,"stargazers_count":15,"open_issues_count":4,"forks_count":8,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-03T01:35:29.975Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/urbit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","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-08-01T12:09:56.000Z","updated_at":"2024-10-09T02:46:48.000Z","dependencies_parsed_at":"2023-01-15T13:48:53.633Z","dependency_job_id":null,"html_url":"https://github.com/urbit/urbit-key-generation","commit_stats":null,"previous_names":["urbit/keygen-js"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Furbit-key-generation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Furbit-key-generation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Furbit-key-generation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urbit%2Furbit-key-generation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urbit","download_url":"https://codeload.github.com/urbit/urbit-key-generation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248140368,"owners_count":21054287,"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-11-06T21:33:10.928Z","updated_at":"2025-04-10T01:31:27.215Z","avatar_url":"https://github.com/urbit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# urbit-key-generation\n\n[![Build Status](https://secure.travis-ci.org/urbit/urbit-key-generation.png)](http://travis-ci.org/urbit/urbit-key-generation)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![npm](https://img.shields.io/npm/v/urbit-key-generation.svg)](https://www.npmjs.com/package/urbit-key-generation)\n\nKey derivation and HD wallet generation functions for Urbit.\n\n## Install\n\nGrab it from npm like so:\n\n```\nnpm install urbit-key-generation\n```\n\nTo include in your node project, use:\n\n``` javascript\nconst kg = require('urbit-key-generation')\n```\n\nTo use in the browser, you can use e.g. [rollup][roll] and the\n[rollup-plugin-node-resolve][rpnr] plugin, and specify the following in your\n`rollup.config.js` or similar:\n\n``` javascript\nplugins: [\n  ..,\n  resolve({\n    browser: true,\n  }),\n  ..\n]\n```\n\n## Usage\n\nYou will probably be interested in the `generateWallet` function, which\ngenerates a HD wallet for Urbit keys.  It expects an object argument containing\nthe following properties:\n\n* `ticket`, a 64, 128, or 384-bit `@q` master ticket (you can use e.g. the\n  appropriate `patq` functions from [urbit-ob][urbo] to create these from\n  decimal or hex strings).\n* `ship`, an Urbit ship number between 0 and 2^32 - 1.\n* `passphrase`, an optional passphrase used to salt seeds derived from BIP39\n  mnemonics.\n* `revision`, an optional number used to salt network seeds derived from a\n  management seed.  Defaults to `0`.\n* `boot`, an optional flag that indicates whether or not to generate Urbit\n  network keys for the provided ship.  Defaults to `false`.\n\n`generateWallet` returns a Promise, so you can deal with it as follows, for\nexample:\n\n``` javascript\nlet config = {\n  ticket: '~marbud-tidsev-litsut-hidfep',\n  ship: 65012,\n  boot: true\n}\n\nlet wallet = await generateWallet(config)\n```\n\nThis library also contains functionality for generating Arvo keyfiles, via\n`generateKeyfile`, as well as web UI login codes (`|code` in :dojo), via\n`generateCode`.\n\nWhen using these functions to derive outputs for an on-chain ship, ensure that\nyou're actually passing them the ship's *current* keypair, which usually\ninvolves specifying the ship's `%life` as the 'revision' parameter.\n\n## Security\n\nTlon runs a [bug bounty program][bugs].  If you believe you've discovered a\nvulnerability anywhere in this implementation, you can disclose it privately to\n[security@tlon.io][sect].\n\n## Dev\n\nBefore making a PR, you should create an updated browser bundle (generated via\n`npm run-script build`).\n\nYou can run the test suite with a simple `npm test`.\n\n[urbo]: https://www.npmjs.com/package/urbit-ob\n[roll]: https://rollupjs.org/guide/en\n[rpnr]: https://github.com/rollup/rollup-plugin-node-resolve\n[bugs]: https://urbit.org/bounties/\n[sect]: mailto:security@tlon.io\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbit%2Furbit-key-generation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furbit%2Furbit-key-generation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furbit%2Furbit-key-generation/lists"}