libp2p / libp2p/js-peer-id

Separate private keys from the peer id representation

Open
#148 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/discussion
Dominant language
JavaScript
Stars
81
Forks
42
PR merge metrics
No merged PRs in 30d

Description

PeerId's may or may not have a private key and we may need to detect this in other code.

The type of privKey is: public privKey: Uint8Array; , however currently the only way to workout if the peer id has a private key is to query peerId.privKey === undefined.

Alternatively we could document that checking whether peerId.privKey === undefined is a stable part of the API and update the types.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the current PeerId type and the privKey property, then search the repository for consumers that check whether privKey is undefined. Compare the two proposed API directions and verify whether the deprecated repository or its replacement is the intended place for the change. Done means the private-key presence is represented consistently and callers can detect it through a documented, typed API.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cryptography, networking
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.