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

推荐订阅源

Last Week in AI
Last Week in AI
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
WordPress大学
WordPress大学
T
The Blog of Author Tim Ferriss
V
Visual Studio Blog
小众软件
小众软件
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
IT之家
IT之家
Vercel News
Vercel News
C
Check Point Blog
Google DeepMind News
Google DeepMind News
月光博客
月光博客
D
DataBreaches.Net
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
Y
Y Combinator Blog
Hugging Face - Blog
Hugging Face - Blog

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
Sysvar Accounts: Solana's Live System Data, Explained for...
Samuel Akoji · 2026-05-20 · via DEV Community

The Accounts Nobody Talks About

If you ask a Solana developer what accounts are, they'll tell you about wallets and programs. If you ask them about sysvar accounts, there's a good chance they pause.

Sysvars are the third category of accounts on Solana and one of the most useful once you're building programs that need to know anything about the current state of the network. This post explains what they are, how they work, and why they exist as accounts rather than as function calls.

What Is a Sysvar?

A sysvar is a special on-chain account that the Solana runtime maintains automatically. Every slot, the network updates these accounts with current chain data: the current time, recent blockhashes, the rent rate, stake history, and more.

Programs can read sysvar accounts as inputs to their instructions. Instead of having a get_current_time() syscall, Solana gives you a Clock account. Instead of a get_rent_rate() function, there's a Rent account.

The design choice is intentional: by making system data available as accounts, programs access it the same way they access any other on-chain data by having the account passed as an input to the instruction.

The Core Sysvar Accounts

Clock SysvarC1ock11111111111111111111111111111111

Contains the current network time:

  • slot the current slot number (~400ms per slot)
  • epoch the current epoch (~2–3 days per epoch)
  • unix_timestamp unix timestamp, updated approximately once per slot
  • epoch_start_timestamp when the current epoch began
  • leader_schedule_epoch used for validator leader scheduling

Programs use Clock when they need time-based logic: vesting schedules, time-locked accounts, auction deadlines. It's the on-chain equivalent of Date.now().

Rent SysvarRent111111111111111111111111111111111

Contains the current rent parameters:

  • lamports_per_byte_year the base rent rate
  • exemption_threshold how many years of rent an account needs to hold to be rent-exempt
  • burn_percent what percentage of collected rent is burned

Programs use Rent when creating new accounts they need to calculate the rent-exempt minimum to fund the account correctly. Without reading Rent, a program would have to hardcode the exemption amount, which can change via governance.

RecentBlockhashes SysvarRecentB1ockHashes11111111111111111111

Contains the ~150 most recent block hashes. Transactions must include a recent blockhash as a validity window transactions referencing a blockhash older than ~150 slots are rejected as expired.

This is the mechanism that prevents transaction replay attacks: you can't rebroadcast an old signed transaction because its blockhash will eventually expire.

EpochSchedule SysvarEpochSchedu1e111111111111111111111111

Contains the parameters that define epoch length and how slot counts ramp up during the warmup period. Programs that need to reason about epoch boundaries can use this.

StakeHistory SysvarStakeHistory11111111111111111111111111

A record of total stake activating and deactivating per epoch. Used by the staking program to calculate how quickly stake delegations activate.

Instructions Sysvar1nstructions1111111111111111111111111

A special sysvar that contains the serialized instructions of the current transaction. Programs use this to inspect other instructions in the same transaction, useful for enforcing that certain instructions appear together.

How to Inspect Sysvars

You can read any sysvar account directly from the CLI:

# Clock
solana account SysvarC1ock11111111111111111111111111111111 --url devnet

# Rent  
solana account SysvarRent111111111111111111111111111111111 --url devnet

# Recent blockhashes
solana account SysvarRecentB1ockHashes11111111111111111111 --url devnet

Enter fullscreen mode Exit fullscreen mode

The raw output is binary-encoded data. To see decoded values, use a JSON RPC call:

curl https://api.devnet.solana.com -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getAccountInfo",
  "params": [
    "SysvarC1ock11111111111111111111111111111111",
    {"encoding": "jsonParsed"}
  ]
}'

Enter fullscreen mode Exit fullscreen mode

The jsonParsed encoding tells the RPC to decode the known sysvar format into readable fields.

Why Accounts Instead of Syscalls?

Other blockchains implement system data differently. Ethereum has block.timestamp and block.number as built-in variables accessible inside smart contract code no account required.

Solana's account-based approach has a specific advantage: it fits the transaction model. Solana transactions must declare every account they'll read upfront. By making sysvars accounts, a program that reads the clock must include the Clock sysvar in its account inputs making it statically visible which system data each instruction accesses before execution.

This supports Solana's parallel execution model. The scheduler can see exactly which accounts (including sysvars) a transaction will read, and run non-conflicting transactions simultaneously.

Sysvar Addresses Never Change

One useful property: sysvar addresses are fixed constants, known at compile time. The Clock sysvar has always been SysvarC1ock11111111111111111111111111111111 and always will be. Programs hardcode these addresses as known constants rather than looking them up dynamically.

In the Solana SDK:

use solana_program::sysvar::clock::ID as CLOCK_SYSVAR;
// CLOCK_SYSVAR == SysvarC1ock11111111111111111111111111111111

Enter fullscreen mode Exit fullscreen mode

The Full Picture

Sysvar accounts complete the "everything is an account" model:

  • Wallet accounts user-owned data, managed by the System Program
  • Program accounts executable bytecode, managed by the BPF Loader
  • Data accounts program-owned state, managed by user programs
  • Sysvar accounts network-owned runtime data, managed by the Solana runtime itself

Four types. One storage model. Every category fits the same four-field account structure just with different owners, executability flags, and data payloads.

Sysvars are the part of that model that gives programs a window into the live state of the network they're running on.