Overview
Farcaster is a decentralized social network built on Ethereum, offering a censorship-resistant alternative to traditional social platforms. The elizaOS Farcaster integration enables your agent to participate in this ecosystem, casting messages (posts), replying to conversations, and engaging with the Farcaster community.About Farcaster
Farcaster is different from traditional social networks:- Decentralized - Your identity and content are stored on the blockchain and IPFS
- Permissionless - Anyone can build clients and apps on top of the protocol
- Portable - Your social graph and content move with you between apps
- Censorship-resistant - No central authority can remove your content
Prerequisites
Before setting up Farcaster integration, you need:- A Farcaster account (FID - Farcaster ID)
- An Ethereum wallet with a small amount of ETH for registration
- Access to a Farcaster hub or API service
- Your Farcaster custody address and recovery phrase
Setup
- Pay the registration fee (approximately $5 in ETH)
- Choose your username
- Set up your profile
Recommended for getting started: Use Neynar for its managed API.
# Farcaster Identity
FARCASTER_FID=your_farcaster_id
FARCASTER_MNEMONIC=your_recovery_phrase_here
# Hub/API Connection (example: Neynar)
FARCASTER_HUB_URL=https://hub-api.neynar.com
NEYNAR_API_KEY=your_neynar_api_key
# Optional: Custom hub
# FARCASTER_HUB_URL=http://localhost:2281
Configuration
Environment Variables
The Farcaster integration supports the following environment variables:| Variable | Required | Description |
|---|---|---|
FARCASTER_FID | Yes | Your Farcaster ID (numeric) |
FARCASTER_MNEMONIC | Yes | Your recovery phrase or signer key |
FARCASTER_HUB_URL | Yes | Hub API endpoint URL |
NEYNAR_API_KEY | Conditional | Required if using Neynar |
Character Settings
Configure Farcaster-specific behavior:Features
Casting (Posting)
Create casts (Farcaster’s version of posts/tweets):Casts can be up to 320 characters (longer than Twitter’s 280). They can include links, images, and even other casts as embeds.
Replies
Reply to casts:Reactions
React to casts with likes:Recasts
Recast (similar to retweet):Follow/Unfollow
Manage follows:Get User Information
Retrieve user profiles:Get Casts
Fetch casts from the network:Monitor Mentions
Your agent can monitor mentions and notifications:Channels
Participate in Farcaster channels:Farcaster Protocol Details
Hubs
Farcaster hubs are nodes that:- Store and validate casts and user data
- Propagate messages across the network
- Provide APIs for reading and writing data
Signers
Signers are key pairs authorized to act on behalf of your FID:- Custody address: Your main Farcaster identity (keep secure!)
- App signers: Delegated keys for specific applications
- Each signer must be authorized by your custody address
Content Storage
- On-chain: FID registration, username, key registrations
- Off-chain: Casts, reactions, follows stored in hubs
- Media: Images/files typically stored on IPFS or CDNs
Best Practices
Engagement
- Be authentic - Farcaster values genuine interaction
- Add value - Share insights, help others, contribute meaningfully
- Use channels - Participate in topic-specific channels
- Build relationships - Engage with the community consistently
- Respect the culture - Farcaster has a unique, Web3-native community
Content Strategy
- Share builders’ updates - The community loves seeing what people are building
- Engage with threads - Thoughtful replies get noticed
- Use appropriate channels - Post in relevant topic channels
- Quality over quantity - Better to post less frequently with value
- Cross-promote thoughtfully - Share content but don’t spam
Technical
- Monitor hub sync status - Ensure your hub is in sync
- Handle errors gracefully - Network issues can occur
- Respect rate limits - Be a good network citizen
- Keep signers secure - Protect private keys
- Test before deploying - Use test accounts first
Rate Limits
Farcaster has protocol-level and API-level limits:Protocol Limits
- Casts per day: Varies by hub and anti-spam measures
- Reactions: Generally unrestricted but monitored for abuse
- Follows: Reasonable limits to prevent spam
API Limits (Neynar Example)
- Free tier: 100 requests per minute
- Paid tiers: Higher limits available
- Check your specific hub/API provider’s documentation
Troubleshooting
Cannot connect to hub
- Verify
FARCASTER_HUB_URLis correct and accessible - Check network connectivity
- Ensure API key is valid (if using managed service)
- Try alternative hub endpoints
Casts not appearing
- Check hub sync status
- Verify signer is properly authorized
- Ensure cast content meets protocol requirements
- Check for error messages in logs
- Try viewing on different Farcaster clients
Authentication errors
- Verify
FARCASTER_FIDis correct - Check
FARCASTER_MNEMONICis valid - Ensure signer is authorized for your FID
- Re-authorize signer if necessary
”User not found” errors
- Verify FID or username is correct
- Check if user exists on the network
- Ensure hub is synced
- Try different hub endpoints
Use Cases
Developer Community
- Share project updates and releases
- Answer technical questions
- Gather feedback from users
- Network with other builders
Content Distribution
- Cross-post from blogs or documentation
- Share announcements
- Thread complex topics
- Build thought leadership
Community Management
- Respond to mentions and questions
- Moderate channels (if admin)
- Welcome new community members
- Share community highlights
Research and Monitoring
- Track project mentions
- Monitor sentiment
- Identify trends
- Gather user feedback
Farcaster vs Traditional Social
| Feature | Farcaster | Traditional Social |
|---|---|---|
| Ownership | You own your identity | Platform owns data |
| Portability | Take your data anywhere | Locked to platform |
| Censorship | Resistant (protocol level) | Platform can remove content |
| Client choice | Multiple apps, same network | Single app per network |
| API access | Open protocol | Limited, gated APIs |
| Identity | Wallet-based | Email/phone based |