FuelLabs / FuelLabs/forc

Add support for signing transaction files and adding the generated signature as a witness

Open
#33 4 comments 0 reactions 0 assignees View on GitHub
enhancement forc-wallet
Dominant language
Rust
Stars
0
Forks
0
Avg merge
1d 22h
Merged PRs (30d)
3

Description

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 from `forc deploy` or `forc run` to file (see https://github.com/FuelLabs/forc/issues/156).

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:

1. Read and deserialize the transaction file into memory.
2. Calculate the transaction ID (with cleared witnesses and necessary serialization format).
3. Sign the transaction ID.
4. Append the signature to the transaction's list of witnesses.
5. Serialize the transaction to the same format it was deserialized from.
6. Write the updated transaction to a new file `-signed.` (or overwrite the existing?).
7. Output the new signature along with its index in the list of witnesses to stdout.

cc @nfurfaro @simonr0204 in case you have any other thoughts/ideas to add!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the `forc tx` and `forc wallet` command entry points, then inspect how transaction files are deserialized, serialized, and signed. Compare the existing transaction workflows with `forc deploy` and `forc run`; done means an unsigned transaction can be signed, its witness appended, the updated file written, and the signature and witness index printed.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.