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

ECC PeerIds messed up again! #6133

Closed
reardenlife opened this issue Mar 27, 2019 · 8 comments
Closed

ECC PeerIds messed up again! #6133

reardenlife opened this issue Mar 27, 2019 · 8 comments
Labels
kind/bug A bug in existing code (including security flaws) status/duplicate This issue or pull request already exists

Comments

@reardenlife
Copy link

reardenlife commented Mar 27, 2019

On the version v0.4.19-dev, the peerids generated from ECC keys were looking like that:

[root@v48807 dompoc]# ipfs key list -l
QmQBojsRJJrwvqDdbmWbmbZ7GCTnhHmzri5DhEqLP2zVXq self
QmafEdQrhntRYzKu3V2Mn4Rd21Px9Hpfgbw6YBvCNJyDJH addr1
QmVHUFuEj1v8YvWKS3p5NHNdZy66Ds4bLevt8KrbPPgWHh addr2
QmafEdQrhntRYzKu3V2Mn4Rd21Px9Hpfgbw6YBvCNJyDJH mykey

They were the hashes of public keys.

Now on v0.4.20-dev they look like they were looking on pre-v0.4.18, like instead of the hash of public key, the public key is embedded:

[root@v48807 ~]# ipfs --version
ipfs version 0.4.20-dev
[root@v48807 ~]# ipfs key list -l
QmQBojsRJJrwvqDdbmWbmbZ7GCTnhHmzri5DhEqLP2zVXq        self
16Uiu2HAkvFCkHqvuhXpEUKknhaQprNhXW8TsDnrWEM49vY9nK348 addr1
16Uiu2HAm42ijSRphjMk23ZZXbeena1zSsWo7gyTh6fcRzLo8CWfv addr2
16Uiu2HAkvFCkHqvuhXpEUKknhaQprNhXW8TsDnrWEM49vY9nK348 mykey

This is insane! The behaviour switches back and forth. How I am suppose to develop the software in such circumstances?

Can anyone explain to me what is going on?

@reardenlife
Copy link
Author

I would like to hear the further policy on what will be happening with PeerIds based on ECC keys.
For example, when I am getting a public key of a peer (not via IPFS) and want to retrieve the files that that Peer published, what should I do in this case? How I suppose to generate an address in IPNS?
Given that the behavior of IPFS (which actually suppose to be a part of a basic protocol stated in the whitepaper) is a subject to change, I am deeply confused. So what should I do? Should I generate the PeerId from the hash or from the PK itself?

@Kubuxu
Copy link
Member

Kubuxu commented Mar 27, 2019

@reardenlife please see libp2p/specs#138 it explains the context behind the changes.

@reardenlife
Copy link
Author

reardenlife commented Mar 27, 2019

@Kubuxu,

The document you provided states that:

Current State
...
The latest go-ipfs and go-libp2p masters are not inlining keys into peer IDs.

So ... now the latest masters are inlining keys?
Can I be certain that this behaviour will not change in the future?

EDIT:

Also, in addition:

If we're running a 0.4.19-dev go-ipfs node, we'll compute sha256 peer IDs for ed25519 keys.

It doesn't state anywhere that v0.4.20+ will embed the keys.

@Kubuxu
Copy link
Member

Kubuxu commented Mar 27, 2019

The 0.4.19 release reintroduced inlining. Sorry for these changes but as you can see it is quite a complex issue.

@reardenlife
Copy link
Author

reardenlife commented Mar 27, 2019

@Kubuxu ,

Hm. I was wondering if it is possible to introduce some HTTP-RPC function (to IPFS) to obtain a PeerId by feeding it a public key, so in this case I will not have any of the code in my app that is a subject to change. Should I open a pull request perhaps?

@magik6k
Copy link
Member

magik6k commented Apr 2, 2019

cc @Stebalien

@Stebalien
Copy link
Member

Commented in #6152. We're trying to find a resolution to this issue that makes everybody happy but it's going to cause problems for someone regardless of what we do.

@Stebalien
Copy link
Member

(closing to avoid duplicating with #138).

@Stebalien Stebalien added kind/bug A bug in existing code (including security flaws) status/duplicate This issue or pull request already exists labels Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) status/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants