Developing a token-gated access system: from SIWE to multi-chain

Closed sections and premium materials should open only to those who actually own the token. We develop turnkey token-gated access systems: from wallet login to multi-chain permission checks and access revocation. We configure roles and policies so support stops issuing access manually.

Blockchain Development Services

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1376
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1350
  • B2B Advance company logo design
    B2B Advance company logo design
    796
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1088
  • AIDER company logo development
    AIDER company logo development
    1034
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1130

Token-gated access: where access rights verification breaks

A typical login looks like this: the wallet signs a message, the server verifies the address via SIWE, reads the token balance on the required network, and issues a session with a set of permissions.

From that point on, access lives separately from the asset—token ownership is no longer checked on subsequent requests; permissions are taken from the cache or from the issued session.

This is where token-gated access breaks. The token has been sold, transferred to another wallet, or burned, but the session remains active: its lifetime is hours or days, and the permissions cache at the edge is rarely updated.

Access revocation is not tied to the transfer event—it does not trigger at all, and someone who no longer holds the token enters the restricted area.

The second layer is permission recalculation. Access is rarely described by a single “has token”: a role is assembled from several collections, a minimum amount, and conditions across multiple networks.

If recalculation rules are not fixed, when an asset is transferred on-chain only the owner changes, while a role computed at some earlier point remains in the system and silently preserves access.

The cost of such a mistake is paid content and administrative functions in the hands of former holders, and it usually surfaces through anomalies in requests rather than through a failed check.

We look at how this is closed: verification on every sensitive action, reaction to transfer events, short session lifetime, and honest cache invalidation.

What managed access provides: speed, denials, audit

A token-gated access system differs from a “simply closed page” in that each of its effects is measurable.

The time to grant access drops from hours of manual reconciliation to seconds: the user connects a wallet, signs a message, the service verifies that the address holds the required token, and opens the restricted section.

The share of erroneous grants stays near zero because the permission is confirmed at request time, not from a stale export.

A separate class of failures is “access remained with the former owner.” It is closed by not storing permissions in the database as a once-fixed fact, but recalculating them from the current wallet state on every request or on a token transfer event. When a token is sold, transferred, or burned, access ends without any administrator action.

The access log records who accessed the restricted section and when, from which address, which token confirmed the permission, and how the check ended.

It shows not only the current picture but also the history: when access appeared, when it disappeared, which requests were denied, and why. This is what is requested during incident investigation and external audit.

User onboarding does not stretch out: connecting a wallet and signing is one step, after which the role and access level are applied automatically.

Multi-chain is added as an extension of the same logic: rules are formulated by ownership rather than by a specific network, so a new network can be connected without rewriting the checks.

Token ownership verification options: comparison of modes

The verification mode is chosen along three axes: how much one network call costs, how long the user waits on the first request, and what happens when the token is revoked. There is no universal option—below are the real alternatives among which teams choose at the start.

Mode When it fits Main limitation
Server-side check on every request Paid content, admin access, narrow quotas Every request hits an external node: latency and provider limits
Permission cache in the session High-volume subscription pages where response speed matters Token revocation takes effect only after the cache expires—an acceptable horizon is needed
Client-side check Storefronts, previews, interface state The user bypasses the restriction by editing the request—this is convenience, not control
Off-chain access registry Lists of hundreds of addresses issued manually Requires a write procedure, otherwise it diverges from the actual network state
Aggregation across multiple networks Multi-chain access: token on any supported network An indexer and unified normalization are needed, otherwise balances are summed incorrectly

In practice, modes are combined: server-side verification at login and on sensitive actions, a permission cache in the session for other pages, and cache reset on a revocation event.

This keeps catalog response fast, while a restricted function does not survive token loss longer than a specified window. We fix the mode choice and invalidation scheme in the architecture before the first line of code.

Implementing token-gated access: stages of engineering work

Checking the balance at login is the simplest part of the work. The main difficulty is elsewhere: permissions change, a token is sold or delegated, a staking period expires—and a decision made yesterday stops being correct.

That is why we build access implementation as a pipeline where verification, session, and cache live by one set of rules.

  1. Inventory of roles and permissions. We collect all points where the system allows something: interface sections, API methods, files, admin actions. For each, the minimum ownership threshold and the attribute by which the permission is revoked. The output is a matrix “resource → condition → who is denied.”
  2. Verification scheme. We decide where ownership is calculated: on the server based on a network state snapshot or through a separate verifier service. We fix supported token standards and behavior for unsupported ones—denial or a separate logic branch.
  3. Wallet signature and session. A wallet signature confirms ownership of the address without transmitting the private key: the server verifies it, issues a short-lived session token, and binds a permissions snapshot to it. Renewal happens without re-confirmation while the snapshot is current.
  4. Cache and its invalidation. We keep verification results in a cache with a limited lifetime and a policy version. Cache invalidation is event-driven: token transfer, delegation change, rule edit—otherwise the user loses access with a delay or retains it after revocation.
  5. Load testing. We run mass login, a stream of transfer events, and external network node unavailability. We look at session issuance latency and denial rate—these are the boundaries within which access remains predictable.
  6. Handover and training. We hand over policy configurations, the cache scheme, a dashboard with denials, and instructions for adding a new role. The client’s team then changes rules themselves, without code edits.

Access policies, role schemes, and documentation

Access documentation becomes outdated earlier than access itself: rules are edited point by point, tables diverge from the code, and after six months no one can explain why a role sees exactly that section.

Therefore, we hand over not a set of files but a description of the permissions model, according to which verification can be changed without us.

  • Role matrix — a table “role → resource → action,” where for each pair the source of the permission is specified: token ownership, an address list, or a manually granted role.
  • Access policies — rules in declarative form: token amount threshold, ownership duration, binding to a specific collection.
  • Permission flow scheme — the request path from wallet signature to session issuance: where the result is cached and at what point it is recalculated.
  • Verification configurations — parameters exposed externally: contract addresses, “and/or” conditions, behavior when the network node is unavailable.
  • Decision logs — a record for each denial: address, resource, reason, policy version—the basis for resolving disputed situations.
  • Revocation procedure — the order and timing of closing access at all points: contract, session cache, server roles.
  • Emergency shutdown — a switch that puts the resource into “administrators only” mode, and instructions on who turns it on and on whose command.
  • Access documentation — model description, request examples, procedure for connecting a new collection, and a list of checks during acceptance.

Case study: token-based access in a private club across multiple networks

A private club with several thousand members granted access manually: a manager checked the token purchase and added the wallet to a list.

The lists lived separately in each network and in chat, so a member who sold their token remained in the club until the next reconciliation—once a week.

Disputed cases were investigated using transaction logs, and a noticeable share of support requests were about “the token is there, but access is not.”

What was changed

We assembled a unified permissions registry: an indexer listens to events in each network and puts token owners into one table with a threshold and duration. Login is via wallet signature (SIWE), the role is pulled from the registry, and passwords are not needed.

Recalculation happens by event—sale, delegation, unstaking—rather than on a reconciliation schedule.

We separately addressed resilience: if the network lags or the indexer misses a block, the permission is not removed instantly but marked for recheck, and access is preserved during that time. The main contour is EVM networks, including Polygon.

Metrics before and after

Section opening: it used to be up to 6 hours on business days, and became 30–40 seconds after transaction confirmation. The share of disputed situations fell from about 7% to less than 1%, and almost all remaining ones are lost keys, not permission desynchronization. Manual list reconciliation was eliminated entirely.

How does a wallet signature differ from regular authorization?

A password confirms that a person knows a secret that we store in our database.

A wallet signature stores nothing and transmits nothing to anyone: the client signs a message with a private key, and the server verifies the signature with the publicly known address—and confirms that the key is with the owner right now.

That is exactly why an address cannot be “claimed.” The address is visible in every transfer and in blockchain history; it is easy to copy and present as one’s own.

It becomes proof of address ownership only together with a valid signature over a specific challenge text—a random string, a timestamp, and our service domain.

Signature verification does not replace authorization—it prepares it.

The server first issues a one-time challenge code and remembers it, then accepts the signature, matches the address, and only then opens a user session: a server-side identifier with a limited lifetime, permissions, and a log entry.

After that, the session lives by the usual rules—renewed, revoked, limited by roles. The signature, however, is one-time: the server rejects a repeated presentation of the same string, so an intercepted request does not turn into a permanent pass.

A password cannot replace a signature: a password will prove that a person has an account with us, but it will not provide any proof of control over the wallet address.

Doubts about permission verification: sessions, cache, and access revocation

Before signing off on the scheme, clients ask the same questions: will verification become a bottleneck, what happens to an already open access session after a token is sold, and how to revoke permissions for one address without touching the others. Below are short answers to the technical objections that most often arise during the design stage.

Will balance verification add latency to every request?

Verification is moved to the session boundary: the wallet signature confirms ownership of the address once, after which requests go through a short-lived pass.

The cache holds the verification result for a limited time, so login takes fractions of a second rather than a network call on every user action.

The owner sold the token—will access remain?

No. The cache has an expiration time, and after it expires permissions are recalculated based on the current balance.

Where second-level accuracy matters, we add a subscription to transfer events: selling the token closes this address’s access sessions early, without waiting for the scheduled update.

How to revoke access for one participant?

Targeted revocation is done through an exception list and a permissions version number inside the pass. Updating the version invalidates all previously issued passes for the address, while other users notice nothing and do not log in again.

What about cache expiration and mixed login?

Mixed login—when part of the audience logs in via wallet and part via a regular account—is reduced to a single permissions layer: both branches write the result to one issuance table.

The cache is invalidated by event, so the discrepancy between the blockchain and issued permissions lasts seconds, not a day.

Let’s discuss the token-based access task and come back with a plan

We structure the first conversation not as a presentation but as gathering inputs: without them, any estimate turns into a guess, and the plan into a list of assumptions.

It is important for us to understand where authorization currently lives and what roles already exist in the system, so that we can integrate into the existing logic rather than rewrite it entirely.

  • Which networks and wallets must be supported immediately, and which we consider a second stage.
  • Role composition: who exactly gets access and what differs in permissions between levels.
  • Current authorization: where sessions are stored and whether there is a link to internal accounts.
  • How we verify wallet ownership—message signature or binding through a profile.
  • Revocation mode: access is removed automatically when the token is lost or by manual decision.
  • Acceptable verification delay: instantly on every request or with a short cache on the service side.
  • Where access metadata lives—on-chain or in your database, and who owns that source.

In return, you receive an estimate of work broken down by stage and an implementation plan: what we do in the pilot, how we migrate existing users, and at what point we enable permission revocation. Describe the task and the current access scheme—we will come back with an estimate and a plan.