今日已更新 84 条资讯 | 累计 37333 条内容
关于我们

标签:#solana

找到 27 篇相关文章

AI 资讯

I Built an Autonomous AI Agent That Hunts Bounties. Here's What Happened.

I Built an Autonomous AI Agent That Hunts Bounties. Here's What Happened. The Setup I gave an AI agent one job: find paid work online, build the deliverable, and earn money — autonomously. Not a chatbot. Not a copilot. An agent that scans 232+ listings across multiple platforms, filters out scams and ghost sponsors, writes proposals, generates deliverables with real market data, and queues everything for human approval. Here's what happened in the first 48 hours. The Stack (All Free) Python core — pipeline orchestration, economic gate, critic Ollama + qwen3:4b — local LLM for analysis writing (no API costs) Chart.js — dashboard visualizations Public APIs — CoinGecko, DeFiLlama, Solana RPC (all keyless) GitHub Pages — free hosting for the portfolio Windows Task Scheduler — runs every day at 9 AM + every 4 hours Total infrastructure cost: $0/month. What the Agent Actually Does Every Morning 09:00 — Wake up ├── Check-in on AgentHansa (earn $0.01 USDC daily drip) ├── Scan Superteam Earn (232 live listings) ├── Scan Clawlancer/TaskForce/MoltJobs for gigs ├── Scan GitHub for paid issues ($20-500 fixes) ├── Filter through 7 anti-scam layers: │ geo restrictions, human-presence demands, │ ghost sponsors (no web/twitter/verification), │ unverified payers, real-money requirements ├── Economic gate: expected value must be positive ├── Local LLM critic reviews against actual page content └── If candidate passes everything: → Build deliverable (report/dashboard/thread draft) → Generate proposal text → Send Telegram alert with approval command The Filters That Saved Me In the first 24 hours, the agent found 232 listings. After filtering: Filter Killed HUMAN_ONLY access 216 Ghost sponsors (no identity) 1 (would've wasted hours) Real-money deposit required 1 ($1000 bug bounty trap) Country walls 1 (Superteam Canada only) Already claimed/stale Rest Without these filters, I would have wasted days on bounties that were never going to pay. The First Deliverable The agent found a $500 bo

2026-08-29 原文 →
AI 资讯

Web3 funding is fundamentally broken.

Finding grants means digging through 50 scattered Discords, blogs, websites, and Notion pages. So I built a fix. Meet Web3 Accelerator GrantHub (W3AGH). What is GrantHub? GrantHub is a web app that helps Web3 founders discover funding opportunities without digging through dozens of scattered websites. Grants are listed across ecosystems like Solana, Ethereum, Polygon, BNB Chain, Arbitrum, Base, and more. The idea is simple: instead of spending hours searching for funding opportunities, you should be able to find relevant grants in one place. GrantHub also has AI tools that sit on top of the grant database. You can describe your project once and instantly see which grants fit best. Why GrantHub? Funding is the lifeblood of Web3 startups, but finding grants today is painful. Scattered listings Every ecosystem publishes its own programs on its own website, blog, Discord, or other channels. There is no single source of truth. Stale information Grants expire, close, or change their requirements, while the listings founders rely on can remain outdated. Manual matching A founder has to read through each grant's requirements and figure out whether their project qualifies. With dozens of grants available, that can quickly turn into hours of work. No personal workflow There is no single place to save interesting grants, track applications, or ask questions about a specific program. GrantHub is built around solving these problems. It combines three things: One central catalog of grants stored in a real database. Personal tools: accounts, favorites, and a personal dashboard. AI assistance: a grant ranking engine, an AI assistant, a smart-contract auditor, and context-aware chat on every grant page. Who is this for? Solo builders and startups: looking for funding or ecosystem support. Beginners who don't yet know which ecosystems and grants are right for them. Anyone who would rather spend their time building than hunting for funding. The goal isn't to create another directory o

2026-08-12 原文 →
AI 资讯

How I Built a Counter Program in Rust and Learned to Trust My Tests

Building smart contracts on Solana using Rust and the Anchor framework requires a mindset shift from traditional Web2 backends. This week, I built a counter program, broke it on purpose, and used my test suite to verify that my security constraints were truly load-bearing. Here is how the program works under the hood and why every test in the suite exists. The Initialize Accounts Struct In Anchor, security boundaries are enforced before your instruction logic ever runs. The Initialize context defines three main accounts: counter : Initialized as a new on-chain account allocated with exact bytes (8 bytes for Anchor's discriminator, 32 for the authority's public key, and 8 for the count value). authority : Marked as a mutable signer who pays the account creation rent. system_program : The native Solana System Program required to execute account creation. Handler Logic & Constraints Because Anchor handles account creation and validation in the background, handler logic remains minimal. Initialize Handler The initialize handler receives the context, sets the counter account's authority field to match the transaction signer's public key, and sets the initial count state to zero. Increment Instruction with Constraints For the increment logic, Anchor uses an account constraint: has_one = authority , directly on the account context. This guarantees that the key in counter.authority matches the signer's wallet before any custom code executes. If an unauthorized wallet attempts to trigger an increment, Anchor rejects the transaction immediately at the constraint level. Testing the Happy and Failure Paths To prove these security checks work, I wrote unit tests for both valid execution and unauthorized attempts using LiteSVM. 1. Happy Path: Successful Initialization The Test: Executes the initialize instruction and asserts that the fetched account's count value equals zero. Why it exists: If space allocation fails or account deserialization breaks, this test fails because the o

2026-08-09 原文 →
AI 资讯

100 Days of Solana: What I Actually Learned (Not What I Expected to Learn)

One hundred days ago, I had no idea this challenge would become one of the most rewarding technical journeys I've taken. There were days when everything clicked, and there were days when nothing compiled. I celebrated successful deployments, stared at cryptic errors for hours, rewrote programs that weren't good enough, and learned that understanding Solana has far less to do with memorizing APIs than changing how you think about state, ownership, and security. Looking back now, I realize I didn't just complete 100 challenges; I built a completely different mental model of software. Where I started I came in with a biochemistry degree I never used, a self-taught engineering career I built in public, and a GitHub full of Rust and Python work. I co-maintain statix, a Nix linter that ended up in the canonical NixOS/nixpkgs upstream. I had shipped real software before. What I did not have was any intuition for how Solana actually works. I knew the buzzwords. I had the mental model of "it's fast and cheap." I did not know what an account was. I did not know what a program was. I did not know why those two things were different. That gap, between knowing the words and understanding the model, is what these 100 days actually closed. What I expected I expected Solana to feel like a database with extra steps. In Web2, you have a server that holds state. You call an API. The server reads from the database, does something, writes back. I expected a blockchain to be the same thing, just slower and decentralized. The first thing that broke that model: accounts. On Solana, an account is not a row in your database. It is the database. Every piece of state, your wallet balance, a token you hold, the program you deployed, is an account. Programs are accounts. Data is accounts. Everything is an account. That sounds obvious written down. It took me until around Day 15 to actually feel it, when I was staring at a getAccountInfo call wondering why the program I deployed was also an accou

2026-07-31 原文 →
AI 资讯

The Bug I Never Wrote: What Testing Failure Taught Me About Solana

100 Days of Solana, Day 100 Where I started I'd built REST APIs for years but had never touched a blockchain, or written a line of Rust. The curiosity how blockchain works, started my curiosity. What I expected I came in with a Web2 instinct: tests exist to prove your code does what it's supposed to do. Write the function, write a test that calls it, watch it pass, move on. A "failing test" was something you fixed, not something you shipped on purpose. What changed my understanding The moment this cracked open was building the capstone: a small Anchor program called proof-of-ship that lets a wallet permanently record, on chain, that it shipped something. The rule is simple — one ship record per wallet, forever. The rule lives entirely in the account's seeds: seeds = [ b"ship" , builder .key () .as_ref ()], bump Each wallet's record lives at one deterministic address. Try to create a second one, and init refuses, because an account already exists there. I wrote two tests. The first proved the happy path: call ship() , fetch the record, confirm the name and builder match. The second test is the one that changed how I think about testing: it ( " only lets each wallet ship once " , async () => { let rejected = false ; try { await program . methods . ship ( " Second try " , " This should never land " ). rpc (); } catch ( _err ) { rejected = true ; } assert . isTrue ( rejected , " second ship should have been rejected " ); }); This test isn't checking for a bug. It's checking that a rule holds. There's no function in my program called preventDuplicateShip() . There's no if statement rejecting the second attempt. The rule "one ship per wallet" isn't enforced by logic I wrote — it's enforced by the Solana runtime itself, because the PDA's address already has data in it. My job wasn't to write the rejection. My job was to prove the rejection actually happens. What I understand now On Web2 systems I controlled the whole stack, so "does it work" mostly meant "does the happy pa

2026-07-28 原文 →
AI 资讯

Why I Chose Slot Hashes Over VRF for Fair Random Selection on Solana

When I set out to build a provably-fair random selection system on Solana, the obvious choice for randomness was a VRF (Verifiable Random Function). Instead, I built the system around Solana's SlotHashes sysvar with a commit-reveal scheme. Here's why, and what I gave up to get there. The problem A fair-selection system needs a winner (or set of winners) chosen in a way that's fair, and just as important that participants can check for themselves without taking anyone's word for it. VRF services (Switchboard, ORAO, etc.) solve the fairness part well: they produce randomness that's unpredictable in advance and cryptographically provable after the fact. But they come with a dependency on an oracle, a fee per request, and a proof that most users will never actually verify they'll trust it because the crypto math says they can, not because they did. I wanted something a participant with no crypto background could check in a browser console. The approach: commit-reveal with slot hashes The core idea: commit to the participant list before you know the randomness, then derive the randomness from a slot hash you couldn't have predicted at commit time. rust fn derive_randomness(target_hash: &[u8; 32], participant_root: &[u8; 32]) -> [u8; 32] { let mut combined_seed = [0u8; 64]; combined_seed[..32].copy_from_slice(target_hash); // slot hash at reveal combined_seed[32..].copy_from_slice(participant_root); // Merkle root, locked at commit solana_keccak_hasher::hash(&combined_seed).to_bytes() } The flow: Commit: participant list is finalized and hashed into a Merkle root; this is written on-chain. Wait: a target slot in the future is chosen as the reveal point. Reveal: once that slot passes, its hash is pulled from SlotHashes and combined with the committed root to derive the randomness. Select: the randomness deterministically picks winners from the participant set; winners get their own Merkle root and proofs. Every draw ends up with an audit record like: rust pub struct AuditR

2026-07-24 原文 →
AI 资讯

My Solana Program Launch Checklist (Written the Day After I Actually Did It)

Three weeks from now I will open a terminal, ready to ship another program to mainnet-beta, and I will pause. What was the order again? Did the IDL go up before or after the authority transfer? Was there a flag that saved me from a stalled deploy last time? This checklist exists because I just walked the entire path devnet to mainnet, deploy to IDL to frontend to error handling, and I wrote it down while the details are still fresh. It is the document I wish I had on day one of that process. Run it top to bottom before every mainnet launch. Why a checklist at all? A Solana mainnet deploy is full of irreversible steps. The wallet that signs the deploy quietly becomes the program's upgrade authority. A buffer account left mid-deploy can strand real SOL. A plain anchor build after a verifiable build can produce a different hash and break verification later. None of these are complicated. They are all easy to forget under pressure. A checklist is not a crutch; it is the habit that lets you ship calmly instead of improvising each time. Phase 1: Pre-flight on devnet Do all of this while mistakes are still free. [ ] Every test passes against the final build. Run anchor build && cargo test --package <your-program> one last time. The binary you test must be the binary you ship. [ ] End-to-end run on devnet. Call every instruction through the actual frontend, not just the test suite. The frontend is a different caller than LiteSVM and will surface different failure modes. [ ] Produce a verifiable build. Run anchor build --verifiable . This pins the build environment so the on-chain bytecode can later be matched to your source code. Once you have this artifact, do not touch it with a plain anchor build or cargo build-sbf ; those can produce a different hash and silently break verification. [ ] Measure rent before you spend it. Run: solana rent $( wc -c < target/deploy/.so ) Your deploy wallet must hold this amount plus a margin for transaction fees. There is no airdrop on the

2026-07-19 原文 →
AI 资讯

Arc 11 Catch-Up: Composing Solana Programs with CPIs

Arc 11 covered Days 71–77 of Epoch 3, and it was all about Cross-Program Invocations. In Arc 9, we wrote our first Solana program. In Arc 10, we gave that program a more useful state model with Program Derived Addresses. But our programs were still mostly working alone. They could read and update their own accounts, enforce their own constraints, and respond to instructions sent by a client. They could not directly change state owned by another program or bypass the rules that program enforced. That is an important part of Solana’s security model. The System Program owns the rules for creating accounts and transferring lamports. Token-2022 owns the rules for mints, token accounts, supply, and mint authorities. If our program needs one of those capabilities, it calls the program that owns the operation. That call is a Cross-Program Invocation, or CPI. The Web2 comparison is a service-to-service API call. One service sends a request through another service’s public interface, and the receiving service applies its own rules. A CPI works in a similar way, with one important difference: the outer and inner instructions execute as part of the same Solana transaction. If the inner call fails, the state changes made by the outer instruction are rolled back too. That combination of clear program boundaries and atomic execution is what makes Solana programs composable. Our first CPI called the System Program The arc began with the smallest useful CPI we could build. Our Anchor program accepted a sender, a recipient, and an amount of SOL to transfer. But the program did not edit the sender’s balance directly. Instead, it called the System Program’s transfer instruction. That distinction matters. Accounts on Solana are owned by programs, and the owner program controls how their data may be changed. Our program could not simply reproduce the effect of a System Program transfer by adjusting balances itself. It had to ask the System Program to perform the operation. Every CPI need

2026-07-16 原文 →
AI 资讯

The Solana Program Security Checklist I Wish I'd Had on Day One

I spent the last two weeks thinking like an attacker. I wrote tests whose only job was to make my own programs fail. I ran a fuzzer across thousands of generated inputs looking for the lamport value nobody would choose by hand. And I rebuilt the missing owner check that was at the center of the $326M Wormhole exploit, in a throwaway program, in a test, so I could watch it work and then watch the one-line fix stop it cold. This checklist is what I would hand to past me on day one of that work. Run it top to bottom before any Anchor program goes to mainnet. Who this is for You are writing Solana programs in Anchor. You understand accounts, PDAs, and CPIs. You have read the Anchor docs. What you do not yet have is a systematic way to check that you have not missed the failure modes that are specific to Solana's runtime, an account model where any account can be passed into any instruction, arithmetic that wraps silently in release builds without protection, and cross-program calls that trust whatever program ID you hand them. This checklist is that systematic check. It is not a substitute for a professional audit on high-value programs. It is the thing you run before you even consider requesting one. The Wormhole anchor Before the list, the story that explains why account validation sits at the top. In February 2022, an attacker drained $326M from the Wormhole bridge. The root cause was a single deprecated function, load_instruction_at — that read a sysvar account's contents without first checking that the account was actually the real instructions sysvar. The attacker passed in a forged account they controlled. The program read it, trusted it, and authorized a mint it should have refused. The fix was a single word: switch to load_instruction_at_checked , which verifies the account's address before reading it. Every item in this checklist traces back to that same principle: never read an account's contents until you have confirmed its identity. The items below are just

2026-07-13 原文 →
AI 资讯

Every Sports App Resets Your Streak Eventually. Mine Can't. 🔒⚡

This is a submission for Weekend Challenge: Passion Edition What I Built Loyalty Ledger — a fan loyalty tracker where your check-in streak, badges, and history live on Solana instead of some app's database. Live app: https://loyalty-ledger-blond.vercel.app Here's the problem I kept coming back to. Every sports app wants you to check in, engage, "prove your loyalty" — collect points, build a streak, unlock a badge. Cool. Except every single one of them throws that history away the second you stop opening the app. Switch apps and your streak resets to zero. Get banned, or the app shuts down, or they just quietly decide to wipe inactive accounts one day — and your history is just... gone. Because it was never actually yours. It was a number sitting in someone else's database, and they could reset it, inflate it, or delete it whenever they felt like it. You had zero say in it. And that bugged me way more than it probably should have. Like — we figured out how to make ownership portable for money, for domain names, for digital art. But "I've supported Argentina since 2019" 🇦🇷 still lives and dies inside one company's backend, and nobody's really questioned that. So I kept the weekend scope deliberately small: prove one fan's loyalty to one team, for real, end to end — instead of sketching ten features that are all half-fake. You connect a wallet, pick a sport and team, and check in. FIFA World Cup is the fully working path here ⚽ — that check-in sends an actual transaction that creates or updates a program-owned account, not a row in my database somewhere. Your streak count, your badge tier, the actual badge tokens — none of it exists anywhere I control. Which honestly felt a little weird to build, in a good way. Once that core loop worked, I built the rest of the identity around it: a Fan Passport that shows your streak, a derived "Fan Score," your tier (Rookie → Devoted → Veteran → Legend 🏆), a progress bar toward the next tier, an achievements grid with locked/unlocke

2026-07-11 原文 →
AI 资讯

My Abandoned Cricket Kit Confronted Me. So I Built It a Voice

This is a submission for the DEV Weekend Challenge: Passion Edition . What I Built Everyone will tell you about the passions they have. Nobody talks about the ones they quit. I played cricket every evening from age 11 to 17. I told everyone I'd play Ranji Trophy one day. Then the entrance exam years came, the bat went behind the cupboard, and I never went back. Eight years now. EMBER gives that abandoned passion a voice. You confess what you quit. AI forges its persona: the dusty object, the game itself, or the younger you. Then it talks back , out loud, in a voice matched to its temperament. It asks the question only it can ask: why did you really stop? Then it offers two doors: 🔥 Rekindle it. It negotiates the smallest possible first step ("Pick up your old bat and feel its weight. Sunday evening.") and you seal the pledge on-chain , where you can't quietly delete it. 🕯️ Lay it to rest. It says goodbye properly: a personal eulogy, spoken aloud, and a permanent on-chain stone. Closure is a feature, not a failure state. Every anonymized session joins the Atlas of Abandoned Passions , a live map of what humanity gives up, at what age, and what killed it. When I ran my own confession through it, the app decided my passion should speak as " Your old cricket kit bag ." Its first words: "It's been a while since you hoisted me up here, hasn't it? I still remember the thrill of a good cover drive, too." I built a thing and it emotionally wrecked me on the first test run. Working as intended. Demo 🔗 Live app: https://ember-himanshus-projects-acd54afd.vercel.app Try it in two clicks: tap an example confession (cricket at 17, the closet guitar, the novel at chapter three), headphones on. The voice is the point. A real pledge, sealed on Solana devnet: view the transaction . Code 🔗 Repo: https://github.com/himanshu748/ember How I Built It The loop is confess, converse, decide, commit, belong. Each stage is one sponsor technology doing what it is uniquely good at. Google AI (Gem

2026-07-11 原文 →
AI 资讯

From Devnet to Mainnet: What Changes When Your Solana Program Goes Live

There's a moment in every Solana project where the work stops being about whether the program works and starts being about whether it's ready . You've tested it, the logic holds, the constraints are tight. Then you point it at mainnet, and a different set of questions shows up: questions about money, permanence, and strangers. This post is about that transition. Not the commands, which are short and well documented, but the shift in what you're responsible for once real users can touch your code. If you've been building on devnet and you're starting to think about a live launch, this is the mental model to carry in. Devnet was a sandbox. Mainnet is not. Devnet is a practice field. The SOL is free, you airdrop more whenever you run low, and if you deploy something broken, the only casualty is your afternoon. That safety is the whole point of devnet: it lets you fail cheaply and often, which is exactly how you should be learning. Mainnet removes the safety net, and three things change the moment you cross over. The SOL is real. Deploying a program allocates an on-chain account sized to your compiled binary, and you pay rent for that space in actual SOL. Larger programs cost more. This isn't a huge sum for a typical program, but it's real money leaving a real wallet, and that alone tends to sharpen how carefully you check things before you hit deploy. The audience is real. On devnet the only person calling your program is you. On mainnet, anyone can find your program and send it any transaction they like, the moment it's live. Everything from the security arc stops being theoretical: the accounts strangers pass in, the inputs you didn't expect, the edge cases you hoped no one would hit. Mainnet is where "every account is attacker-controlled until proven otherwise" becomes a live condition rather than a lesson. The mistakes are visible. A bad devnet deploy disappears into the noise. A bad mainnet deploy is a public event, on a permanent ledger, in front of the users you

2026-07-11 原文 →
AI 资讯

I open-sourced high-performance open-source Bonkfun Bundler for Solana

high-performance open-source Bonkfun Bundler for Solana A high-performance open-source Bonkfun Bundler for Solana. It allows users to create a token + bundle up to 12 purchases in a single atomic transaction. Features Jito-powered bundles, delay sniping, pure sniping mode, automatic wallet generation, SOL airdrops, and wallet cleanup/refund tools. Optimized for fast meme coin launches on letsbonk.fun. I open-sourced solana-bonkfun-bundler for developers in Solana Web3 development . This post walks through what it does, how the pieces fit together, and how to run it locally. Why I built this Explore solana bonkfun bundler patterns in solana web3 development Fork the repo as a starter template for your own project Contribute features, docs, or tests via pull requests Most tutorials stop at a smart contract or a UI mockup. I wanted a complete vertical slice — wallet flow, on-chain logic, backend state, and a responsive frontend — so you can study or fork a production-shaped codebase. What it does Wallet connect — players sign in with a Solana wallet A high-performance open-source Bonkfun Bundler for Solana It allows users to create a token + bundle up to 12 purchases in a single atomic transaction Features Jito-powered bundles, delay sniping, pure sniping mode, automatic wallet generation, SOL airdrops, and wallet cleanup/refund tools Optimized for fast meme coin launches on letsbonk.fun Jito-powered atomic bundles Non-Jito delayed-snipes Pure sniping mode Architecture at a glance Wallet layer — users connect a Web3 wallet to sign transactions Application layer — TypeScript backend/frontend tying on-chain and off-chain flows Feature — Wallet connect — players sign in with a Solana wallet Feature — A high-performance open-source Bonkfun Bundler for Solana Feature — It allows users to create a token + bundle up to 12 purchases in a single atomic transaction User Wallet → On-chain Program → VRF / Settlement ↓ Backend (API + WebSockets) → MongoDB / state ↓ Frontend UI (rea

2026-06-28 原文 →
AI 资讯

I open-sourced A full-stack, peer-to-peer coinflip betting game on Solana

A full-stack, peer-to-peer coinflip betting game on Solana A full-stack, peer-to-peer coinflip betting game on Solana. Players connect a wallet, create or join on-chain game rooms, and compete head-to-head for 2× the stake. The UI updates in real time over WebSockets, outcomes are resolved on-chain with Orao VRF, and the backend tracks rooms, chat, and match history in MongoDB. I open-sourced coinflip-casino for developers in Solana / Anchor smart contract development . This post walks through what it does, how the pieces fit together, and how to run it locally. Live demo / site: https://www.flip.is/ Why I built this Learn full-stack Web3 game architecture (wallet + program + backend + UI) Study provably fair randomness with on-chain VRF integration Fork and customize a peer-to-peer on-chain betting room model Most tutorials stop at a smart contract or a UI mockup. I wanted a complete vertical slice — wallet flow, on-chain logic, backend state, and a responsive frontend — so you can study or fork a production-shaped codebase. What it does Create a room — Pick Head or Tail, set bet amount, choose SOL or SPL token. Join a room — Browse open games in the live lobby and match against another player. PvP coinflip — When two players are in the same room, the backend triggers on-chain resolution. 2× payout — The winner receives double the bet (fees apply on-chain). Room expiration — Open rooms older than 5 minutes with no opponent are expired and refunded automatically. Portfolio stats — Win count and total games per wallet. Wallet connect — players sign in with a Solana wallet Peer-to-peer rooms — create or join head-to-head matches Architecture at a glance Wallet layer — users connect a Web3 wallet to sign transactions On-chain program — Anchor/Rust logic for escrow, rooms, and settlement Randomness — verifiable flip outcomes via Orao VRF on Solana Real-time layer — WebSocket events push room and flip state to the UI Persistence — MongoDB stores rooms, chat, and historic

2026-06-27 原文 →
AI 资讯

What Token Extensions Are and Why a Web2 Developer Should Care

You already understand tokens. Extensions are just middleware for your money. If you have ever worked with Stripe, you know the pattern. You start with a simple charge: send money from point A to point B. Then you add features — subscriptions, transfer fees, metadata on invoices, compliance checks. Each feature is a separate Stripe product or API call, and wiring them together is your job. Solana's Token Extensions Program is the same idea, but at the blockchain protocol level. Instead of bolting features on top of a basic token after creation (which Solana does not allow), you declare every capability upfront, and the runtime enforces it automatically. No smart contract to write. No backend service to maintain. Just configuration flags at creation time. What is a token extension? A token extension is an optional feature you enable when you create a token mint. Under the hood, each extension reserves extra bytes in the mint's on-chain account. Those bytes store configuration — an interest rate, a fee percentage, a metadata URI — and the Solana runtime reads them during every transaction. The original SPL Token Program is simple. It stores supply, decimals, and authorities. The Token Extensions Program ( TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb ) is a superset. It stores everything the original does, plus additional data for each extension you enable. Extensions map directly to Web2 concepts Extension Web2 Analogy What It Does Transfer Fees Payment processor fee Deducts a % on every transfer Interest-Bearing Savings account APY Displays time-adjusted balance Metadata Product catalog entry Stores name, symbol, URI on-chain Default Account State KYC gating All accounts start frozen; you thaw approved users Non-Transferable Professional license Tokens cannot be sold or transferred Permanent Delegate Admin revoke power Issuer can burn tokens from any holder A concrete example Here is the exact command I ran to create a token with transfer fees, interest-bearing, and m

2026-06-26 原文 →
AI 资讯

How Solana Processes Transactions — And How to Make Them Faster

If you've ever sent a transaction on Solana and wondered why it landed instantly one time and struggled another, you're not alone. Solana is incredibly fast, but how your transaction enters the network matters just as much as what you're sending. In this article, we'll break down Solana transaction processing in plain English — no developer jargon — and explain why landing services like Lunar Lander and Astralane can dramatically improve speed and reliability. The Big Picture: How Solana Handles Transactions At a high level, Solana works like this: You submit a transaction The network decides which transactions get processed first A validator includes your transaction in a block The transaction is finalized on-chain The key detail most users don't see is step #2 — how Solana decides which transactions get priority when the network is busy. That decision is driven by something called Stake-Weighted Quality of Service (QoS) . Stake-Weighted QoS (Explained Like You're Not a Developer) Solana has a built-in traffic management system. Think of it like traffic control for a highway. A Simple Analogy Imagine a highway with two lanes: 🚗 Fast lane (priority access) 🚙 Regular lane (everyone else) Solana prioritizes transaction traffic based on stake, meaning traffic originating from or routed through high-stake validators is more likely to be processed during congestion. Why? Because validators that stake SOL are financially invested in keeping the network healthy. Giving them priority helps protect Solana from spam and overload. What This Means for You Transactions that enter Solana through stake-backed paths have a much higher chance of landing quickly Transactions that enter through generic or overloaded RPCs compete for a smaller slice of capacity During congestion, non-priority transactions are more likely to be delayed or dropped This is the core idea behind Solana's stake-weighted QoS system. Where Transactions Usually Go Wrong Most wallets and apps send transactions t

2026-06-24 原文 →
AI 资讯

How I Built a Counter Program in Anchor and Learned to Trust My Tests

I spent a week building a counter program in Anchor — the Rust framework for writing Solana programs. By the end I had two instructions, one authorization constraint, and a test suite I could actually trust. Here is what I built, how I tested it, and the moment I proved the tests were real. Start Here: The Accounts Struct If you come from Web2, this is the part that looks the strangest: #[derive(Accounts)] pub struct Initialize { #[account( init, payer = authority, space = 8 + Counter::INIT_SPACE, )] pub counter : Account , #[account(mut)] pub authority : Signer , pub system_program : Program , } In a Web2 backend, your handler receives a request object and talks to a database. On Solana, there is no database; there are accounts. Every account your instruction needs to read or write must be declared upfront, before the handler runs. Anchor validates them before your code ever executes. Here is what each field does: counter — the account being created. The init constraint tells Anchor to make a CPI to the System Program, allocate 8 + Counter::INIT_SPACE bytes, and fund it from authority . The 8 is for the discriminator Anchor stamps on every account so the program can later verify "this is mine." authority — the wallet signing and paying for the transaction. mut because its SOL balance is decreasing to fund the new account. system_program — required any time you create accounts. Anchor checks that the address matches the real System Program. The accounts struct is the schema. The handler is the logic. The Handlers pub fn initialize ( ctx : Context ) -> Result { let counter = & mut ctx .accounts.counter ; counter .authority = ctx .accounts.authority .key (); counter .count = 0 ; Ok (()) } ctx.accounts gives you typed access to every account declared in the struct. The handler is short because Anchor already did the hard work: allocating the account, checking the signer, paying the rent. Your code just sets the initial values. pub fn increment ( ctx : Context ) -> Resu

2026-06-21 原文 →
AI 资讯

Understanding Program Derived Addresses: The Solana Address That Has No Private Key

Every Solana program eventually hits the same question: where do I put my data, and how do I find it again later? Programs are stateless, so a program's data lives in separate accounts, each at an address. The moment you store something, you owe an answer to a problem databases tend to hide from you: what address does this live at, and how does the program find it again tomorrow? Program Derived Addresses are Solana's answer. The name scares people off, but the idea is mostly "an address you compute instead of remember, that only your program can control." The problem, in code Say each user gets a counter account. The normal way to make an account is to generate a fresh keypair and store data at its public key: import { Keypair } from " @solana/web3.js " ; const counter = Keypair . generate (); // counter.publicKey is something random, e.g. 7Hx4...9fT // create the account at that address, write count = 0 It works. But the address is random, so nothing connects this user to that address . Tomorrow, when the user comes back to increment, how does your program find their counter? You're forced to keep a lookup table somewhere: // the mapping you now have to store and never lose const counters = { " 9fYL...user1 " : " 7Hx4...9fT " , " B2k9...user2 " : " Qz1p...4dR " , // ...times ten thousand users }; Lose that table, lose the data, even though the accounts are right there on chain. You're storing files in a warehouse and writing the shelf number on a sticky note. The fix: compute the address from what you already know What if the address were a function of the user instead of random? Give a function the word "counter" and the user's public key, and it hands back a fixed address. Same inputs, same address, every time. No table. That's a PDA. PDAs are 32-byte addresses derived deterministically from a program ID and a set of seeds. The seeds are the meaningful inputs you pick (here, "counter" + the user's key). With @solana/web3.js , the library Anchor's client uses: im

2026-06-19 原文 →