Architecture

Web2 vs Web3 Architecture

How an application changes when wallets, public ledgers and smart contracts replace parts of the traditional stack.

By the Kensaltensi team · Last updated 27 October 2026 · 9 min read

"Web3" is used loosely, so it helps to be precise about what it changes technically. A Web2 application is a set of services run by one organisation: a database that the organisation controls, an API that mediates access, and accounts that the organisation issues and can revoke. A Web3 application moves some of that responsibility to a public blockchain, where the rules are enforced by code that no single party can silently alter, and where users prove who they are with cryptographic keys rather than with accounts held in your database.

This guide walks through the architectural differences layer by layer, using Ethereum-style networks as the reference because they are the most widely documented. It is written for product managers, engineers and QA professionals who need to understand where the real complexity lives before they commit to a design.

The short version: who holds the source of truth

The clearest way to compare the two models is to ask, for each piece of data and each rule, who can change it, and who can see it?

ConcernTypical Web2 approachTypical Web3 approach
IdentityEmail and password, or OAuth via a provider; accounts stored in your databaseA wallet key pair; the public address is the identifier
AuthenticationServer checks a password or tokenUser signs a message; server (or contract) verifies the signature
Business rulesApplication code on servers you operateSmart contracts executed by every validating node
StatePrivate databasePublic ledger state, plus off-chain databases for everything else
Changing dataUPDATE statement, restore from backupNew transaction; history is append-only and cannot be edited
Cost modelInfrastructure cost paid by the operatorPer-transaction fees (gas), usually paid by the user or sponsored
AvailabilityDepends on your hosting and operationsDepends on the network and on the RPC providers you use to reach it
PrivacyControlled by access rulesPublic by default; privacy needs deliberate design

What stays exactly the same

It is easy to overstate the difference. In practice, a Web3 product still needs a website or mobile app, an API for anything that is not on-chain, a content delivery network, authentication for admin tools, monitoring, logging, customer support and a deployment pipeline. Most of the front-end engineering is identical: components, routing, state management, accessibility and performance budgets all apply.

The realistic mental model is therefore a hybrid: a conventional application with a small, carefully chosen set of responsibilities delegated to contracts. The art of the design is choosing that set.

Identity and authentication

In Web2, a user creates an account and the server stores a salted password hash or a reference to an external identity provider. In Web3, the user controls a private key that never leaves their wallet. The public address derived from that key is their identifier on the network.

To log in to an off-chain service, the user does not send a password. The server issues a one-time challenge, the wallet signs it, and the server recovers the signer's address from the signature. The widely adopted format for this is Sign-In with Ethereum (EIP-4361), which produces a human-readable message like this:

example.com wants you to sign in with your Ethereum account:
0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B

Sign in to Example. This request will not trigger a transaction or cost gas.

URI: https://example.com/login
Version: 1
Chain ID: 1
Nonce: 8f3k2jd9s1
Issued At: 2026-10-27T09:30:00.000Z
Expiration Time: 2026-10-27T09:40:00.000Z

Each field in that message exists for a reason. The domain tells the user, and lets the server confirm, which site requested the signature, which prevents a malicious site from replaying a signature meant for another. The nonce must be generated by the server and used once, which prevents replay. The expiration time limits how long a captured signature is useful. The chain ID pins the network context.

Common mistake: treating a valid signature as a complete login system. After verifying the signature you still need a session (a cookie or token), logout, expiry, rate limiting and a plan for what happens when a user loses their key. A wallet proves control of an address; it does not provide account recovery.

There are two further differences worth planning for. First, a single person may use many addresses, and one address can be used by many apps, so "one user, one account" no longer holds automatically. Second, there is no "forgot password" flow: if the key is lost, nobody can restore it. Some products address this with smart-contract wallets or social recovery, but that is an architectural choice with its own trade-offs.

State and data: what belongs on-chain

A blockchain is a poor general-purpose database. Storage is expensive, throughput is limited, every node replicates every write, and the data is visible to anyone. It is an excellent shared ledger for a small amount of high-value state that multiple parties must agree on.

A useful rule of thumb is to put on-chain only the data and rules where you need one or more of the following:

  • Shared agreement between parties who do not trust each other, such as who owns an asset or how much is held in escrow.
  • Tamper-evidence, where an auditor must be able to verify later that a record was not altered.
  • Programmatic enforcement, where the rule (for example "release funds when both parties sign") should execute without an operator.
  • Composability, where other contracts and applications need to build on your state.

Everything else, including profile text, images, search indexes, analytics and most of the user interface state, normally lives off-chain. Large files are commonly stored in content-addressed storage such as IPFS, or in ordinary object storage, with only a hash or pointer recorded on-chain. The hash lets anyone confirm that the file they retrieved is the one that was committed to.

The indexing problem

Reading from a blockchain node is good at answering "what is the current value of this variable?" and poor at answering "show me every transfer involving this address, sorted by date, with pagination". Because of this, nearly every non-trivial dApp runs an indexer: a service that listens to contract events, writes them into a conventional database and exposes a normal query API. Hosted options such as The Graph, or a custom service built on an RPC provider, are both common. Plan for the indexer early. It is a real component with its own failure modes, such as falling behind the chain head or mishandling a chain reorganisation.

Reading and writing: the transaction lifecycle

Reading state and writing state are completely different operations. A read (an eth_call on Ethereum) is executed by a single node against its local copy of state. It costs the user nothing and returns immediately. A write is a signed transaction that must be broadcast, included in a block by a validator, and executed by the network. It costs a fee and takes time.

  1. PrepareThe app builds the transaction: target contract, encoded function call, value and gas parameters.
  2. SignThe user reviews and approves in their wallet. They may reject at this point, which is a normal outcome and not an error.
  3. BroadcastThe signed transaction is sent to the network and enters the mempool. A transaction hash exists from this moment.
  4. InclusionA validator includes it in a block. Execution may succeed or revert; either way the fee is spent.
  5. ConfirmationFurther blocks build on top. The more confirmations, the less likely a reorganisation reverses it.
  6. FinalityOn networks with explicit finality, the block can no longer be reverted. On Ethereum mainnet this takes on the order of thirteen minutes.

The consequence for product design is that "the user clicked the button" and "the action happened" are separated by seconds or minutes, and the transaction can fail in between. Your interface needs explicit states for pending, confirmed, failed and replaced, and your backend should never treat a transaction hash as proof of success.

Failure modes that do not exist in Web2

Because the runtime environment is different, so are the ways things go wrong. QA and operations teams should have a plan for each of these.

Web2 failureWeb3 equivalent
Server returns 500Transaction reverts on-chain; fee is still charged
Request times outTransaction stays pending because gas price was too low, then is dropped or replaced
Session expiresUser switches account or network in their wallet mid-flow
Database replica lagIndexer behind chain head, so the UI shows stale data
Bad deploy, roll backDeployed contract has a bug; it cannot be patched unless an upgrade path was built in
Cloud region outageRPC provider outage or rate limiting, even though the chain itself is healthy
Race condition on a rowFront-running, where another party's transaction is ordered ahead of the user's
Forced logoutUser rejected a signature request; user has the wrong network selected

Notice that several of these have no safe "retry" equivalent. Retrying a failed web request is usually harmless; blindly resubmitting a transaction can spend funds twice. Idempotency and nonce management matter far more than in a typical CRUD application.

A reference hybrid architecture

A pragmatic layout for many products looks like this, and each layer maps to a testing responsibility:

  • Client: a web or mobile front end that connects to the user's wallet through a standard provider interface (EIP-1193) and displays data from your API.
  • API and database: conventional services for accounts, preferences, search, notifications and anything that does not require shared trust.
  • Contracts: a small, audited set of contracts holding assets, permissions and the rules everyone must agree on.
  • Indexer: a service that reads contract events and exposes them in queryable form, with its own monitoring for lag.
  • RPC layer: one or more node providers, ideally with failover, because this is a hard dependency for every read and write.
  • Relayer or backend signer (optional): for flows where the platform sponsors fees or performs privileged actions, with keys stored in a hardware security module or managed key service.

Deciding where the boundary goes

Before committing to a design, work through these questions for every feature. If the answer to all of them is "no", the feature almost certainly belongs off-chain.

  1. Do multiple independent parties need to rely on this data or rule without trusting one operator?
  2. Would it be damaging if the operator could edit or delete this record?
  3. Is the data acceptable to publish permanently and publicly, or can it be reduced to a hash or commitment?
  4. Can the feature tolerate seconds-to-minutes latency and per-action fees?
  5. Do we have a plan for bugs, given that deployed contract code is difficult or impossible to change?

If you are unsure whether you need a blockchain at all, our guide When Blockchain Is, and Isn't, the Right Choice goes into the decision framework in more detail.

Key takeaways

  • Most production Web3 products are hybrids: a conventional front end and API plus a small on-chain core.
  • The defining change is where the source of truth lives. Anything the contract holds is public, shared and hard to change.
  • Wallet signatures replace passwords, but they still need server-side verification, nonces and domain binding.
  • Transactions are asynchronous and can fail after the user has clicked "confirm". Design the UI around that.
  • Put the minimum on-chain that needs shared trust. Everything else is cheaper, faster and easier to fix off-chain.

Related guides

Further reading

About this guide. Written by the Kensaltensi engineering and QA team for educational purposes. Examples are illustrative, and standards evolve, so check the primary sources above before relying on a detail in production. If you spot an error or an out-of-date statement, email hello@kensaltensi.org and we will review and correct it.