Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/api/v0/id/genfrompk ? #6152

Closed
reardenlife opened this issue Mar 28, 2019 · 1 comment
Closed

/api/v0/id/genfrompk ? #6152

reardenlife opened this issue Mar 28, 2019 · 1 comment

Comments

@reardenlife
Copy link

PULL REQUEST proposal

There seems to be no strict policy on such basic things as a generation of PeerId ( #6133 ) meaning that if I am attempting to generate peer id on my own (see below), there will be no guarantee that my code will not break with a next IPFS update.

// recovery of public key from ethereum transaction
  pkbin, err := secp256k1.RecoverPubkey(msg, sig)
  check(err)

// generation of a peerid from the recovered PK
        pk, err := UnmarshalSecp256k1PublicKey(pkbin)
        check(err)

  pid, err := peer.IDFromPublicKey(pk)
  check(err)
  fmt.Println(pid.Pretty())

So it would be great to put all that code on PeerId generation into the IPFS and provide an interface to obtain the PeerId from public key.

Please let me know if you agree so I will write the code.

@reardenlife reardenlife mentioned this issue Apr 2, 2019
9 tasks
@Stebalien
Copy link
Member

So, we're trying to work out the policy, that's why this is changing. I'm not sure adding an API to work around what's effectively a temporary bug is the best idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants