Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungAutomating Bug Reports with Tally and Make(22.09.2026 um 22:44 Uhr)
Sichere ProgrammierungHTB - Forest(22.09.2026 um 22:49 Uhr)
Sichere ProgrammierungYour Ports Are Lying About Your Business(22.09.2026 um 22:52 Uhr)
Sichere ProgrammierungOLTP vs. OLAP: Understanding the Foundation of Modern Data Systems(22.09.2026 um 22:54 Uhr)
Sichere ProgrammierungYour AI Meeting Assistant Is Taking Notes. Who Is Doing the Work?(22.09.2026 um 22:57 Uhr)
Sichere ProgrammierungDebuggear se va a acabar(22.09.2026 um 23:03 Uhr)
Sichere ProgrammierungAutomating Bug Reports with Tally and Make(22.09.2026 um 22:44 Uhr)
Sichere ProgrammierungHTB - Forest(22.09.2026 um 22:49 Uhr)
Sichere ProgrammierungYour Ports Are Lying About Your Business(22.09.2026 um 22:52 Uhr)
Sichere ProgrammierungOLTP vs. OLAP: Understanding the Foundation of Modern Data Systems(22.09.2026 um 22:54 Uhr)
Sichere ProgrammierungYour AI Meeting Assistant Is Taking Notes. Who Is Doing the Work?(22.09.2026 um 22:57 Uhr)
Sichere ProgrammierungDebuggear se va a acabar(22.09.2026 um 23:03 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

What actually stays private on Midnight! (A builder's mental model)

Intro Coming from the XRPL, the challenge for me has been grasping what actually stays hidden on a privacy chain and how they acomplish that. On a transparent ledger, you always know what is public, because everything is. On Midnight…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Intro



Coming from the XRPL, the challenge for me has been grasping what actually stays hidden on a privacy chain and how they acomplish that. On a transparent ledger, you always know what is public, because everything is. On Midnight the answer is not obvious, and getting it wrong is exactly how supposedly private data leaks.



Here is the mental model I use. Once it clicked, most of my privacy mistakes stopped.






Three places your data can live



On Midnight, every value in a contract sits in one of three places, and the place decides who can see it:




  1. Witness data: private inputs that never leave the user's device.

  2. Ledger state: public, on chain, visible to everyone forever.

  3. Disclosed values: things you deliberately move from private to public with disclose().



Get these three straight and most privacy bugs disappear.






1. Witnesses: the private inputs



A witness is a value the contract receives from the user's local environment. It feeds the zero-knowledge proof, but it never goes on chain.




import CompactStandardLibrary;

// A private input. The prover knows it. The chain never sees it.
witness getBalance(): Bytes<32>;






The key idea: a proof can depend on a witness without revealing it. A contract can prove "the balance is at least 100" while nobody learns the balance. And anything derived from a witness is also treated as private by the compiler, which matters in a minute.






2. Ledger: the public state



Ledger fields are the opposite. They are stored on chain and readable by anyone.




// Public state. Everyone can read this, now and forever.
export ledger balance: Bytes<32>;






If a value reaches a ledger field, it is public. Full stop. There is no private ledger. So the only interesting question is how a private witness ever gets into a public ledger field. It does not, unless you say so.






3. disclose(): the deliberate door



Midnight will not let you move witness-derived data into public space by accident. If you try, the compiler stops you:




export circuit recordBalance(): [] {
balance = getBalance(); // compiler error: undeclared disclosure
}






You have to open the door on purpose with disclose():




export circuit recordBalance(): [] {
balance = disclose(getBalance()); // ok: you declared the disclosure
}






disclose() does not encrypt or protect anything. It is a declaration: I know this value came from private data, and I am choosing to make it public. That is the entire point. Disclosure is an explicit, auditable decision, not something that happens to you.



This is the mental flip from transparent chains. There, everything is public unless you do extra work. Here, everything private stays private unless you deliberately disclose it.






Where it gets people: the boundary is sticky



The trap is that "derived from a witness" spreads. The compiler tracks it through arithmetic, type casts, function calls, even conditionals.




witness getBalance(): Uint<64>;

export circuit balanceExceeds(n: Uint<64>): Boolean {
return getBalance() > n; // compiler error: the boolean still leaks the balance
}






Returning whether the balance exceeds n is not safe just because you did not return the balance itself. The comparison result is derived from private data, so the compiler still makes you disclose() it. That is the feature working. It forces you to notice that even a yes or no answer is a disclosure.






A subtler leak: disclosing is not the same as hiding



Here is the part that bites even careful people. The compiler treats some standard library routines as safe to disclose. A commitment, transientCommit or persistentCommit, is treated as not containing witness data, so you can publish it without a disclose() wrapper.



But the compiler allowing it is not the same as it being secret. If you commit or hash a value that has only a few possible inputs, anyone can brute-force it:




// looks safe, is not: a yes/no vote has only two possible hashes
recordedVote = disclose(persistentHash<Field>(localVote()));






An observer hashes 0 and 1 and instantly knows the vote. The fix is a commitment with fresh secret randomness:




witness voteSalt(): Bytes<32>;   // fresh, secret, never reused

recordedVote = persistentCommit<Field>(localVote(), voteSalt());






The salt is the real secret. Same value plus a fresh salt gives a different, unguessable output. The compiler will not verify the salt is actually fresh or secret. That part is on you.






A checklist before you ship



Before any circuit goes out:




  • Is it a witness, or derived from one? Then it is private, and the compiler will fight you if you leak it. Good.

  • Does it land in a ledger field, or get returned from an exported circuit? Then it is public. Did you mean that?

  • Is there a disclose() in the path? Then stop and ask: is this value low-entropy or guessable? If so, use a commitment with a fresh salt, not a bare hash.

  • Did I reuse a salt anywhere? Identical inputs make identical commitments, which links them. Fresh salt every time.



That is the whole model. Three buckets, one deliberate door, and a hard look at anything going through it.






Closing



Privacy on Midnight is not magic, and it is not something you just assume happens.



The way I look at it is simple.



Midnight gives builders privacy by default, but there is still a door you choose to open when something needs to be revealed.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten What actually stays private on Midnight! (A builder's mental model)

Thematisch verwandte Begriffe: What, actually, stays, private · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-82000 | Adobe Experience Manager Forms JEE is affected by a Server-Side Request …
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick