Skip to main content

FiftyFive Tech

Email Us sales@fiftyfivetech.io
Get in Touch
Close-up of two hands typing on a black smartphone, seated on a dark sofa in a denim jacket

Mobile applications

Token-gated chat rooms in an iOS SDK, without a Web3 client library

FiftyFive added token-gated chat rooms to an engagement platform iOS SDK, verifying Web3 wallet holdings through a backend API instead of a heavy library.

Talk about Web3 access control
Industry
Media and entertainment — audience engagement
Region
Solution
Token-gated chat rooms in an iOS SDK
Story

About the client

The client sells interactive engagement tools, including chat, that other companies embed in their own apps through an SDK. To give communities a reason to join and stay, the client wanted chat-room creators to be able to limit entry to holders of particular digital tokens. Token gating was still a new idea for chat at the time.

Challenge

Proving wallet ownership without bloating the SDK

  • Proof of token holdings Let a chat-room creator require proof that a user holds certain tokens in a Web3 wallet
  • Several blockchain networks Work across several public blockchain networks, not just one
  • No SDK size increase Avoid increasing the SDK's size or adding third-party libraries
  • Fit the existing chat flow Fit the existing chat flow without disrupting users who did not need gated rooms.
Solution

What FiftyFive built

FiftyFive researched the Web3 options, designed the access check, built the API and the iOS client logic, tested the feature and documented it. Two designs were evaluated: On-device verification with an open-source Swift Web3 library. This was rejected because it would have enlarged the SDK and added a dependency. Backend verification through an API that queries blockchain RPC endpoints. This was adopted.

The delivered feature lets the SDK ask the backend whether a user may enter a gated room, and enforces the answer in the chat interface.

How the solution works

  1. Access request from the SDK

    • When a user opens a gated chat room, a function in the iOS SDK calls the verification API with the user's wallet details and the room's access rule.
    • Asynchronous calls are handled with PromiseKit so the chat interface stays responsive.
  2. Wallet verification on the backend

    • The API queries the relevant blockchain network through RPC endpoints to check the wallet's token holdings against the room's requirement, and returns an allow or deny result.
    • Keeping this logic on the server means new networks can be supported without shipping a new SDK.
  3. Enforcement in chat

    • The SDK grants or blocks entry to the room based on the result.
    • Chat messaging continues to run on the client's existing real-time messaging service (PubNub).
  4. Quality controls

    • XCTest covered the new logic, SwiftLint enforced code style, and every change went through pull-request review.

Technology stack

Swift and UIKitiOS SDK logic and chat-room interface
PromiseKitAsynchronous calls to the verification API
Backend API with blockchain RPC endpointsServer-side check of wallet token holdings
PubNubExisting real-time chat messaging
XCTestUnit testing of the gating logic
SwiftLintCode-style enforcement

What the solution enabled

Outcomes

Business transformation

0

Increase in SDK size from third-party Web3 libraries

2

Designs evaluated, backend verification adopted

Multiple

Blockchain networks the backend API works across

Token-gated chat rooms

Implemented in the client's iOS SDK.

A backend verification API

That works across multiple blockchain networks.

No increase in SDK size

From third-party Web3 libraries.

Tests, pull-request reviews and documentation

For the feature.

FiftyFive Technologies added token gating to the chat rooms in an audience engagement platform's iOS SDK, so chat creators can restrict access to users who hold specific tokens in their Web3 wallets. To keep the SDK small and free of new third-party dependencies, FiftyFive rejected an on-device Web3 library and built a backend API that checks wallet holdings through blockchain RPC endpoints across several networks. The feature was developed in Swift, tested with XCTest and delivered on time.

FAQ

Technical questions

How do you add token gating to a mobile SDK without increasing its size?

FiftyFive Technologies moved wallet verification to a backend API that queries blockchain RPC endpoints, instead of embedding a Swift Web3 library in the SDK. The iOS SDK only calls the API and enforces the allow or deny result, so it gains no new third-party dependency and new networks can be added on the server.

Talk to FiftyFive's blockchain engineers about adding Web3 access control to your product.

Book a call

Project snapshot

Industry
Media and entertainment — audience engagement
Services
iOS SDK development, Web3 integration, API development, testing, documentation
Status
Delivered on schedule
Core technologies
Swift, UIKit, PromiseKit, XCTest, PubNub, SwiftLint