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

Enable generating secp256k1 keys in the cli #7965

Closed
TJKoury opened this issue Mar 7, 2021 · 14 comments
Closed

Enable generating secp256k1 keys in the cli #7965

TJKoury opened this issue Mar 7, 2021 · 14 comments
Labels
effort/hours Estimated to take one or several hours exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/feature A new feature status/ready Ready to be worked

Comments

@TJKoury
Copy link

TJKoury commented Mar 7, 2021

The method GenerateSecp256k1Key already exists in the go-libp2p-crypto library, integrating it here should be trivial.

I can work on a pull if there is not a good reason it has not be integrated yet, or if it has and I am misunderstanding the current implementation.

@TJKoury TJKoury added kind/feature A new feature need/triage Needs initial labeling and prioritization labels Mar 7, 2021
@welcome
Copy link

welcome bot commented Mar 7, 2021

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@Stebalien
Copy link
Member

Feel free to make a PR, there's no good reason not to support it.

The main downsides are that it's not frequently used and not as well tested as RSA and ed25519. Secp256k support exists just in case someone needs it for existing keys. It enables better interop with, e.g., Ethereum. I'm actually a bit curious, what's your use-case?

@Stebalien Stebalien added exp/novice Someone with a little familiarity can pick up effort/hours Estimated to take one or several hours help wanted Seeking public contribution on this issue status/ready Ready to be worked and removed need/triage Needs initial labeling and prioritization labels Mar 8, 2021
@TJKoury
Copy link
Author

TJKoury commented Mar 8, 2021

Basically, trying to get IPNS working between js-ipfs, go-ipfs, using all key types available to each.

Right now it seems like IPNS only works for go-ipfs using RSA keys, I can't even get it to work between go nodes using ED25519, and can't get it to work at all in js-ipfs (though the pub-sub route looks promising, between nodes in the same app).

I figure a good first step is to make sure both js-ipfs and go-ipfs are able to at least generate self using all three.

@Stebalien
Copy link
Member

Right now it seems like IPNS only works for go-ipfs using RSA keys, I can't even get it to work between go nodes using ED25519, and can't get it to work at all in js-ipfs (though the pub-sub route looks promising, between nodes in the same app).

That's very strange. What IPNS ID did you use? Did it look like Qm... or 1...?

@TJKoury
Copy link
Author

TJKoury commented Mar 8, 2021

Ok, it does seem to be working with both keys in go-lang. Wth go-ipfs, using an RSA or ED25519 key:

Content at /ipfs/QmNxNnK6Z3RJjnpfwsLtDdgRPRLZ5o9RkGhBkLbPDnXAsE

IPNS record RSA
IPNS record ED25519
works no problem.

@TJKoury
Copy link
Author

TJKoury commented Mar 8, 2021

With js-ipfs, with RSA (same file):

IPNS record RSA

No dice. Same with ED25519 and secp256k1.

@Stebalien
Copy link
Member

Stebalien commented Mar 8, 2021 via email

@TJKoury
Copy link
Author

TJKoury commented Mar 8, 2021

Node & browser. I can resolve the files, but no, not the IPNS record.

@Stebalien
Copy link
Member

It's unlikely to work from the browser (the DHT generally doesn't work well there). However, It should work from Node. If you publish an IPNS record in one Node node, can you resolve it in another? If you publish an IPNS record in go? Can you resolve it from js-ipfs (Node)?

@TJKoury
Copy link
Author

TJKoury commented Mar 8, 2021

Publish doesn't work, full stop, using Ubuntu 18.04 LTS, Node 15, js-ipfs 0.54.2.

Running two physical servers, both can see each other (jsipfs swarm peers |grep $(peerID)), both running RSA keys, both can resolve the IPFS CID for the content, but both report record requested for $(IPNS_hash) was not found on the network.

Both can resolve their own IPNS hash.

Branch started here:
branch. My first time running these tests, looks like the current master isn't passing make test. Error:

FAIL github.com/ipfs/go-ipfs/fuse/ipns 600.051s

@TJKoury
Copy link
Author

TJKoury commented Mar 8, 2021

Go-IPFS can also see the the peers but fails after about 30 seconds with the go-equivalent error Error: could not resolve name.

So it does not appear that the latest version of js-ipfs works. I have not tried previous versions to see if it is a regression.

@Stebalien
Copy link
Member

This is likely due to DHT issues and/or incompatibilities in js-ipfs. Last time I checked, the DHT wasn't enabled by default anyways.

@TJKoury
Copy link
Author

TJKoury commented Mar 8, 2021

I did force dht to be enabled by setting in the config Routing.Type to dht (tried dhtclient/dhtserver as well).

@Jorropo
Copy link
Contributor

Jorropo commented May 31, 2023

Fixed by #9830 if IPNS resolution is not working with secp256k1 please open a new issue dedicated to that (because this touch different parts of the codebase).

CC @imthe-1 if you could to check if IPNS resolution is broken with secp but not with ed25519 that would be awesome thx

@Jorropo Jorropo closed this as completed May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/feature A new feature status/ready Ready to be worked
Projects
None yet
Development

No branches or pull requests

3 participants