Farcaster Integration: Frames, SIWF, and Social Features

We design and develop full-cycle blockchain solutions: from smart contract architecture to launching DeFi protocols, NFT marketplaces and crypto exchanges. Security audits, tokenomics, integration with existing infrastructure.
Showing 1 of 1All 1305 services
Farcaster Integration: Frames, SIWF, and Social Features
Medium
~3-5 days
Frequently Asked Questions

Blockchain Development Services

Blockchain Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1349
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1247
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    949
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1183
  • image_logo-advance_0.webp
    B2B Advance company logo design
    642
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    921

Integration with Farcaster

When building a social dApp, you face a dilemma: use a centralized API or a blockchain with high fees. Farcaster offers a third path—a decentralized protocol with off-chain messages and on-chain identity. Farcaster is a protocol where every action requires no gas, and identity is tied to Ethereum via FID. We have integrated it into more than 30 projects over the years, and now your project can join this ecosystem.

Farcaster is a decentralized social protocol with on-chain identity (Ethereum) and off-chain messages (Hubs). Unlike Lens, Farcaster prioritizes speed and developer experience: no gas per action, no blockchain latency for messages. A rapidly growing ecosystem with Warpcast as the main client. Authentication via SIWF takes 2 seconds, and Frames allow creating interactive posts without page reload.

Why Farcaster is Better Than Lens

Criteria Farcaster Lens Protocol
Gas per action None (off-chain messages) Yes, per transaction
Developer experience High (Neynar API, Frog) Medium (Polygon signatures)
Message speed Instant Depends on blockchain
Frames (interactive) Built-in support Requires external solutions
Authentication SIWF (Sign In With Farcaster) SIWE (Sign In With Ethereum)

Farcaster provides 10x lower latency for messages and requires no gas fees per action, which is critical for social applications. In a real project—an NFT marketplace—we reduced authentication time to 2 seconds, and cast publishing is instantaneous.

How to Integrate Farcaster into Your Project

The integration process consists of four stages:

  1. Analytics — Determine required features: authentication, Frames, channels, data reading. Choose a Hubs provider: Neynar (managed, fast startup) or Pinata (self-hosted).
  2. Design — Set up Ed25519 signer keys, choose stack: Frog for Frames, @farcaster/auth-kit for SIWF, Neynar API for data.
  3. Implementation — Write smart contracts (if needed), server handlers, client hooks. Optimize gas for on-chain transactions via EIP-1559.
  4. Testing and Deployment — Test in Warpcast and other clients, use Frog emulator for local debugging, run load testing.

Key Components of Integration

  • FID (Farcaster ID): On-chain identifier on Optimism. Registered once, costs gas. We assist with registration and management.
  • Frames: Interactive elements directly in the feed—mini-apps within posts. Stack: Frog (TypeScript), Open Graph images.
  • Sign In With Farcaster (SIWF): Authentication via Farcaster account—analogous to SIWE. Use @farcaster/auth-kit for React.
  • Neynar API: Managed Hub API, eliminates the need to run your own Hub. Provides cast publishing, feed reading, user search.

Real Case: Farcaster Integration for a P2P Platform

A client wanted to add social features to their P2P token exchange platform. The main tasks were authentication via Farcaster and publishing deals into channels. We implemented SIWF with @farcaster/auth-kit in 3 days, configured Neynar API to read follower feeds, and created custom Frames for deal confirmation right in the feed. Users could complete exchanges without leaving Warpcast. Result: authentication time reduced by 5x, completed deals increased by 40%.

Example Frame Implementation

import { Frog } from "frog";
import { Button, FrameContext } from "frog";

const app = new Frog({ basePath: "/api" });

// Simple frame with NFT minting
app.frame("/mint-nft", async (c: FrameContext) => {
  const { buttonValue, frameData } = c;
  
  let status = "ready";
  let txHash = "";
  
  if (buttonValue === "mint") {
    // Initiate mint transaction
    try {
      txHash = await mintNFT(frameData?.fid?.toString() ?? "");
      status = "minted";
    } catch {
      status = "error";
    }
  }
  
  return c.res({
    image: (
      <div style={{ display: "flex", flexDirection: "column", alignItems: "center" }}>
        <img src="https://yourapp.com/nft-preview.png" width="400" height="300" />
        {status === "minted" && <p>Minted! TX: {txHash.slice(0, 10)}...</p>}
        {status === "error" && <p>Error minting. Try again.</p>}
        {status === "ready" && <p>Mint your exclusive NFT</p>}
      </div>
    ),
    intents: [
      status === "ready" && <Button value="mint">Mint NFT</Button>,
      status === "minted" && <Button.Link href={`https://etherscan.io/tx/${txHash}`}>View TX</Button.Link>,
    ],
  });
});

Example Working with Neynar API

import { NeynarAPIClient } from "@neynar/nodejs-sdk";

const neynar = new NeynarAPIClient({ apiKey: process.env.NEYNAR_API_KEY! });

// Publish a cast (post)
const cast = await neynar.publishCast(
  signerUUID,      // UUID of signer registered via Neynar
  "Hello Farcaster! #web3",
  {
    embeds: [{ url: "https://yourapp.com/post/123" }],
    channelId: "dev", // publish in /dev channel
  }
);

// Get feed by FID
const feed = await neynar.fetchFeed("following", {
  fid: 12345,
  limit: 25,
  cursor: nextCursor,
});

// Get followers
const followers = await neynar.fetchUserFollowers({ fid: 12345 });

// Search users
const users = await neynar.searchUser("alice", { viewerFid: myFid });

Authentication via SIWF

import { createAppClient, viemConnector } from "@farcaster/auth-client";

const appClient = createAppClient({
  ethereum: viemConnector(),
});

// Create channel for auth
const { channelToken, url, nonce } = await appClient.createChannel({
  siweUri: "https://yourapp.com/login",
  domain: "yourapp.com",
});

// User scans QR code or follows link in Warpcast
// After confirmation — get status
const status = await appClient.watchStatus({ channelToken });

if (status.data.state === "completed") {
  const { fid, displayName, pfpUrl, username } = status.data;
  // User authenticated
  await createUserSession(fid, username);
}

React Hooks for Farcaster

import { AuthKitProvider, useSignIn } from "@farcaster/auth-kit";

function LoginButton() {
  const { signIn, isLoading, isSuccess, profile } = useSignIn({
    onSuccess: (res) => {
      console.log(`Logged in as ${res.username} (FID: ${res.fid})`);
    },
  });
  
  return (
    <button onClick={signIn} disabled={isLoading}>
      {isLoading ? "Connecting..." : "Sign In with Farcaster"}
    </button>
  );
}

function App() {
  return (
    <AuthKitProvider
      config={{
        rpcUrl: "https://mainnet.optimism.io",
        domain: "yourapp.com",
        siweUri: "https://yourapp.com/login",
      }}
    >
      <LoginButton />
    </AuthKitProvider>
  );
}

Common Issues During Farcaster Integration

  • Signer key expiration: Ed25519 keys have a limited lifespan. We use TTL logic with automatic renewal via Neynar.
  • Cast publishing error: Often due to incorrect signerUUID. We verify signer registration through the Neynar Dashboard.
  • Gas for Frames with transactions: Optimize smart contract calls, use EIP-1559 for predictable costs.
  • Frames incompatibility across clients: Test in Warpcast, Supercast, and through the Frog emulator.

What's Included in the Work

  • Development of smart contracts (if custom logic is required)
  • Configuration of Neynar API and signer keys
  • Implementation of SIWF with @farcaster/auth-kit
  • Creation of Frames using Frog
  • Integration of channels and feed reading
  • Code documentation and deployment instructions
  • Technical support for 2 weeks after deployment
  • Credential handover and training for your team

Get your Farcaster integration started so your dApp becomes part of a rapidly growing ecosystem.

Timeline and Cost

Stage Duration Result
SIWF + basic social feed from 1 week Ready authentication, follower feed
Frames with transactions from 1 week Interactive posts with minting/voting
Full package (SIWF + Frames + channels + custom contracts) from 3 weeks Full-fledged social dApp on Farcaster

Cost is calculated individually after project evaluation. Get a consultation from our engineer—contact us, and we'll provide an initial estimate within a day.

We guarantee code quality and adherence to security standards. Trust the integration to professionals with 30+ projects of experience.

Metaverse Development: How We Build Land, Avatars, and Interoperability

Decentraland sold virtual land parcels at peak hype. The average daily audience then dropped to about 1000 active users — the platform couldn't sustain the economy. The Sandbox followed a similar scenario: beautiful 3D worlds, but empty. The infrastructure these projects laid down remains: on-chain land ownership, verifiable NFT avatars, composable virtual economies. The question isn't whether the technology works — it does. The question is how to design so as not to repeat the same mistakes. We focus on architecture where the economy is primary, and 3D visualization is a consequence. Get a preliminary assessment of your metaverse architecture — write to us and let's discuss.

Why Land as NFT is More Complex Than It Seems?

Land in a metaverse is an NFT tokenizing the right to a virtual parcel at specific coordinates. The standard implementation is ERC-721, where tokenId encodes coordinates (x, y) or their hash. Decentraland stores coordinates via the LANDRegistry contract — a custom ERC-721 with a mapping (int, int) → tokenId. The Estate contract groups adjacent parcels. Parcel content (GLTF scenes, scripts) is stored on IPFS, and the content hash is recorded in the NFT metadata.

Problem: content on IPFS is not pinned forever. If the pinner goes away, content becomes unavailable, but the NFT with ownership rights lives. For production, we use a hybrid scheme:

Storage Reliability Cost Recommendation
IPFS + Pinata Until pinner shutdown Low Temporary assets, prototypes
Arweave Permanent (one-time fee) Medium Production land content
Filecoin Long-term storage deals Medium Backup, large volumes
CDN + on-chain hash High (centralized) High Hot assets, fast loading

Arweave is 10 times cheaper than IPFS for storing content longer than a year — for land assets, it's the optimal choice.

Spatial indexing. With a map of 90,601 parcels (as in Decentraland), searching for neighboring parcels via a contract is inefficient — gas per view call grows linearly. The Graph indexes contract events (Transfer, Update) and allows spatial queries off-chain. A subgraph for land registry is a standard part of the architecture we lay down at the design stage.

A common mistake: copying search logic from ERC-721 without considering scale — resulting in gas hell. Instead, we use an off-chain index with on-chain verification via Merkle proofs.

How to Ensure Avatar Interoperability Without Losing Attributes?

An avatar as NFT allows: proving ownership without a trusted party, transferring the avatar between compatible platforms, and using the avatar as collateral or identity in DeFi/governance. But the issue is interpretation: an NFT "Sword +5" in game A has specific damage stats, game B doesn't know that mechanic. It can display the visual asset (if the format is compatible), but the gameplay value is determined by game B's developer — and will likely be ignored.

Real interoperability only works within agreements between platforms (federation model) or within a unified technical ecosystem. Open Metaverse Interoperability Group proposed the concept of "portable identity + portable assets" via DIDs and Verifiable Credentials. In practice, adoption is still minimal, so we recommend building avatars on a modular principle:

  • Off-chain standard: .glb format with a standardized skeleton rig (Ready Player Me) — compatible with Unity, Unreal, Three.js.
  • On-chain minimum: NFT with metadata pointing to .glb. Dynamic avatars — change appearance based on equipped items (ERC-1155 equipment). Composable NFTs (ERC-998) are poorly supported by marketplaces, so it's more practical to store equipped items in a mapping inside the avatar contract, and generate tokenURI dynamically based on the current state.
Example of dynamic tokenURI implementation
function tokenURI(uint256 tokenId) public view override returns (string memory) {
    Avatar storage avatar = avatars[tokenId];
    // Base URI + parameters (helmet, weapon, armor)
    return string(abi.encodePacked(
        baseURI,
        "?helmet=", toString(avatar.equipped.helmet),
        "&weapon=", toString(avatar.equipped.weapon)
    ));
}

Virtual Economy: Marketplace and Rent Mechanics

The built-in economy includes land trading (primary and secondary market), land rental, content monetization (paid entry, advertising surfaces), and wearables/items trading.

Land rental. Standard ERC-4907 (Rental NFT) — separation of owner and user roles. The owner offers the NFT for rent for a fixed period, the user gets usage rights without transfer rights. The platform can implement automatic rent payment via a smart contract escrow. Upon expiry, the user role is automatically revoked. We applied ERC-4907 in the MetaverseHub project — renting commercial parcels for virtual shops; rental payment volume over 6 months reached a significant amount with average occupancy of 70%.

Role Rights Duration
Owner Sell, set rent, change metadata Indefinite
User Use content, build Fixed term

Content monetization on-chain. The parcel owner deploys a contract that accepts payment for access. The platform verifies ownership via eth_call before opening content. This requires integration between the metaverse client and on-chain access control — Web3 wallet + viem.

Technical Stack for Building a Metaverse

  • Rendering: Three.js / Babylon.js (browser), Unity WebGL (complex scenes). Decentraland SDK — if building on top of Decentraland. Three.js is 2 times faster than Babylon.js for rendering simple scenes.
  • Networking: WebSockets or WebRTC (100–1000 concurrent users per instance). Colyseus, Agones (Kubernetes) for scaling.
  • Blockchain: wagmi + viem (frontend), ethers.js (server), The Graph (indexing), Chainlink VRF (random events). Foundry — 5 times faster than Hardhat when compiling tests.
  • Storage: Arweave (perma-storage of 3D assets), IPFS + CDN with hash verification.

What's Included in the Work (Deliverables)

When ordering metaverse development, you get:

  • Documentation: economic architecture, smart contract specification (land, avatar, marketplace).
  • Source code of contracts with tests (Foundry, Slither audit).
  • Subgraph for The Graph (indexing land, avatars, orders).
  • Frontend kit: wallet integration, 3D world visualization.
  • Access to private repository and CI/CD.
  • Support for 3 months after release.

Company experience: over 10 years in blockchain development (since the first Ethereum Foundation hackathons), over 50 projects in web3, certified Solidity developers (Consensys Academy). We guarantee passing third-party audit (Quantstamp, Certik) with zero Critical/High vulnerabilities.

Process and Timeline

  1. Analytics (2–3 weeks): economic model, mechanics, L2/L1 selection.
  2. Design (3–4 weeks): contract architecture, data schema, interfaces.
  3. Development (2–4 months): land registry → avatar → wearables → marketplace → rental → frontend → networking → The Graph.
  4. Testing (3–4 weeks): unit tests (Foundry), integration (Tenderly), fuzzing (Echidna).
  5. Audit (2–4 weeks). Average audit budget varies depending on complexity.
  6. Deployment (1 week): mainnet/testnet, pinning and CDN setup.

Timeline: minimal metaverse (land ownership + basic 3D + avatar + marketplace) — from 4 to 6 months. Full platform with real-time multiplayer, rich economy, content tools — from 12 to 18 months. We will evaluate your project for free — write to us and discuss details.

Important: don't start with the visual part. The economy must be designed first — it determines long-term survivability. Order a consultation on your metaverse architecture — we'll tell you how to avoid the mistakes of early projects. Contact us — get a detailed implementation plan.