惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Docker
Simon Willison's Weblog
Simon Willison's Weblog
H
Help Net Security
F
Fortinet All Blogs
H
Heimdal Security Blog
S
Schneier on Security
L
LangChain Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
NISL@THU
NISL@THU
P
Palo Alto Networks Blog
J
Java Code Geeks
博客园 - 【当耐特】
The Last Watchdog
The Last Watchdog
W
WeLiveSecurity
www.infosecurity-magazine.com
www.infosecurity-magazine.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Vulnerabilities – Threatpost
I
InfoQ
Recorded Future
Recorded Future
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
CERT Recently Published Vulnerability Notes
T
Tenable Blog
腾讯CDC
C
Check Point Blog
量子位
M
MIT News - Artificial intelligence
GbyAI
GbyAI
罗磊的独立博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog
小众软件
小众软件
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
V2EX - 技术
V2EX - 技术
T
Threatpost
Engineering at Meta
Engineering at Meta
Attack and Defense Labs
Attack and Defense Labs
T
Tailwind CSS Blog
S
Securelist
The Cloudflare Blog
博客园 - 叶小钗
L
LINUX DO - 最新话题
T
Troy Hunt's Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
爱范儿
爱范儿

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How Solana Transactions Are Different from REST API Calls (And Why It Matters)
Lymah · 2026-05-10 · via DEV Community

The Problem: Your Mental Model Is Broken

You know how to build APIs. You understand request/response cycles. You know that a successful POST returns 200 OK, and a failed request returns 400 Bad Request. You've never been charged for a 400.

Solana transactions will break every one of those assumptions.

Last week, I sent a transaction that failed due to insufficient funds. The validator still charged me a fee. A 400 Bad Request just cost me real money. That's when I realized: I was thinking about blockchain like it was an API, and it's not.

In this post, I'm going to show you exactly how Solana transactions work, how they differ from REST APIs, and why understanding those differences will make you a better blockchain developer.

Web2: Request/Response

Here's how you think about HTTP today:

POST /transfer
{
  "recipient": "alice",
  "amount": 100
}

→ Process on server
→ Return result

200 OK: Transfer succeeded
400 Bad Request: Invalid amount
401 Unauthorized: Not authenticated

Enter fullscreen mode Exit fullscreen mode

Key properties:

  • Stateless (each request is independent)
  • Synchronous (you wait for a response)
  • Validated on the server
  • Failed requests are free (no charge for 400s)
  • No signature needed (the server trusts TLS)

Web3: Signed State Transitions

Solana transactions are fundamentally different. They're not requests to a server. They're cryptographically signed instructions to change on-chain state.

// Build a transaction
const transaction = new Transaction({
  recentBlockhash: blockhash,
  feePayer: sender.publicKey
});

// Add an instruction
transaction.add(
  SystemProgram.transfer({
    fromPubkey: sender.publicKey,
    toPubkey: recipient,
    lamports: amount
  })
);

// Sign with private key
transaction.sign(sender);

// Send to network
const signature = await connection.sendRawTransaction(
  transaction.serialize()
);

Enter fullscreen mode Exit fullscreen mode

Key differences:

  • Stateful (changes on-chain state)
  • Asynchronous (sign locally, then wait for validators)
  • Validated by the network
  • Failed transactions still cost fees
  • Must be signed by the payer's private key

The Fee Problem

Here's the biggest shock: you pay whether the transaction succeeds or fails.

I tried to transfer 3.20 SOL with only 2.20 SOL balance. On an API, that would be a 400:

POST /transfer
400: Insufficient funds
Cost: $0.00

Enter fullscreen mode Exit fullscreen mode

On Solana:

solana transfer 2iHFnuzv... 3.2
Error: Insufficient lamports (need 3.2, have 2.2)
Cost: 0.000005 SOL (~$0.0000005 on mainnet)

Enter fullscreen mode Exit fullscreen mode

I got charged for a transaction that didn't execute.

Why? Because validators did work to process my transaction. They:

  1. Deserialized the signed bytes
  2. Loaded accounts from storage
  3. Executed the System Program instruction
  4. Checked preconditions (balance, signatures, etc.)
  5. Determined it would fail and rejected it

All of that costs compute resources. So they charge a fee. It's economically rational, and it's completely different from REST APIs.

The Three Commitment Levels

With HTTP, you get one response: 200 or error. Solana has three.

When I send a transaction, it moves through these stages:

1. Processed (~400ms)

A validator included my transaction in a recent block.

Waiting for processed... Transaction processed by validator

Enter fullscreen mode Exit fullscreen mode

What it means: A single validator saw your transaction. Not yet secured by consensus.
Risk level: High (1-2% chance it gets forked away)

2. Confirmed (~800ms)

66%+ of validators voted on the block containing my transaction.

Waiting for confirmation from supermajority... Transaction confirmed by network

Enter fullscreen mode Exit fullscreen mode

What it means: Network consensus. You won. It's almost impossible to reverse.
Risk level: Extremely low (no confirmed transaction has ever been reversed in Solana's history)

3. Finalized (~12s)

At least 31 additional confirmed blocks built on top.

Waiting for finalized... Transaction finalized

Enter fullscreen mode Exit fullscreen mode

What it means: Irreversible. Like a database commit that's replicated to disk and backed up.
Risk level: Zero

Compare this to HTTP where you get one response:

HTTP 200 OK immediately
↑
Done. State changed.

Enter fullscreen mode Exit fullscreen mode

Solana transactions are multi-stage. Different applications wait at different levels:

  • Fast-paced DEX? Wait for "confirmed" (~800ms)
  • Payment processor? Wait for "finalized" (~12s)
  • Bridge operation? Wait for even more finalization

Real Code: I Built This

Here's my transfer tool. I send 0.01 SOL to a recipient:

$ node transfer.mjs 6SSAKkUGpyuB2dg81L4d8USfXjpnUXPX6qwif7bcQKwc 0.01

============================================================
  Solana Transfer Tool
============================================================

Connected to Solana devnet
   RPC: https://api.devnet.solana.com

Checking balance...
   Balance: 2.253960000 SOL

Amount: 0.01 SOL (10,000,000 lamports)

Building transaction...
Signing transaction...
Sending to network...
Waiting for processed... Transaction processed by validator

Waiting for confirmation from supermajority... Transaction confirmed by network

Waiting for finalized... Transaction finalized

Transaction successful!

Signature: 4MNtSnAcA2JL3CgwrVqBAoqyhQVpnvog8LKc65MNjKaroTZDj8F8UhpieMnWRLhV6juAbvMypHP92YnaguRmbNGc

View on Solana Explorer:
https://explorer.solana.com/tx/4MNtSnAcA2JL3CgwrVqBAoqyhQVpnvog8LKc65MNjKaroTZDj8F8UhpieMnWRLhV6juAbvMypHP92YnaguRmbNGc?cluster=devnet

Final balance: 2.23895 SOL

Enter fullscreen mode Exit fullscreen mode

This is the Solana equivalent of an HTTP POST. But look at the differences:

  • I sign the transaction with my private key (HTTP just uses TLS)
  • I wait through three commitment stages (HTTP returns immediately)
  • I get a signature instead of a 200 OK (signatures prove finality)
  • I can view the transaction on a public explorer (no such thing in Web2)

The Secret Weapon: Simulation

Remember how I said failed transactions cost fees?

There's a way around it: simulation.

Before you send a transaction, ask the network: "If I send this, what would happen?"

The network runs your transaction in a sandbox. If it would fail, it tells you. And you don't pay.

// Simulate first (costs nothing)
const simulation = await connection.simulateTransaction(unsignedTx);

if (simulation.value.err) {
  console.log("Would fail:", simulation.value.err);
  // Don't send - you just saved a fee!
} else {
  // Safe to send
  const sig = await connection.sendTransaction(tx);
}

Enter fullscreen mode Exit fullscreen mode

This is the production pattern. Professional Solana apps always simulate before sending. It saves fees and catches errors early.

Mental Model: From Request/Response to State Transitions

Here's how I had to rethink things:

Before (HTTP Thinking)

1. Craft a request
2. Send it
3. Wait for response
4. Response tells me if it worked
5. If it failed, no penalty

Enter fullscreen mode Exit fullscreen mode

After (Solana Thinking)

1. Build a signed transaction (cryptographic proof)
2. Simulate it (does it work? costs nothing)
3. Send it (if simulation passed)
4. Wait through three commitment stages (processed → confirmed → finalized)
5. If it fails, I still paid the fee (even in a sandbox!)

Enter fullscreen mode Exit fullscreen mode

The key shift: You're not making a request to a server. You're proposing a signed change to global state that thousands of validators must agree on.

Why This Matters

Understanding these differences makes you a better blockchain developer because:

  1. You'll design better error handling

    • Can't just check for 200 vs 400
    • Must handle async multi-stage confirmations
    • Must implement retry logic for transient failures
  2. You'll write more efficient code

    • Simulate before sending (saves fees)
    • Batch multiple operations in one transaction
    • Choose the right commitment level for your use case
  3. You'll make economically rational decisions

    • Every transaction has a cost
    • Failed transactions cost the same as successful ones
    • This changes how you architect systems
  4. You'll understand why certain constraints exist

    • 1,232 byte transaction size limit (fits in UDP)
    • ~90 second blockhash window (network state needs to be fresh)
    • Fee charges for failure (validates work done by validators)

The Takeaway

REST APIs lied to you. They made state changes feel free and instantaneous. Solana is honest about it: changing state is work, it takes time, and you pay for it whether it succeeds or fails.

That honesty is uncomfortable at first. But it makes you a better engineer. You start thinking about:

  • What operations are actually necessary?
  • How can I batch work to minimize fees?
  • What happens if this fails?

These are the questions that lead to well-designed systems.

If you're coming from Web2 and feeling lost in blockchain development, this mental shift is everything. Once you stop thinking of transactions as API calls and start thinking of them as cryptographically signed state changes that require network consensus, everything else clicks into place.

Want to experiment? Try building a Solana transfer tool yourself. You'll hit the same realizations I did, and that's where real learning happens.

Further reading: