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

Add a forc-crypto plugin exposing a CLI for common-use cryptographic operations #4318

Closed
mitchmindtree opened this issue Mar 21, 2023 · 6 comments · Fixed by #5153
Closed
Assignees
Labels
enhancement New feature or request forc P: medium

Comments

@mitchmindtree
Copy link
Contributor

Raised by @SilentCicero in slack.

The idea is to expose common-use fuel cryptographic functions like sha256, keccak256, ecrecover via forc plugin(s).

The original proposal was for a forc utils subcommand with a broader scope, though I'm thinking it could be worth having more descriptive plugins for each set of tools.

A forc-crypto plugin might include commands like the following:

  • forc crypto sha256 ...
  • forc crypto keccak256 ...
  • forc crypto ecrecover ...
  • forc crypto bech32-to-hex ...
  • forc crypto hex-to-bech32 ...

Commands like sha256 and keccak256 should support both file and string arguments. The same likely goes for the ecrecover message.

The plugin should likely be shipped by fuelup as a part of the default set of components.

This plugin should go in its own repo, but we can use this issue to track until then.

@mitchmindtree mitchmindtree added enhancement New feature or request forc labels Mar 21, 2023
@Voxelot
Copy link
Member

Voxelot commented Aug 8, 2023

Also consider migrating some of the fuel-core-keygen functionality over: https://github.com/FuelLabs/fuel-core/blob/master/bin/keygen/src/keygen.rs

@Voxelot
Copy link
Member

Voxelot commented Sep 28, 2023

any updates?

@cr-fuel
Copy link
Contributor

cr-fuel commented Sep 28, 2023

@Voxelot A PR will be uploaded in a few hours.

cr-fuel added a commit that referenced this issue Sep 28, 2023
…raphic operations

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ecrecover
* [ ] bech32-to-hex
* [ ] hex-to-bech32
cr-fuel added a commit that referenced this issue Sep 28, 2023
…raphic operations

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ecrecover
* [x] bech32-to-hex
* [x] hex-to-bech32
cr-fuel added a commit that referenced this issue Sep 28, 2023
…raphic operations

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ecrecover
* [x] bech32-to-hex
* [x] hex-to-bech32
cr-fuel added a commit that referenced this issue Sep 28, 2023
…raphic operations

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ecrecover
* [x] bech32-to-hex
* [x] hex-to-bech32
cr-fuel added a commit that referenced this issue Sep 28, 2023
…raphic operations

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ecrecover
* [x] bech32-to-hex
* [x] hex-to-bech32
cr-fuel added a commit that referenced this issue Sep 28, 2023
…raphic operations

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ecrecover
* [x] bech32-to-hex
* [x] hex-to-bech32
cr-fuel added a commit that referenced this issue Sep 28, 2023
…raphic operations

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ecrecover
* [x] bech32-to-hex
* [x] hex-to-bech32
cr-fuel added a commit that referenced this issue Sep 28, 2023
…raphic operations

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ecrecover
* [x] bech32-to-hex
* [x] hex-to-bech32
cr-fuel added a commit that referenced this issue Sep 29, 2023
…raphic operations

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ecrecover
* [x] bech32-to-hex
* [x] hex-to-bech32
cr-fuel added a commit that referenced this issue Sep 30, 2023
…raphic operations

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ecrecover
* [x] bech32-to-hex
* [x] hex-to-bech32
cr-fuel added a commit that referenced this issue Oct 4, 2023
…erations

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key
* [x] new-parse secret
cr-fuel added a commit that referenced this issue Oct 4, 2023
…erations

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key
* [x] new-parse secret
cr-fuel added a commit that referenced this issue Oct 4, 2023
…erations

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key
* [x] new-parse secret
cr-fuel added a commit that referenced this issue Oct 9, 2023
…erations

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key
* [x] new-parse secret
cr-fuel added a commit that referenced this issue Oct 13, 2023
…erations

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key
* [x] new-parse secret
cr-fuel added a commit that referenced this issue Oct 13, 2023
…erations

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key
* [x] new-parse secret
cr-fuel added a commit that referenced this issue Oct 17, 2023
…erations

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key
* [x] new-parse secret
cr-fuel added a commit that referenced this issue Oct 18, 2023
…erations

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key
* [x] new-parse secret
cr-fuel added a commit that referenced this issue Oct 24, 2023
…erations

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key
* [x] new-parse secret
cr-fuel added a commit that referenced this issue Oct 26, 2023
…erations

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key
* [x] new-parse secret
cr-fuel added a commit that referenced this issue Oct 28, 2023
…erations

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key
* [x] new-parse secret
cr-fuel added a commit that referenced this issue Oct 28, 2023
…c operations (#5153)

## Description

Fixes #4318

Supported algorithms:
* [x] keccak256
* [x] sha256
* [ ] ~ecrecover~ (this will be added later)
* [x] bech32-to-hex
* [x] hex-to-bech32
* [x] new-key / parse-secret (from
https://github.com/FuelLabs/fuel-core/blob/master/bin/keygen/src/keygen.rs)

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
@block0xhash
Copy link

Hi is this plugin available by any chance to try out ?

@JoshuaBatty
Copy link
Member

We just added the binary to fuelup. It should be available on the nightly toolchain from tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc P: medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants