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

推荐订阅源

C
Cisco Blogs
Cyberwarzone
Cyberwarzone
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
SecWiki News
SecWiki News
Martin Fowler
Martin Fowler
T
Tor Project blog
N
Netflix TechBlog - Medium
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
V
Visual Studio Blog
GbyAI
GbyAI
PCI Perspectives
PCI Perspectives
D
DataBreaches.Net
Jina AI
Jina AI
H
Heimdal Security Blog
云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
A
About on SuperTechFans
J
Java Code Geeks
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
News | PayPal Newsroom
有赞技术团队
有赞技术团队
MyScale Blog
MyScale Blog
博客园 - 司徒正美
C
Check Point Blog
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs
宝玉的分享
宝玉的分享
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
C
Cyber Attacks, Cyber Crime and Cyber Security
I
Intezer
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
Cisco Talos Blog
Cisco Talos Blog
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
Recent Commits to openclaw:main
Recent Commits to openclaw:main
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
博客园 - Franky
Security Archives - TechRepublic
Security Archives - TechRepublic

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
Understanding Shielded Transactions on Midnight
Abhineet Bij · 2026-05-06 · via DEV Community

Midnight is a programmable-privacy blockchain. Its core premise is simple but revolutionary: public verifiability without public visibility. In simple terms, anyone can verify the validity of a transaction (via zero-knowledge proofs), but the actual data, inputs, and identities can remain completely private.

If you’ve come from Ethereum, Solana, or even other ZK chains and found “shielded transactions” confusing, you’re not alone. I spent days wrestling with the mental model until it clicked.

Before continuing, make sure you're familiar with the following topics:

  • UTXO Model (NIGHT transactions use the UTXO model)
  • Merkle Trees

It is also worth keeping in mind that shielded tokens on Midnight use a private UTXO model (the focus of this article), while smart contracts use an account-style model for their persistent on-chain state, giving you the best of both worlds.

The Core Mental Model:

Every shielded interaction on Midnight rests on a clean split that the protocol enforces at the lowest level:

  1. Public Ledger (what everyone can see)
    This is the visible part of the blockchain. It holds commitments, nullifiers, and the final public state changes. Think of it as the “receipt” that proves something happened correctly.

  2. Private State (what stays on your device)
    Your actual secrets - balances, messages, keys, and history, never leave your wallet or computer. This is the shielded ledger. Only you (and the intended recipient) can read it.

  3. Zero-Knowledge Proof (the cryptographic bridge)
    This is the magic. Alice’s wallet runs the contract logic locally, using her private data + Bob’s public info. It generates a tiny proof that says:

“I own this input, the math adds up, the rules were followed… but I’m not telling you the numbers or who I am”.

The proof + a few public pieces (nullifiers + new commitments) get submitted to the network. Nodes verify the proof in seconds. If it checks out, the public ledger updates. Done.

Bulletin Board Analogy:

This is one of the simplest analogies I found to understand the mental model of shielded transactions on Midnight. It's called the "Bulletin Board Analogy". It's pretty simple to follow along:

Imagine a giant town square with two public objects:

  1. A Bulletin Board:
    Imagine a bulletin board that can grow constantly. People pin sealed envelopes to it. You can see every envelope and when it was added, but you can't see what's inside any of them. Once an envelope is pinned, it stays there forever and can never be taken down.

    This bulletin board is what we call the "Commitment Merkle Tree".

  2. A Glass Jar:
    Imagine a glass jar that everyone can see into. People occasionally drop unique tokens into the jar (the role of this jar will make sense pretty soon).

    Let's call this jar the "Nullifier Set".

Mounted above the square is a camera that automatically takes a single snapshot of the bulletin board at the end of every hour. The last 100 snapshots are kept on display next to the board.

Each townsperson/resident has:

  • A secret stamp known only to them (spending key)
  • A secret monocle that lets them read certain envelopes (viewing key)
  • A wallet of slips that say: envelope #893454 on the board contains 10 NIGHT and belongs to me. Here's the random salt I used to seal it.

Note: A 'salt' is a random value added to the commitment to add randomness. This prevents linking any two commitments to the same recipient.

To "spend" an envelope, you don't take it down (that would allow others to link it to you). Instead, you go to the Town Magician - someone who can produce a magical receipt that says:

I'm holding a sealed envelope that's pinned to the board; I'm cancelling it; here are the new envelopes I'm pinning to replace it; the math all balances.

The receipt mathematically proves all of this is true, but reveals nothing about which envelope or what was inside.

Once that's done, you hand the magician's receipt to the Town Clerk along with a unique cancellation token (to prevent double spending the old envelope) which can only be computed from your stamp. We call this a nullifier because it's used to nullify an envelope.

The Clerk checks the jar. If your token isn't already in there, then the receipt is valid, and they:

  • Drop your cancellation token into the jar (nobody can spend from the envelope again).
  • Pin your new envelopes to the board.

In the process, the bulletin board grows, the jar gets one more token, but no observer can tell whose envelope was cancelled, whose new envelopes were pinned, or what amount changed hands.

That's the entire system in one mental picture. Now, let's lift the curtain.

The Onchain State - What's Actually Stored

On Midnight’s public ledger, you’ll only ever see two main cryptographic structures (plus the ZK proof):

  • The Commitment Merkle Tree (the Bulletin Board):
    An append-only Merkle tree that stores every shielded note/commitment ever created. Each leaf is a cryptographic commitment, i.e., a sealed envelope that hides the value, owner, and other private data. Because it’s a Merkle tree, wallets can efficiently prove that a particular note exists on the board without revealing which one it is.

  • The Nullifier Set (the Glass Jar):
    A growing set of unique nullifiers. When you spend a note, its nullifier is added here. This prevents double-spending forever. Once a nullifier is in the set, that note is permanently spent.

That’s it. There are no visible addresses, visible amounts, or visible links between transactions. The entire history of who sent what to whom is hidden in the private state on users’ devices.

How a Shielded Transaction Actually Works

Now that you understand the pieces, let's walk through a full transaction. Say Alice wants to send shielded tokens to Bob.

Step 1: Alice finds her note
Alice's wallet scans its private state and finds a note she owns (commitment on the bulletin board). Her private state tells her -

Commitment #893479 contains tokens belonging to you. Here's the salt (blinding factor), value, and Merkle path proving it's on the board.

Step 2: Alice creates new outputs
Alice needs Bob's public address to create a new note for him. Using it, she generates:

  • A commitment for Bob: sealed envelope containing amount for Bob, Bob's public address, and a fresh salt.
  • A commitment for herself as change: sealed envelope containing change amount, her address, and a different salt.

Step 3: Alice generates the ZK proof (locally)
Alice's wallet runs the circuit logic entirely on her device. It:

  1. Takes her private data (value, salt, Merkle proof)
  2. Takes Bob's public address
  3. Computes the nullifier for the old note from her secret key
  4. Produces a proof asserting all of the following simultaneously:

A note belonging to Alice exists in the Merkle tree

She is nullifying exactly that note

The new commitments sum to the same value as the old one

She hasn’t revealed the note index, the value, or her identity

Step 4: Alice submits to the network
Alice sends the proof + the nullifier + the new commitments. The node:

  • Verifies the ZK proof (yes/no)
  • Checks the nullifier isn't in the Nullifier Set

If both pass: nullifier goes in the jar, new commitments go on the board. The transaction is now complete.

The node never saw Alice’s identity, the amount, or who she sent to. It only verified the proof and checked the nullifier.

Step 5: Bob discovers his note

Now you might be wondering - "How does Bob even know he received anything?"

Before we understand how this works, it's important to understand the different keys generated by a seed phrase:

  • Spend Key: This is a secret key. It never leaves your device and is used to generate nullifiers and authorize spending your notes
  • Viewing Keys: This is what decrypts incoming notes during trial decryption, and lets you see your balances and transaction history. This key is what enables selective disclosure - you can prove you paid your taxes by sharing your viewing key with a regulator, without giving them your spending key.
  • Address: This is your public-facing address. Anyone who has it can create sealed commitments addressed to you. You post this publicly so people can pay you.

Now with that out of the way, let's proceed:

Bob’s wallet continuously scans every new commitment on the bulletin board. Using his viewing key, it tries to decrypt each one. If a commitment successfully decrypts and identifies Bob as the recipient, his wallet adds it to his private state. This is called trial decryption.

It's worth noting that Alice doesn’t notify Bob. Bob’s wallet discovers the payment on its own, by watching the public board through his secret monocle. There’s no on-chain event that says “Bob got paid”, just a new sealed envelope that only Bob can read.

What the Proof Actually Guarantees (and Doesn’t)

There’s a subtle point worth understanding: the ZK proof guarantees that given the inputs provided, the circuit rules were followed. It does not guarantee that the off-chain code supplying private data, called the witness, behaved honestly.

The witness can’t lie about the spent note’s value. The circuit recomputes the commitment and checks it against the Merkle tree. If there is a mismatch, the proof fails.

The witness can lie about the output amounts. Bob’s commitment hasn’t been created yet, so there’s nothing to check against. As long as the outputs sum to the input, the proof passes.

This means if Alice’s wallet puts 1 token in Bob’s commitment instead of 10, the network accepts it. Bob decrypts the note, sees the actual value, and discovers he was short-changed, but only if he had a prior agreement with Alice about what to expect. The chain can’t help him since the proof was valid and the math was balanced.

The takeaway: the proof covers the circuit, not the witness.

Why This Matters

  1. Senders stay private. An observer sees nothing more than: “an envelope was cancelled, two new ones appeared.”
  2. Recipients stay private. No on-chain event says “Bob got paid.” Bob discovers his notes through trial decryption.
  3. Amounts stay private. The board shows sealed envelopes, not balances.
  4. Double-spending is impossible. The Nullifier Set is public, immutable, and checked by every node.
  5. Everything is still verifiable. You verify the proof + check the nullifier. You don’t need to see the data.
  6. Disclosure is selective. Share your viewing key with an auditor to prove compliance. Your spending key stays with you.

Midnight calls this “programmable privacy” because developers decide what’s public and what’s private, field by field. The compiler enforces the boundaries.

And that's the article. Hope it made shielded transactions a little less mysterious and helped Midnight’s shielded model click.