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

Feature requests around passing in signatures and messages to predicates #3575

Open
Dhaiwat10 opened this issue Jan 10, 2025 · 0 comments
Open
Labels
feat Issue is a feature

Comments

@Dhaiwat10
Copy link
Contributor

Some feature requests that I thought of while trying to build an app that must pass a message and the same message signed by a wallet to a predicate. Repo here: https://github.com/Dhaiwat10/fuel-session-keys-demo

  1. The code looks like this right now:
 const messageToSign = Uint8Array.from([
      ...toUtf8Bytes("gFUEL"),
      ...new Uint8Array(27),
    ]);

    // @ts-expect-error signMessage does not accept Uint8Array in the type definition
    const signedMessage = await walletA.signMessage(messageToSign);

    const messageHash = sha256(Buffer.from(messageToSign));

    const predicateData: TestPredicateInputs = [signedMessage, messageHash];

It needs to be as simple as this:

const messageToSign = 'gFUEL';
const signedMessage = await walletA.signMessage(messageToSign);
const predicateData = [signedMessage, message];
  1. Passing in signed messages + messages to a predicate is a very common use for predicates, so this should be documented in the cookbook.

  2. Helpers B256.from('xyz') and B512.from('xyz')

@Dhaiwat10 Dhaiwat10 added the feat Issue is a feature label Jan 10, 2025
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

No branches or pull requests

1 participant