10000 crypto: provide simple way to add new curves · Issue #2424 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

crypto: provide simple way to add new curves #2424

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

Open
tac0turtle opened this issue Feb 23, 2024 · 4 comments
Open

crypto: provide simple way to add new curves #2424

tac0turtle opened this issue Feb 23, 2024 · 4 comments
Assignees
Labels
crypto Cryptography-related enhancement New feature or request needs-triage This issue/PR has not yet been triaged by the team.
Milestone

Comments

@tac0turtle
Copy link
Contributor
tac0turtle commented Feb 23, 2024

Feature Request

Summary

currently there is not a way to add new curves to comet unless you fork the software. This causes many forks for simple changes.

Problem Definition

adding new curves forces users to fork the software. (unless im missing something)

Proposal

add simple way to add new curves to be used for consensus key signing

Zondax is proposing an api to help with this in the sdk. we could look at hosting the new api in its own module to enable usage in comet as well

### Tasks
- [x] Ping Filipo for code check of #2843
- [x] ~~open folluw-up issue to capture the "fully modular support of registering new curvers"~~
@tac0turtle tac0turtle added enhancement New feature or request needs-triage This issue/PR has not yet been triaged by the team. labels Feb 23, 2024
@tac0turtle
Copy link
Contributor Author
tac0turtle commented Feb 24, 2024

to add on it would be nice to have the file system privval also take arbitrary curves. This way users dont also have to fork privval file once pluggable curves land

relevant tendermint/tendermint#5603 but allowing the node instanciator to set the underlying curve would be one step better than the issue linked

@cason
Copy link
Contributor
cason commented Feb 26, 2024

I think we would need a method such as RegisterKey at some place.

Now one can implement the crypto.PrivKey and crypto.PrivKey interfaces, but not sure how to set the new key for use by Comet.

@cason cason added the crypto Cryptography-related label Feb 26, 2024
@tac0turtle
Copy link
Contributor Author

i think the pubkey proto type may need some changing as the current design wouldnt allow register key without redoing the proto types

@melekes
Copy link
Contributor
melekes commented Mar 1, 2024

refs #2399

@melekes melekes added this to CometBFT Mar 1, 2024
@github-project-automation github-project-automation bot moved this to Todo in CometBFT Mar 1, 2024
@adizere adizere added this to the 2024-Q1 milestone Mar 6, 2024
@ancazamfir ancazamfir modified the milestones: 2024-Q1, 2024-Q2 Mar 28, 2024
@melekes melekes self-assigned this Jun 11, 2024
melekes added a commit that referenced this issue Jun 12, 2024
@adizere adizere modified the milestones: 2024-Q2, 2024-Q3 Jul 18, 2024
github-merge-queue bot pushed a commit that referenced this issue Aug 6, 2024
… and thread it through the code (#3517)

Contributes to #2424

Precondition for #2534

This PR is inspired in the core idea of #2539, by @tac0turtle, whereby
we make `privval` more flexible to generate privval files in all the
curves we support in CometBFT natively.

The flag `key-type`, which was only part of command
`gen-validator`before this PR, is now part of all commands that _may_
generate priv validator keys (`start`, `unsafe-reset-all`,
`unsafe-reset-priv-validator`, `init`).

Importantly, node key, and node key file generation is still hard-coded
to `ed25519` (no need to change it for the time being).

Still TODO:
* Add unit tests at various places to test the different key types

---

#### PR checklist

- [x] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

---------

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
mergify bot pushed a commit that referenced this issue Aug 6, 2024
… and thread it through the code (#3517)

Contributes to #2424

Precondition for #2534

This PR is inspired in the core idea of #2539, by @tac0turtle, whereby
we make `privval` more flexible to generate privval files in all the
curves we support in CometBFT natively.

The flag `key-type`, which was only part of command
`gen-validator`before this PR, is now part of all commands that _may_
generate priv validator keys (`start`, `unsafe-reset-all`,
`unsafe-reset-priv-validator`, `init`).

Importantly, node key, and node key file generation is still hard-coded
to `ed25519` (no need to change it for the time being).

Still TODO:
* Add unit tests at various places to test the different key types

---

#### PR checklist

- [x] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

---------

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
(cherry picked from commit bd06fec)

# Conflicts:
#	cmd/cometbft/commands/gen_validator.go
#	node/errors.go
#	node/node_test.go
#	privval/file.go
melekes added a commit that referenced this issue Aug 6, 2024
… and thread it through the code (backport #3517) (#3630)

Contributes to #2424

Precondition for #2534

This PR is inspired in the core idea of #2539, by @tac0turtle, whereby
we make `privval` more flexible to generate privval files in all the
curves we support in CometBFT natively.

The flag `key-type`, which was only part of command
`gen-validator`before this PR, is now part of all commands that _may_
generate priv validator keys (`start`, `unsafe-reset-all`,
`unsafe-reset-priv-validator`, `init`).

Importantly, node key, and node key file generation is still hard-coded
to `ed25519` (no need to change it for the time being).

Still TODO:
* Add unit tests at various places to test the different key types

---

#### PR checklist

- [x] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
<hr>This is an automatic backport of pull request #3517 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: Sergio Mena <sergio@informal.systems>
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Cryptography-related enhancement New feature or request needs-triage This issue/PR has not yet been triaged by the team.
Projects
No open projects
Status: Todo
Development

No branches or pull requests

5 participants
0