Integration
Blockchain Integration for Existing Web Applications
A practical Kensaltensi guide for product, engineering and QA teams.
Start with the business requirement
Adding blockchain to an existing product should begin with a specific requirement, not with a chain selection. Identify what must become verifiable, transferable or shared across organizations. If the requirement can be solved more safely and cheaply with the existing database, blockchain may not be necessary.
A practical hybrid architecture
Most production integrations are hybrid. The browser or mobile app handles wallet connection and user interaction. A wallet signs messages or transactions. An RPC provider connects the application to the network. Smart contracts hold the state that needs on-chain enforcement. A backend can still manage accounts, notifications, permissions, rate limits and private data, while an indexer converts blockchain events into query-friendly records.
Wallet integration
Support the wallets and networks your users actually need. Handle disconnected wallets, rejected connection requests, unsupported networks and account changes. Never assume that the account selected when a page loaded will remain selected. Display the active network and address when that information affects an action.
Backend responsibilities
A backend remains useful even when settlement is on-chain. It can verify signed messages, issue application sessions, cache chain reads, coordinate off-chain workflows and protect third-party API credentials. Private keys used by backend services require particularly careful secret management and should have the minimum privileges necessary.
Reading blockchain data
Direct RPC reads are suitable for current state, but historical queries can become expensive or awkward. Indexing services listen to blocks and events and build searchable representations. Teams should plan how they handle reorganizations, delayed indexing and discrepancies between cached data and the canonical chain.
Writing transactions
Before prompting a user, validate inputs and estimate likely fees. After submission, store the transaction identifier so the UI can recover after refresh. Treat a submitted transaction as pending until the required confirmation threshold is reached. If a transaction fails, preserve enough diagnostic information for support without exposing sensitive wallet data.
Security boundaries
- Never collect seed phrases.
- Validate chain IDs and contract addresses.
- Use explicit allowlists for privileged operations.
- Protect backend signing keys with appropriate key-management systems.
- Audit contract permissions and upgrade mechanisms.
- Rate-limit APIs even if the blockchain itself is public.
Release strategy
Test on development or test networks where appropriate, but do not assume test-network behavior perfectly predicts production. Validate contract addresses, token decimals, fee assumptions, RPC limits and monitoring before launch. A staged rollout with observability is safer than enabling every user at once.
The key design principle is separation: put only the state that benefits from blockchain guarantees on-chain and keep ordinary application responsibilities in systems designed for them.