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

Implement signed-type data #3715

Open
arboleya opened this issue Feb 18, 2025 · 4 comments · May be fixed by #3720
Open

Implement signed-type data #3715

arboleya opened this issue Feb 18, 2025 · 4 comments · May be fixed by #3720
Assignees
Labels
feat Issue is a feature

Comments

@arboleya
Copy link
Member

This should allow applications to request the signature of any arbitrary bytecode, encoded using the schema provided by the DApp, then hashed and prefixed by fixed data. In the case of ETH, Ethereum Signed Message:\n.

@arboleya arboleya added the feat Issue is a feature label Feb 18, 2025
@luizstacio
Copy link
Member

We can go on the route of changing the prefix text to Fuel Signed Message:\n.

@petertonysmith94
Copy link
Contributor

petertonysmith94 commented Feb 18, 2025

  1. Do we want to hash using keccak256 as per the specification or continue using sha256?
  2. Do we also want to add the same prefix text for the existing implementation (of a UTF8 string)? (A breaking change)

Pros:

  • Consistent hashing between messages
  • Less confusion for users about signature format

Cons:

  • Pre-existing hashes will be invalidated (contracts, predicates, etc)

I have gone with using keccak256 and adding the prefix for all hashes:

@petertonysmith94 petertonysmith94 linked a pull request Feb 19, 2025 that will close this issue
4 tasks
@arboleya
Copy link
Member Author

As per a quick conversation I had with @luizstacio:

  1. Let's go with sha256
  2. No, ideally, it should not be breaking but a hybrid / opt-in approach.
// all pseudo code to illustrate

signMessage('string' || bytes) // default/existent method
signMessage({ raw: .... }) // using EIP19

Could we also have an extra parameter, maybe? Not sure. We could also look at Viem, as they use a similar approach from which we could draw inspiration.

@petertonysmith94
Copy link
Contributor

Implemented the changes, one small comment questioning the raw property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants