All articles
Web3

Smart contracts for business: what belongs on-chain and what should stay on the server

Where businesses need independently verifiable rules and where a regular API is enough. We examine blockchain boundaries, administrative permissions, upgrades, oracles, costs, and security.

Smart contracts are often presented as a way to remove intermediaries, automate transactions, and make systems transparent. But blockchain code alone guarantees neither an honest business nor safe funds nor the fulfillment of real-world obligations.

It solves a more specific problem: participants can perform operations under shared rules on a chosen network without relying exclusively on one company's database.

Development should therefore start neither with issuing a token nor with choosing a programming language. The first question is which parts of the product genuinely need independent verification and which are simpler and safer on a conventional server.

When a smart contract is genuinely needed

Blockchain is useful when multiple participants need shared state rather than taking one operator's data on trust.

For example:

  • a buyer and seller use predefined settlement rules;
  • multiple companies record rights to digital assets;
  • participants want to verify how funds are distributed;
  • a user needs to control an asset independently through their wallet;
  • the product needs to interact with other protocols on the chosen network.

Multiple parties do not automatically require blockchain. Sometimes conventional payment integration, electronic document workflows, or a shared information system solves the problem better.

A useful test: if a server API replaced the contract, what exactly would participants lose?

If the answer amounts to the marketing term Web3, reconsider the architecture. If participants would lose independent ownership verification, settlement without operator permission, or interaction with other applications, the contract may have a justified role.

A smart contract executes code, not human agreements

A contract operates on available data and formal conditions.

It can check that an address received a specified amount, a specified time has arrived, or a required participant's signature was obtained. It does not inherently know whether goods were delivered, a design meets quality expectations, or an apartment matches its description.

Suppose a buyer transfers money into a contract and the seller must deliver a physical item. Holding funds until a condition is met is technically possible. But who confirms delivery?

There are several possibilities:

  • the buyer confirms receipt;
  • a logistics service supplies the status;
  • an agreed arbitrator makes the decision;
  • a combination of confirmations and deadlines is used.

Each option introduces a degree of trust back into the system. A contract can make that trust explicit and bounded, but cannot automatically eliminate it.

Technical execution does not replace legal assessment either. Parties' rights, dispute resolution, and the applicability of terms must be determined separately.

What to store on-chain

Good candidates are data and rules that determine independently verifiable outcomes.

For example:

  • ownership of a digital asset;
  • available balances within a protocol;
  • conditions for unlocking funds;
  • issuance limits;
  • permissions for specific operations;
  • settlement status between participants;
  • confirmations required to execute an action.

Even this data does not always need to be stored entirely on-chain.

Sometimes recording a cryptographic commitment, such as a document hash, is sufficient. The document itself is stored separately, and participants can later verify whether a presented version matches the recorded one.

This approach has limits. A hash does not guarantee that the document will be available a year later, contains truthful information, or was signed by an authorized person. Other mechanisms provide those properties.

Hashing alone does not make data confidential either. If possible input values are easy to enumerate, an attacker can try to recover the original by comparing hashes.

What is better kept on the server

Interfaces, search, notifications, analytics, file processing, and most product logic usually do not need on-chain execution.

The server often retains:

  • user profiles and settings;
  • personal data and documents;
  • search and filtering;
  • transaction preparation;
  • event indexing;
  • change notifications;
  • integrations with external services;
  • operations that do not affect verifiable rights and settlements.

Cost is not the only reason. Server logic is easier to update, scale, and adapt to data-storage requirements.

Putting information that may later need deletion onto a public network is risky. Encryption does not fully solve this: encrypted data can persist forever, while keys and cryptographic assumptions change over time.

Specific privacy properties depend on the network. Assumptions about a public EVM blockchain cannot automatically be applied to infrastructure with a different access and data-disclosure model.

Who has administrative permissions

The claim that “everything runs on a smart contract” says little about actual control over the system.

More important questions are:

  • who can change parameters;
  • who can stop operations;
  • who can issue additional assets;
  • who can upgrade the implementation;
  • who can move funds;
  • who can appoint new administrators.

If a single key can change the rules and withdraw assets, users remain heavily dependent on its owner.

This does not always mean the architecture is poor. Administrative control may be necessary early in a product's life. But permissions must align with the guarantees claimed.

Separating roles helps. Permission to pause some operations, for example, should not automatically grant permission to take all funds or replace the code.

Critical actions can require multiple independent signers and an execution delay. But multisig does not help if one person effectively controls every key or all keys are stored on one compromised device.

A delay is useful only if participants learn about an upcoming change and can respond to it.

Upgradeability: fixing bugs or rewriting the rules

An immutable contract has an obvious advantage: its code cannot simply be replaced by an administrative command after deployment.

But a bug can also remain forever. Fixing it sometimes requires a new contract and a separate user migration.

An upgradeable architecture allows the implementation to change while retaining a particular interaction point. This introduces additional trust in the upgrade mechanism.

EVM systems, for example, often use proxy contracts. Initialization, storage compatibility, and access control for upgrades must be designed correctly. Other networks may use different mechanisms.

Before launch, define:

  • which parts of the system can be upgraded;
  • who makes the decision;
  • whether a delay is required;
  • which checks are mandatory;
  • how users learn about changes;
  • what happens to existing assets and integrations.

Upgradeability should not be presented as trustlessness. It is a risk-management tool with its own benefits and limitations.

An oracle supplies external data, not truth

A contract cannot independently access any website and verify a real-world event the way a server application can. External information arrives through a designated mechanism, often called an oracle.

This might include prices, event outcomes, shipment statuses, or other data.

When choosing a source, assess more than its accuracy under normal conditions. Understand:

  • how often data is updated;
  • what counts as a stale value;
  • whether the source can be manipulated;
  • who controls its configuration;
  • what happens when it is unavailable;
  • how units and precision are handled.

For a financial product, a price from one illiquid trade may be an unacceptable basis for calculations.

Averaging and multiple sources help in certain scenarios but are not universal safeguards. Choose them according to the specific threat model.

Define failure behavior in advance too. Sometimes temporarily blocking sensitive operations is safer than continuing to execute them at a stale price.

Other contracts bring their own risks

A product may use existing tokens, exchange protocols, lending platforms, or bridges. This accelerates development but expands its trust boundaries.

An external contract may have administrative functions, changeable rules, or nonstandard behavior.

A token might charge transfer fees, alter recorded balances, or restrict operations for specific addresses. If an application assumes ordinary transfers without these features, its accounting can become incorrect.

In EVM systems, external calls also require accounting for reentrancy and other execution characteristics. Different environments have different risk profiles.

Cross-chain mechanisms add another layer: verifying events from another network, intermediary operation, and rules for issuing represented assets.

The architecture must therefore list not just your own contracts but every external dependency on which fund safety relies.

Measure fees and speed using real operations

Smart contract costs do not end with development and deployment.

The budget includes user operations, network-access infrastructure, indexers, monitoring, key management, auditing, and maintenance.

Fees depend on the network, load, data volume, and execution complexity. Payment does not always correspond to a successful business outcome: an EVM transaction that reverts usually still consumes gas.

For estimation, list the main actions:

  • registration or entity creation;
  • depositing funds;
  • purchasing;
  • transferring;
  • receiving a payout;
  • closing a position or deal.

Then measure each action's cost and test growth scenarios.

Operations whose cost grows without bounds with participant count are especially dangerous. Distributing funds to every user in one transaction may work for a test group and become impossible at scale.

Bounded batches or a model where each participant claims their own allocation are often better.

The interface must reflect the transaction lifecycle

A button press and a completed operation are different events.

A user may reject signing. A transaction may await inclusion, fail, or be replaced by another transaction. Some networks require accounting for reorganizations and the chosen finality criterion.

The interface should therefore distinguish:

  • preparing the operation;
  • waiting for a signature;
  • submission to the network;
  • block inclusion or another confirmation stage;
  • reaching the accepted finality level;
  • failure or cancellation.

The backend must account for these states too. Awarding an irreversible reward immediately after first detecting an event can break accounting if network state is later rolled back.

A fixed rule such as “always wait three blocks” is not universal. Confirmation criteria depend on the network, amount, and acceptable risk.

Auditing does not replace design and testing

Auditing is useful, but does not make every system secure.

Start with clear requirements and invariants: properties that must hold under every valid action.

For example:

  • a participant cannot withdraw more than their available balance;
  • repeating a request does not create a duplicate payout;
  • an administrative role does not gain unspecified powers;
  • changing one parameter does not break calculations for existing operations.

These properties are checked with unit tests, generated action sequences, boundary-value analysis, and other appropriate methods.

An audit must cover a specific code version and configuration. Significant changes after review may require further analysis.

Test more than contracts. Interface bugs, compromised administrator keys, or incorrect server-side event processing can harm users even when on-chain code is correct.

You need an incident response plan after launch

A deployed contract cannot be maintained in the same way as a conventional website.

Some systems allow certain operations to be stopped; others do not. Even when a pause function exists, it does not necessarily block every dangerous scenario or recover funds already lost.

Before launch, define:

  • which events are monitored;
  • who receives alerts;
  • who is authorized to intervene;
  • which actions can safely be paused;
  • how users will be informed;
  • how recovery or migration will proceed.

Pausing also has consequences. Blocking withdrawals may protect against one attack while preventing users from reducing another risk.

Emergency powers should therefore be designed alongside the core logic, not added at the last moment.

Where to start the project

Good architecture starts with a trust map.

Understand who holds assets, who confirms external events, who changes the rules, and which actions users can perform without the operator.

Then divide the product into three parts:

  • what genuinely needs to be verified and executed on-chain;
  • what depends on external confirmations;
  • what is more sensibly kept as conventional server logic.

The clearer these boundaries, the easier it is to explain the product, estimate costs, and verify security.

A smart contract is not useful because it replaces the entire server. It is useful when it enforces specific rules and rights for which independent verification truly matters.

What do you want to do?

Explain the idea in a couple of sentences. We'll come back with an estimate, deadlines and a plan - free of charge and under NDA.