-
Notifications
You must be signed in to change notification settings - Fork 55
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 support for signing transaction files and adding the generated signature as a witness #89
Comments
… or `hex` subcommands (#88) This PR allows the user to sign arbitrary data. Here are some examples taken from the help output: ```console # Sign an arbitrary string. forc wallet account 3 sign string "blah blah blah" # Sign the contents of a file. forc wallet account 3 sign file /path/to/data-to-sign # Sign a hex-encoded byte string. forc wallet account 3 sign hex "0xDEADBEEF" ``` This PR also re-introduces the `forc wallet sign` subcommand. This re-uses the existing logic for signing via the account subcommand, though provides the additional option of signing with a private key. Some examples: ```console # You can also use the `sign` subcommand directly. The following gives the same result. forc wallet sign --account 3 string "blah blah blah" # Sign directly with a private key provided via interactive prompt. forc wallet sign --private-key string "blah blah blah" ``` Notably, this PR also removes the old `forc wallet sign-private` command in favour of using `forc wallet sign --private-key` in order to try and provide a more uniform interface. The `sign tx` subcommand has been renamed to `sign tx-id` in anticipation of supporting signing transaction *files* in the future. See #89. The `sign` command also now allows for specifying the full private key or account password via command line arguments (`--private-key-non-interactive <key>` and `--password-non-interactive <pw>` respectively), however these should likely only be used for testing in non-interactive environments. As a result, we don't highlight them as options in the help output, and we provide `WARNING`s about their use in their argument help output. Closes #75.
@mitchmindtree this looks great, I don't really have anything to add. |
To make this a bit more generic, we could support signing in general. If we do take this approach, is Edit: I just discovered
|
Since signing seems to be supported by the forc-wallet; has the issue been addressed? |
I think this is more specific to signing a transaction that is generated from forc-tx. AFAIK we still do not support that. |
The new
forc tx
command allows for constructing transactions and outputting them to a file in a serialized form. Similarly, we anticipate adding support for writing transactions generated fromforc deploy
orforc run
to file (see FuelLabs/sway#4130).It would be great if we could use
forc wallet
to sign a potentially unsigned transaction and automatically add the generated signature as a witness. This would likely help a lot with shell-oriented workflows and testing.This should look something like the following:
<original-tx-path>-signed.<extension>
(or overwrite the existing?).cc @nfurfaro @simonr0204 in case you have any other thoughts/ideas to add!
The text was updated successfully, but these errors were encountered: