{"id":26665316,"url":"https://github.com/elsehow/identity-swarm","last_synced_at":"2025-10-04T03:03:27.245Z","repository":{"id":57271216,"uuid":"54220854","full_name":"elsehow/identity-swarm","owner":"elsehow","description":"a keyring around a hyperlog","archived":false,"fork":false,"pushed_at":"2016-04-03T20:14:33.000Z","size":2069,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T05:41:56.972Z","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":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elsehow.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":"2016-03-18T17:49:38.000Z","updated_at":"2017-08-29T11:56:23.000Z","dependencies_parsed_at":"2022-09-06T21:52:50.145Z","dependency_job_id":null,"html_url":"https://github.com/elsehow/identity-swarm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elsehow/identity-swarm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elsehow%2Fidentity-swarm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elsehow%2Fidentity-swarm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elsehow%2Fidentity-swarm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elsehow%2Fidentity-swarm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elsehow","download_url":"https://codeload.github.com/elsehow/identity-swarm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elsehow%2Fidentity-swarm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265934197,"owners_count":23852087,"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":"2025-03-25T17:36:49.829Z","updated_at":"2025-10-04T03:03:27.150Z","avatar_url":"https://github.com/elsehow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# identity-swarm\n\na p2p, distributed keyring around a [swarmlog][0]\n\nusers can add their public key, and associate it with an arbitrary JSON payload, which is signed and verified on read/write\n\n## usage\n\nfirst generate some ed25519 keys:\n\n    $ node -pe \"JSON.stringify(require('ssb-keys').generate())\" \u003e keys.json\n\nnow, make a new keyring: \n\n```javascript\nvar idswarm = require('identity-swarm')\nvar keypair = require('keypair')\n\nvar keyring = idswarm({\n  keys: require('./keys.json'),\n  db: requrie('memdb')(),\n  hubs: [ 'https://signalhub.mafintosh.com' ]\n}, (identity) =\u003e {\n\tconsole.log('i see a new identity!', identity)\n})\n\nkeyring.add(keypair(), 'RSA-SHA256', {handle: 'mminsky'})\n\n// \u003e i see a new identity! {pubkey: ..} \n\n```\n\n## api\n\n### keyring(opts, newIdentityCb)\n\nmake a new keyring. available options:\n\n* `opts.keys`: ed25519 keys of the form `{public, private}`. if you are starting a new keyring, you can `npm run generate-keys` to create a new keypair in test/keys.json.\n\n* `opts.hubs` - array of [signalhub][1] hubs to use\n\n* `opts.db` - a [leveldb][2] instance (use [level-browserify][3] in the browser)\n\n`newIdentityCb` will be called whenever a new, *verified* identity comes over the log.\n\n### keyring.add(keypair, keytype, payload, [cb])\n\nposts `keypair.public` to the keyring\n\n`keytype` is a string referring to the algo. for now, only `'RSA-SHA256'` has been tested.\n\n`payload` can be arbitrary json.  `payload` is signed with `keypair.private`. the private key is *NOT* posted to the keyring!\n\n`cb(err, res)` (optional) is called when the keypair is added to the log.\n\n## background\n\nsee [hyperchat/#10](https://github.com/elsehow/hyperchat2/issues/10)\n\nthere are an [increasing](https://github.com/moose-team/friends/)\n[number](https://github.com/haadcode/orbit) \nof p2p conent sharing schemes out there\n\n[scuttlebutt](https://scuttlebot.io) is particularly interesting, as it provides a distributed, unforgeable feed of messages. scuttlebutt allows for identity discovery within social networks, and can help provide an added layer of social proof when you're deciding to trust a new key \n\nhowever, one still might want to address a message to someone outside of their social network, and for that we need a global key discovery.\n\nthis project works as a distributed, shared keyring, to which anyone can append their public key, and associate it with arbitrary other information, stored as a json payload.\n\n## developing\n\n`test/test.js` contains tests and specs. to develop,\n\n\tnpm run dev\n\nnavigate to localhost:8000 to see the results of the tests \n\n## license\n\nBSD\n\n[0]: https://github.com/substack/swarmlog\n[1]: https://npmjs.com/package/signalhub\n[2]: https://npmjs.com/package/levelup\n[3]: https://npmjs.com/package/level-browserify\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felsehow%2Fidentity-swarm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felsehow%2Fidentity-swarm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felsehow%2Fidentity-swarm/lists"}