Hypersnap FID Onboarding
Before you start
Treat a Hypersnap native FID as free and Hypersnap only.
Tell the user that native FIDs start at 4294967296, need no ETH, need no on chain registration, need no rented storage, and do not appear on Warpcast or Snapchain.
Tell the user that one custody address gets one native FID, and custody is immutable in this release, so losing the custody key loses the FID.
Tell the user that a native FID has no fname by default, and its username fallback is the form fid plus its number.
Use a fresh custody key for every new identity, and never reuse a real wallet key or a key from another account.
Keep the custody private key and the signer seed in files with mode 0600, and never paste either value in chat, never commit either file, and never put either value in a skill, a log, or a report.
Install the Python dependencies before you run any onboarding code.
Reuse the verified reference implementation when it is present, and adapt its paths and FID for the new user instead of rederiving the crypto from scratch.
pip install grpcio protobuf blake3 pynacl eth-account eth-abi
Use the reference scripts at ~/workspace/snap-onboard-test/snap_onboard_throwaway.py for registration and signer setup, at ~/workspace/snap-onboard-test/set_profile.py for profile fields, and at ~/workspace/hypersnap-peel/hs.py for later casts, replies, likes, recasts, and follows.
Generate the protobuf stubs from farcasterorg hypersnap main when the local proto_gen folder is missing, and keep the stubs beside the script that imports them.
Use the right endpoints
Send all writes through gRPC SubmitMessage only, because HTTP write endpoints return 501 by design.
Use grpc.castrater.xyz:3383 for gRPC, because hypersnap.castrater.xyz:3383 is Cloudflare proxied and drops raw gRPC.
Use https://hypersnap.castrater.xyz for public HTTP reads on port 443.
Use hypersnap.imgnai.com:3383 for gRPC and https://hypersnap.imgnai.com for reads only as a fallback when the primary gRPC host is unreachable.
Use 127.0.0.1:3383 only when you run the script on the VPS host or inside the Hypersnap compose network.
Treat a gRPC DEADLINE_EXCEEDED error as a transport block, and try the fallback host or the VPS route instead of retrying the same host blindly.
Count timestamps in Farcaster epoch seconds, which is Unix time minus 1609459200.
Create the custody key and signer
Create a new secp256k1 custody key with eth-account, and save its hex private key to a per user file such as ~/workspace/hypersnap-onboard/<name>/custody-key.txt with mode 0600.
Record only the custody Ethereum address in your reply, and never show the private key.
Create a new Ed25519 signer from 32 random bytes, and save its hex seed to a per user file such as ~/workspace/hypersnap-onboard/<name>/signer-seed.txt with mode 0600.
Record only the signer public key in your reply, and never show the seed.
Tell the user that the custody key owns the FID and authorises signers, and the signer key posts, reacts, follows, and updates the profile.
Tell the user that the signer is separate from custody, and it cannot be imported into MetaMask as an Ethereum key.
Check for an existing FID first
Call GetNativeAccount with exactly one of a custody address or a FID, and never pass both values in one call.
Skip registration and proof of work when the custody address already has a FID, and go straight to the signer step.
Confirm the returned FID with a second GetNativeAccount call by FID before you submit a signer add.
Register the native FID
Call GetNativeRegistrationInfo first, and stop when the node reports that native registration is not active.
Read the anchor block height, the anchor block hash, and the minimum difficulty bits from that response.
Mine proof of work with SHA256 over the prefix hyper.onboard.pow: plus the 20 byte custody address plus the 32 byte anchor hash plus the 8 byte big endian nonce.
Accept a nonce only when the hash meets the target, which is hash byte 0 equals 0 and hash byte 1 equals 0 and hash byte 2 is less than 4 for 22 bits.
Build the gate commitment with SHA256 over the prefix hyper.onboard.pow.commitment: plus the 8 byte big endian nonce plus the 4 byte big endian difficulty.
Re-fetch the registration info before you submit, and abort and re-mine when the anchor has left its 1024 block window.
Sign the EIP-712 HyperNativeOnboard message with the custody key, using domain name HypersnapNativeOnboard version 1 chain 10 and fields for custody, anchor block height, anchor block hash, and gate commitment.
Build a message of type 160 with FID 0, a Farcaster epoch timestamp, network 1, and the native onboard body in field 1160.
Set the message hash to the first 20 bytes of BLAKE3 over the serialised message data, use hash scheme BLAKE3, and leave the outer signature empty.
Submit the message through gRPC SubmitMessage, and poll GetNativeAccount by custody address for up to 60 seconds until a FID returns.
Treat the run as failed when no FID returns in that window, and do not claim that a FID exists until the poll succeeds.
Add the signer key
Build a gasless KeyAdd with the custody key as authoriser and the new Ed25519 public key as the signer key.
Use EIP-712 domain name Farcaster KeyAdd version 1 chain 1 for both the KeyAdd signature and the SignedKeyRequest signature.
Set the request FID to the new FID, set the request signer to the custody address, set nonce to 1 for a first signer, set deadline to the current Farcaster epoch time plus 86400, and set time to live to 30 days.
Use scopes 1, 2, 3, 4, 5, 6, 11, and 12, which cover casts, reactions, links, user data, and username proofs.
Encode the SignedKeyRequest metadata as a single tuple of type (uint256,address,bytes,uint256), which produces 288 bytes with a leading 0x20 offset word.
Do not encode the metadata as four flat fields, because that produces 256 bytes and the node rejects it as a malformed signed key request.
Build a message of type 16 with the new FID, a Farcaster epoch timestamp, network 1, and the key add body.
Sign the message hash with the Ed25519 signer, using BLAKE3 over the serialised data truncated to 20 bytes and signature scheme Ed25519.
Submit the message through gRPC SubmitMessage, and poll GetSignersByFid for up to 60 seconds until the new signer public key appears.
Treat the signer as inactive when it does not appear in that window, and do not post until the poll succeeds.
Tell the user that the signer lasts 30 days, and that custody can revoke it later with a KeyRemove message.
Verify the FID and signer
Verify the FID with GetNativeAccount by FID, and verify the signer with GetSignersByFid.
Verify the FID over HTTP with a read of https://hypersnap.castrater.xyz/v1/nativeAccount?fid=<fid>, and check that the returned custody address matches the custody address you created.
Verify the profile over HTTP with a read of https://hypersnap.castrater.xyz/v2/farcaster/user?fid=<fid>.
Report the FID, the custody address, the signer public key prefix, the key file paths, and the verify URLs, and keep the private key and seed out of the report.
Ask about profile, then set it only if the user says yes
Stop after the FID and signer are verified, and ask the user if they want a profile picture, a display name, a bio, or any combination of the three.
Ask for each value the user wants, and do not assume a name, a bio, or a picture from another account.
Ask for the profile picture as a public image URL, because a profile picture is a URL in a UserDataAdd message and not an upload.
Send one UserDataAdd message of type 11 for each field the user approves, using type 1 for the profile picture, type 2 for the display name, and type 3 for the bio.
Sign each profile message with the Ed25519 signer, submit it through gRPC SubmitMessage, and verify it with a fresh read of https://hypersnap.castrater.xyz/v2/farcaster/user?fid=<fid>.
Skip the profile step entirely when the user says no, and move on to the first post question.
Use ~/workspace/snap-onboard-test/set_profile.py as the reference for this step, and change its FID, signer file, and values for the new user.
Ask about the first post, then post only if the user says yes
Ask the user as a separate question if they want a hello Hypersnap first post that tags kmacb.eth, and do not post it as part of the profile step.
Propose one short draft that tags kmacb.eth, and get the exact text approved before you submit anything.
Do not use test text from an earlier onboarding run as the first post for a real user.
Use FID 4163 for kmacb.eth, which is the verified FID for that account.
Build the mention correctly, because Farcaster stores a mention as a FID plus a byte position, and the client renders the username at that position.
Remove the literal @kmacb.eth token from the stored text, and replace it with a single space at the same position.
Set mentions to a list with 4163, and set mentions positions to a list with the byte offset of that space.
Use a stored text of  hello Hypersnap with mentions [4163] and positions [0] when the display text starts with @kmacb.eth hello Hypersnap.
Send the literal @kmacb.eth text plus a mention at the same position only when you want the name to render twice, which you do not want here.
Build a CastAdd message of type 1 with the stored text, the mentions, the mentions positions, a Farcaster epoch timestamp, and network 1.
Sign the message hash with the Ed25519 signer, submit it through gRPC SubmitMessage, and verify it with GetCast plus a read of https://hypersnap.castrater.xyz/v2/farcaster/cast?identifier=0x<hash>&type=hash.
Report the cast hash and the verify URL, and skip the post entirely when the user says no.
Automate daily reading with public reads
Offer this section after onboarding, and build only the daily reading the user asks for.
Use the public read API at https://hypersnap-docs.qstorage.quilibrium.com/reference/reads/index.html as the source for the endpoints below.
Tell the user that every endpoint in this section is public, needs no auth, needs no signed header, and needs no API key, and that responses are always JSON.
Use the node HTTP base https://hypersnap.castrater.xyz in place of the haatz.quilibrium.com placeholder in the docs.
Page every list with a limit, pass the next.cursor value back as cursor for the next page, and stop when the cursor is null or a page returns fewer items than the limit.
Use a page size of 50 for a daily scan, and treat a cursor as opaque even when it looks like a number.
Store the last seen cast hash, the last seen timestamp, and the last cursor in a local state file, and surface only new items on the next run.
Build a morning mentions and replies scan from GET /v2/farcaster/notifications?fid=<fid>&limit=50.
Put cast mentions and cast replies first in that briefing, because those types are cast-mention and cast-reply, and put likes, recasts, and new follows after them as aggregates.
Filter that scan by channel when the user only wants one community, using GET /v2/farcaster/notifications/channel?fid=<fid>&channel_ids=<ids> or the parent URL variant.
Build a following feed from GET /v2/farcaster/feed/following?fid=<fid>&limit=20, which returns casts by accounts the user follows in newest first order.
Build a trending feed from GET /v2/farcaster/feed/trending?limit=20, which ranks casts by engagement over a rolling window.
Build a channel feed from GET /v2/farcaster/feed/channels?channel_ids=<ids>, using comma separated channel ids or parent URLs, and use the parent URL feed when you only have raw parent URLs.
Search for news topics with GET /v2/farcaster/cast/search?q=<term>&limit=10, and repeat it for each keyword the user names, such as football, Hypersnap, or a club name.
Rank search and trending results by the likes, recasts, and replies counts in each cast object, and deduplicate every result by cast hash before you present it.
Read a full thread with GET /v2/farcaster/cast/conversation?identifier=0x<hash>&type=hash&reply_depth=2, and raise the depth to at most 5 only when the user asks for the whole thread.
List a user recent casts with GET /v2/farcaster/feed/user/casts?fid=<fid>&limit=20, and list their most engaging casts with the popular feed for that FID.
Find new followers with GET /v2/farcaster/user/followers?fid=<fid>&limit=50, find mutual follows with the mutual endpoint, and find new people to follow with the suggested endpoint, which ranks friends of friends by overlap.
Hydrate many authors at once with GET /v2/farcaster/user/bulk?fids=<ids> and many casts at once with GET /v2/farcaster/cast/bulk?hashes=<hashes>, instead of fetching one item at a time.
Resolve a username to a FID with GET /v2/farcaster/user/by-username?username=<name>, and resolve a custody address to a FID with the custody lookup endpoint.
Suggest a daily cadence of one morning briefing plus one notifications check every few hours, and ask the user to pick the cadence before you create any scheduled job.
Suggest a news briefing that combines trending, the user chosen channels, and cast search for the user chosen keywords, and present the top few items with author, text, hash, and link.
Suggest a mentions briefing that combines notifications with the user interactions endpoint, which reports mention counts, reaction counts, and mutual follow state between two FIDs.
Do not rely on the for you feed or the topic feed for true personalisation, because both currently return the trending feed.
Do not rely on the cast summary endpoint for a summary, because the node has no LLM and returns a placeholder string.
Do not rely on the cast search metrics endpoint for volume, because it currently returns an empty metrics array.
Do not rely on marking notifications as seen through the API, because those endpoints return 501 and seen state is not part of the protocol, so track seen items locally instead.
Available connectors
Use muse.connector_search to find other connectors and muse.skill_search to find related skills.
If nothing here fits, look on the web for a maintained API or MCP server and set it up with Custom Connectors and MCPs, or build a custom connector.
Alternatives for better results
Run onboarding from the VPS when gRPC from the current machine is blocked, because the node gRPC port is local there.
Reuse the reference scripts instead of writing new crypto code, because the tuple encoding and the mention encoding are the two places a fresh implementation usually fails.
Ask the user for the profile and the first post in two separate questions, because a yes to a profile is not a yes to a public post.
Start daily reading with notifications plus following plus trending, and add channels and search only after the user names the channels and keywords they care about.
