Farcaster Frames: Include chain id in TX Data passed between server and client #194
SamuelLHuber
started this conversation in
FIP Stage 2: Draft
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem:
If one wants to decide the chainId for the transaction data return dynamically they do so in the tx data handler. Otherwise they can't be sure the address they could guess is actually being used.
Now if this is dynamically done one requires a persistent state mechanism in between frame calls as validation of the control flow depending on transaction completion on the frame server side depends on the chainId used.
The Frame message includes only the transaction hash though. As there is a high overhead to check which chain the transactionId is on and there may be collisions, this is a non trivial undertaking.
Solution:
Extend the FrameMessage to include the chainId from the txData return in the frameMessage sent on Transaction Success
What follows is an example Frame Message including the chainId and transactionId, both shall be marked optional as not all frameMessages are results of Frame Action type "TX".
The Chain used is Ethereum Mainnet eip155:1
In regards to backwards compatibility there is no impact as expecting frames do not expect the field to be filled and the optional nature doesn't require it to be.
Reference:
TX Data the Frame Server sends to the client is described here:
https://docs.farcaster.xyz/developers/frames/spec#tx
Frame Message is describes as Frame Signature Packet here:
https://docs.farcaster.xyz/developers/frames/spec#frame-signature-packet
Beta Was this translation helpful? Give feedback.
All reactions