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.
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.
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
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.
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.
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).
Quality controls
- XCTest covered the new logic, SwiftLint enforced code style, and every change went through pull-request review.
Technology stack
What the solution enabled
Business transformation
Increase in SDK size from third-party Web3 libraries
Designs evaluated, backend verification adopted
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.
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.