wevm / frog

Framework for Farcaster Frames 🐸
https://frog.fm
Other
414 stars 93 forks source link

How do I sign a simple string? #482

Closed 0xrpj closed 1 week ago

0xrpj commented 1 week ago

Describe the bug

Currently, signing flow is like such:

app.signature('/sign', (c) => {
  return c.signTypedData({
    chainId: 'eip155:84532',
    types: {
      Swamp: [{ name: 'frog', type: 'string' }],
    },
    primaryType: 'Swamp',
    message: {
      frog: 'Hello, world!',
    },
  })
});

I want to sign a simple string "Hello, world". How do I do it?

Link to Minimal Reproducible Example

No response

Steps To Reproduce

No response

Frog Version

0.17.1

TypeScript Version

No response

Check existing issues

Anything else?

No response

0xrpj commented 1 week ago

To be clearer, the above way also produces signature. However, the signature produced this way is different than the signature produced in a normal way.

dalechyn commented 1 week ago

Hi! Unfortunately only typed signatures are supported in Farcaster Frame Signatures Spec., so you can't just sign a simple string.

I suggest creating a minimal typed data structure.