IAMUVIN

Blog

Blog

Technical writing on Web3, AI, and building things. Written by Uvin Vindula.

130 articles

Full-Stack Engineering11 min
IAMUVIN

Next.js API Route Design Patterns for Production

Battle-tested Next.js API route design patterns from real production apps. Covers Route Handlers with Zod validation, authentication middleware, structured error handling, rate limiting, cursor-based pagination, file uploads, webhook endpoints, and a complete production API checklist.

U
Uvin Vindula·April 15, 2024
Web3 Development13 min
IAMUVIN

Building a Staking Protocol with Reward Distribution

A complete guide to building a gas-efficient staking protocol with reward distribution using the reward index pattern. Covers Solidity implementation, compound staking, multi-token rewards, security considerations, and Foundry testing — based on real DeFi client work.

U
Uvin Vindula·April 15, 2024
AI & Machine Learning10 min
IAMUVIN

Vector Databases Explained: Pinecone vs Weaviate vs pgvector

A practical comparison of Pinecone, Weaviate, and pgvector from someone who has shipped production systems on all three. Spoiler: pgvector wins for most teams because it is already in your database.

U
Uvin Vindula·April 8, 2024
Blockchain Security13 min
IAMUVIN

Smart Contract Security Checklist: 25 Things to Check Before Mainnet

A comprehensive smart contract security checklist covering 25 critical vulnerabilities to audit before deploying to mainnet — with real vulnerable code examples, Foundry fuzz tests, and fixes. From reentrancy and access control to flash loan attacks and gas optimization.

U
Uvin Vindula·April 8, 2024
Web3 Development12 min
IAMUVIN

The Complete Guide to OpenZeppelin Contracts

OpenZeppelin Contracts is the library I install before writing a single line of Solidity. This guide covers every contract family I use in production: ERC-20, ERC-721, ERC-1155 token standards, AccessControl for role-based permissions, ReentrancyGuard for security, Governor for on-chain governance, and the UUPS proxy pattern for upgradeability. You will learn how to extend OpenZeppelin contracts properly, when to override versus compose, and the exact patterns I follow across mainnet deployments on Ethereum, Arbitrum, and Base. Practical Solidity code, no theory padding.

U
Uvin Vindula·April 8, 2024
AI & Machine Learning11 min
IAMUVIN

Building an AI Chatbot That Actually Works

Most AI chatbots are glorified search bars that hallucinate. Here's how to build one that actually works — with proper context management, streaming responses, conversation memory, and guardrails that prevent your chatbot from confidently lying to customers. Based on real production experience building the EuroParts Lanka AI Part Finder with Claude API, Next.js, and TypeScript. Includes complete code examples, architecture decisions, and a production checklist.

U
Uvin Vindula·April 1, 2024
Bitcoin & Cryptocurrency9 min
IAMUVIN

Bitcoin Halving Explained: What It Means and What Happens Next

The Bitcoin halving is one of the most important events in cryptocurrency — yet most people do not actually understand what it is or why it matters. Every 210,000 blocks, the reward that miners receive for validating transactions is cut in half. This is not a decision made by a committee. It is code. It was written into Bitcoin's protocol by Satoshi Nakamoto in 2008 and it will continue executing until roughly the year 2140. In this article, I break down the halving mechanism in plain English, walk through every historical halving with real price data, explain the supply economics that make Bitcoin fundamentally different from fiat currency, and share my perspective as someone who has been educating people about Bitcoin across Sri Lanka and the UK since 2020.

U
Uvin Vindula·April 1, 2024
Web3 Development10 min
IAMUVIN

Web3 Authentication: Wallet-Based Login for Modern Apps

A practical guide to implementing wallet-based authentication using wagmi, RainbowKit, and Sign-In with Ethereum (SIWE). Covers session management, backend verification, multi-chain support, and the UX patterns that actually get users through the login flow without confusion.

U
Uvin Vindula·April 1, 2024
Full-Stack Engineering12 min
IAMUVIN

TypeScript Patterns I Use in Every Production App

The TypeScript patterns that survive production: strict mode enforcement, Zod runtime validation, discriminated unions for state machines, branded types for entity IDs, generic API clients, type-safe environment variables, and the utility types that actually matter. Real code from apps I've shipped, not textbook examples. Includes patterns I stopped using and why.

U
Uvin Vindula·March 25, 2024
Web3 Development11 min
IAMUVIN

Understanding Ethereum Virtual Machine: A Developer's Guide

A developer's deep dive into the Ethereum Virtual Machine — how bytecode executes, stack-based computation works, gas metering prices every operation, and storage layout affects your contract costs. Written from hands-on Solidity experience, not textbook theory.

U
Uvin Vindula·March 25, 2024
AI & Machine Learning11 min
IAMUVIN

Prompt Engineering for Production Applications

A practical guide to prompt engineering for production applications, drawn from shipping real AI features with the Claude API. Covers system prompt design, few-shot vs zero-shot patterns, chain-of-thought reasoning, structured JSON output, temperature tuning, and systematic testing. Includes real prompt examples from the EuroParts Lanka AI Part Finder, where natural language descriptions get mapped to exact OEM part numbers for 40,000+ European car parts.

U
Uvin Vindula·March 18, 2024
Web3 Development14 min
IAMUVIN

How to Build an NFT Marketplace from Scratch

A full-stack guide to building an NFT marketplace — from a Solidity marketplace contract with listing, buying, and bidding logic to royalty enforcement with ERC-2981, a React frontend with wagmi, and IPFS metadata storage. Security-first approach based on real client builds.

U
Uvin Vindula·March 18, 2024