FIP: JSON Farcaster Signatures #208
Replies: 7 comments 5 replies
-
Is there something we should take care of to make this interoperable between languages? (I have the protobuf serialization issue in mind, is there a danger we will have a similar issue?) |
Beta Was this translation helpful? Give feedback.
-
So glad we're standardizing this |
Beta Was this translation helpful? Give feedback.
-
Do addresses need to be checksummed or is all lower case fine? |
Beta Was this translation helpful? Give feedback.
-
Note that JFS are not JWS. There are two main differences:
See JFS implementation below that documents in-depth signature validation for both app and custody keys: https://github.com/nounder/json-farcaster-signature/blob/master/jfs.ts |
Beta Was this translation helpful? Give feedback.
-
Where is the |
Beta Was this translation helpful? Give feedback.
-
Is this something that could be done in Warpcast, or would we be expected to create a new Farcaster account using a terminal to host frames? |
Beta Was this translation helpful? Give feedback.
-
Is there a reference on "Compute the signature using the algorithm corresponding to the key" ? I have a custody address, but unclear what signing algorithm applies. Perhaps missing a link? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
FIP: Farcaster JSON Signatures
FIP: Farcaster JSON Signatures
Title: Farcaster JSON Signatures
Authors: @deodad
Problem
Farcaster identities don't have a standardized way to sign arbitrary payloads.
Specification
JSON Farcaster Signatures (JFS) provides a simple standard to compactly and efficiently sign JSON data. This specification is inspired by JWS but it is not a strict implementation of it.
A JFS is made up of three components:
To create a JFS:
For step 3, the signing input is as follows:
ASCII(BASE64URL(UTF8(Header)) || '.' || BASE64URL(Payload))
The entire JFS can then be compactly serialized as follows:
BASE64URL(header) + "." + BASE64URL(payload) + "." + BASE64URL(signature)
Alternatively the JFS can be serialized into a JSON format as follows:
To validate a JFS:
header
from the serialized representation and validate the following:signature
from the serialized representation and validate the following:Signing methods:
Custody Example
Signing
Validating
Note on legacy custody signatures
For a long time this specification incorrectly had the following example for encoding ECDSA signatures:
The problem here is
signature
returned is a hex string but the Buffer interprets it asutf-8
. The result is that rather than the raw bytes getting encoded, the bytes of theutf-8
bytes of that string get encoded. To accept one of these misencoded signatures you can try falling back like so:key
value specified in the header.See the @farcaster/jfs package for a NodeJS implementation.
Beta Was this translation helpful? Give feedback.
All reactions