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

推荐订阅源

MongoDB | Blog
MongoDB | Blog
宝玉的分享
宝玉的分享
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
罗磊的独立博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
博客园 - 司徒正美
博客园 - 叶小钗
T
Tailwind CSS Blog
博客园 - Franky
V
V2EX
有赞技术团队
有赞技术团队
美团技术团队
雷峰网
雷峰网
爱范儿
爱范儿
Jina AI
Jina AI
D
DataBreaches.Net
H
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell

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
Anchor vs Pinocchio: the real deploy cost
Satori Geeks · 2026-04-23 · via DEV Community

The Solana mainnet deploy came in at $141. For a demo project. I stopped, recalculated, and stared at the number for a minute.

I'd built the tip jar in Anchor 0.32.1 — the standard framework, the one with real docs, the one everyone reaches for first. It worked. Seven integration tests passed. Then I checked the binary before committing 1.6 SOL to mainnet: 230 KB.

Three options, one decision

On Solana, accounts need to hold enough SOL to cover two years of rent to become rent-exempt, otherwise the runtime can garbage-collect them. For a program account, that's about 6,960 lamports per byte. At ~$86/SOL, 230 KB works out to ~1.64 SOL — $141.

You can close a Solana program later and reclaim that SOL to a recipient wallet. So it's not technically unrecoverable. But "recoverable in theory" doesn't change what you need in your wallet before you can deploy.

Option Binary size Approx. cost
Anchor 0.32.1, unoptimised 230 KB ~$141
Anchor + opt-level = "z", lto = true, strip = "symbols" ~90–100 KB ~$60
Pinocchio rewrite 15–20 KB (estimation) ~$9

Anchor with size flags was 15 minutes of work. Those flags strip symbols and merge compilation units — they don't touch Anchor's macro overhead. There's a floor, and $60 is still a lot for a demo. I went with Pinocchio.

What Pinocchio actually is

Pinocchio is a zero-dependency Rust framework for Solana programs. No macros, no IDL, no borsh. You write the discriminator logic, the account parsing, the PDA derivation — all of it.

Where Anchor's #[derive(Accounts)] generates validation from a handful of attributes with a lot happening out of sight, Pinocchio puts every check in explicit byte-offset reads. Nothing is invisible. The price for that is verbosity. The reason to pay it is binary size.

The rewrite

Four hours. Three instructions (initialize, send_support, withdraw) and three account types (MessageBoard PDA, Vault PDA, per-message Support PDA). I wrote the byte layout manually, encoded fields by hand, checked boundaries explicitly.

The 7/7 tests passed at the end. Worth noting: since Pinocchio generates no IDL, the TypeScript tests couldn't use Anchor's program.methods.sendSupport().rpc() style. Every instruction had to be built as a raw TransactionInstruction — manual Buffer.concat, explicit account list, correct discriminator byte. So the actual scope of the work was the Rust rewrite plus rewriting the test client from scratch.

Tests ran against a live solana-test-validator with the Pinocchio binary pre-loaded. No Anchor runner.

Binary: 30 KB. Above the 15–20 KB estimate — the manual validation boilerplate adds code that Anchor macros would have inlined. Still 87% smaller than the Anchor build.

Actual mainnet deploy: 0.214 SOL. ~$18. Within 1% of the rent calculation I'd done upfront.

Build Binary size Deploy cost
Anchor 0.32.1 230 KB ~$141 (never deployed to mainnet)
Pinocchio 0.9 — estimated ~15–20 KB ~$9
Pinocchio 0.9 — actual 30 KB $18

The rubric gap

My scoring rubric has a dimension for per-message transaction cost (D7) and one for deployment experience (D6). There's no dimension for the developer's one-time deploy cost.

On EVM weeks — Base, Scroll — this never came up. Both cost cents. On Solana, after the optimisation, it was $18. Before: $141. That's a real number with no rubric home. Worth flagging, because a methodology that doesn't measure something can't be honest about it.