← Back to trust

Midnight

After Midnight

A source-level analysis follows Compact, proof generation, key custody, maintenance authority, consensus, governance, and the Cardano bridge.

ContentsBrowse sections

Midnight Network’s blockchain gathers several mechanisms under programmable privacy. Compact, its contract programming language, governs whether witness-derived influence may enter a public result. The prover determines which process receives private proving material. Wallets and indexers determine where decryption authority lives. Contract maintenance, validator selection, governance, and the Cardano bridge decide who can change or interrupt the system.

A narrow part of that claim can be tested cleanly. Compact 0.31.1 rejects a fixture in which a witness-derived value enters exported ledger state without disclose(). Its paired form compiles when the value is wrapped, and the emitted JavaScript and zero-knowledge intermediate representation (ZKIR) omit the wrapper. The corresponding compiler source contains witness-taint and wrapper-removal passes; source-to-release build correspondence remains unresolved.

The test establishes one compiler rule whose scope ends before proof construction, key custody, public effects, verifier maintenance, and network operation. Beyond that point, privacy becomes a chain of custody across processes, keys, authorities, software, and external data.

The source records identify the exact source revisions, package versions, observations, and limits used below.

Basis of analysis

Thirty-one public repositories, pinned at the commits and blobs named in the source records, carry the source-level claims here. A paired Compact 0.31.1 fixture built from the macOS arm64 release archive supplies the compiler result, and nine official application and scaffold repositories supply the deployment-default comparison; eight of them carry retained lockfiles and package archives, and create-mn-app’s generated-application lockfile is unavailable. Network evidence is one point-in-time session centered on finalized block 1,866,780, with committee results scoped to Cardano epoch 645 and sidechain epoch 991728 and Cardano reserve state queried separately; the original response bodies were not retained. Source capability is not released-binary attestation, and a configured default is not executed conduct.

Compact’s Witness-Dataflow Rule

The Compact language reference describes witness data as private and requires a declaration when witness-derived influence reaches a public result. The witness-protection pass performs an abstract interpretation over that influence.

In the compiler source, disclose() clears the wrapped expression’s witness taint and the next compiler pass removes the syntax. In the paired 0.31.1 fixture, emitted JavaScript and ZKIR contain the ledger assignment without the wrapper.

The paired test covers a direct witness-to-ledger assignment. The compiler pass operates over a broader dataflow graph whose conclusions depend on imported interface annotations. Asymmetric access, mandatory revelation, and compliance interfaces arise later through circuit design, credentials, key distribution, and services.

Compact tracks dataflow represented in source and trusts the disclosure annotations exposed by imported interfaces. The language reference warns that a call into another contract can disclose a witness-derived value when the callee’s interface permits it. Cross-contract behaviour, external services, wallet state, and key custody sit outside that compiler view.

Compiler permission, decryption, and application disclosure Each mechanism acts on a different object and grants a different kind of authority.
Compiler declaration disclose()

Marks witness-derived influence as permitted by Compact’s source analysis. A later source pass removes the wrapper.

Decryption custody Viewing key

Enables its holder to test records presented at the key’s scope for relevance or decryption.

Application protocol Application-designed credential

A separate application protocol defines the statement a holder proves or reveals.

disclose() governs compiler permission, a viewing key governs ciphertext discovery, and an application credential governs the proposition released. Each mechanism assigns authority at a different layer.

Midnight Proof Construction and Proof-Preimage Custody

Where compilation settles whether witness-derived influence may reach a public result, transaction construction settles which process receives the material needed to prove it.

The ProofPreimage type includes direct inputs, a private transcript described in source as the private witness vector, public transcript inputs and outputs, a binding input, the communications commitment and its randomness, and a verifier-key location. The WebAssembly boundary serializes that structure before a provider call.

Midnight.js documents UnsubmittedTxData as privacy-sensitive in its transaction model, and describes its unprovenTx as material the proofs were designed to keep confidential.

The Midnight.js HTTP proof-provider client packages the serialized preimage and sends it to /check or /prove. The client accepts HTTP and HTTPS, which makes remote preimage delivery possible, and warns when a remote URL uses HTTP. Endpoint ownership and transport security are deployment properties.

The wallet takes a materially different route. Its WebAssembly prover constructs proofs in a browser worker after obtaining circuit material and parameters. The preimage enters a worker on the selected device. The application source records identify HTTP-provider construction from a connected wallet’s prover URI in the ZKLoan and Leaderboard browser paths. Live endpoint selection remains unobserved, leaving the route taken by any deployed instance outside this record.

Proof-preimage routes Wallet code implements browser-worker proving. Midnight.js implements HTTP proving, with loopback and remote addresses selected at deployment.
Privacy-sensitive proving input Serialized proof preimage

Private transcript · direct inputs · public transcripts · binding input · communications commitment and randomness · key location

On-device worker WebAssembly prover worker

The wallet’s WebAssembly prover sends the preimage to a browser worker on the selected device.

Loopback HTTP Device-local proof service

The Midnight.js HTTP client can address a loopback service. The address is a deployment configuration.

Remote HTTP Configured proof service

The same HTTP client can address a remote service. A deployed endpoint and operator remain unidentified.

Public result Proved contract call

The proved-call structure contains the address, entry point, public transcripts, communications commitment, and proof. The transcript carries declared effects.

The process receiving the preimage belongs inside the privacy boundary. Its operator, endpoint selection, authentication, transport, logging, crash reporting, browser environment, proxies, and cloud controls determine the custody actually delivered.

ZKLoan and Leaderboard Prover Endpoint Configuration

ZKLoan documentation says private credit data never leaves the user’s machine. In its examined browser source, raw credit score, income, account tenure, and a deterministic user-key hash go to an attestation API. Witness handlers in the contract path supply that profile, the provider signature and identifier, and the user secret. Separately, the UI passes the PIN as a requestLoan circuit argument. Browser code then constructs an HTTP proof provider from the connected wallet’s prover URI.

The examined attestation route configures open cross-origin resource sharing (CORS), validates only field presence, signs values supplied by the caller, and contains no authentication step.

The examined circuit verifies a signature under the registered provider key. The signed attributes originate in the request, and establishing their truth requires a separate attestation basis.

Leaderboard repeats the provider-selection issue. Its README advertises “in-browser ZK proving,” and contract comments say an ownership secret never leaves the machine. The browser manager builds an HTTP proof provider from the wallet-supplied URI. The secret becomes a witness to score submission and ownership verification. Endpoint locality depends on wallet configuration.

“Off-chain” names a ledger boundary, and “zero knowledge” names a verifier boundary. Operator, destination, retention, attestation basis, and prover custody are separate properties.

Midnight Viewing-Key Custody: Server Indexer and Local Wallet

Proof generation can keep witness material outside verifier view while wallet discovery later grants decryption capability to another process.

The examined indexer exposes a connect(viewingKey) mutation that returns a session identifier. Its API decoder accepts a Bech32m-encoded shielded secret encryption key, deserializes it, and exposes the secret to the domain layer. At rest, the server encrypts that key with ChaCha20-Poly1305, computes a deterministic hash for deduplication, and redacts it from debug output. That hash lets the wallet storage path reconnect the same wallet record and issue a fresh session.

During indexing, the server-side path reconstructs the shielded secret key and tests whether it can decrypt the guaranteed or fallible coin material in each transaction. ChaCha20-Poly1305 covers stored bytes, while relevance testing uses the reconstructed secret in the service process.

The connect(viewingKey) mutation accepts one shielded secret encryption key and evaluates transaction relevance across the subscribed wallet stream. Project documentation describes transaction-specific disclosure, and that description differs from the granularity of this API. Transaction-selective application credentials remain possible at the application layer.

Shielded Wallet 3.0.2 follows a different synchronization path. Its synchronization source subscribes to global Zswap events using a cursor and replays them locally with the wallet’s secret keys. The unshielded wallet supplies its public address. The examined code contains a server-side viewing-key filter and a client-side event filter, each attached to its own software surface.

Midnight’s Public Execution Surface

The indexer schema includes contract addresses, public state, maintenance authority, entry points, events, commitments, nullifiers, and ciphertexts. The ledger contains public transcripts and declared effects.

The source exposes a mixed execution surface: ciphertexts and commitments coexist with public contract state, transcripts, effects, events, and maintenance authority. Any privacy claim must name its object: witness, private state, ciphertext, commitment, nullifier, public transcript, contract state, event payload, unshielded balance, network metadata, or key custody.

Contract Maintenance Authority

A private contract remains usable only while the network accepts its verifier keys. Midnight makes that accepted set mutable through Contract Maintenance Authority.

Contract Maintenance Authority can replace its committee and insert or remove verifier keys for contract operations. The maintenance semantics apply an authorized update to an existing contract record. Its address, application ledger state, and balance can persist while the accepted verifier-key set changes.

The public guide says updatability is disabled by default. The raw ledger constructor creates an empty maintenance committee with threshold one.

The high-level Midnight.js deployment path samples a private signing key when the optional input is absent and forwards it into deploy construction. Independently, the low-level Compact.js fallback samples a signing key when its optional input is absent and constructs a one-member committee with threshold one. Application lockfiles determine which package pair a deployment actually uses.

Across the nine official application and scaffold repositories examined, every deployment call omits the optional signing key. Six repositories expose a user-facing path. Hello World, Battleship, and Private Party contain the examined calls in tests.

Seven locked repositories resolve Contracts 4.1.1 with Compact JS 2.5.1, and Counter resolves Contracts 4.0.4 with Compact JS 2.5.0. Replayed package members show that both resolved profiles generate a one-key, threshold-one authority when the signing-key input is absent. Create-mn-app declares Contracts and Protocol 4.1.1 in its template manifest. Its generated-application lockfile is unavailable.

A generated authority remains usable only while its private key is deliberately retained and protected. In the Private Party manual test function, deploy data contains the generated maintenance signing key, the test proves and submits the deployment, and the subsequent persistence call stores application private state. Nothing in the examined function persists that maintenance key.

Counter takes a different path. It encrypts private state and stored maintenance keys with a password derived from the public coin key. Password entropy derives from that public value. Base64 encoding and appended punctuation are deterministic formatting. Exploitation still requires the encrypted database and relevant public key.

Verifier-key authority after deployment Raw construction begins with an empty committee. The replayed application package profiles generate a one-member authority.
Ledger constructor Empty committee · threshold 1

An empty committee cannot meet threshold one.

Replayed application package profiles Generated maintenance public key · threshold 1

Contracts 4.0.4 with Compact JS 2.5.0 and Contracts 4.1.1 with Compact JS 2.5.1 produce this result when the signing-key input is absent.

Authorized maintenance
  1. Insert a circuit verifier key
  2. Remove a circuit verifier key
  3. Replace the authority

Contract address, application state, and balance can persist across the accepted circuit change.

Applications should publish the maintenance committee, threshold, key-generation path, storage arrangement, recovery procedure, and each verifier-key transition. Wallets and indexers should surface those records beside the contract address. Contract identification requires the address, authority history, and accepted verifier-key set.

Midnight Validator Selection from Cardano Data

The examined node source starts AURA for block authorship, GRANDPA for finality, and the BEEFY commitment service. Its authority-selection path consumes Cardano-derived candidate registrations, permissioned-candidate data, and an epoch nonce.

The selection code combines the Cardano epoch nonce with the Midnight epoch and draws from registered and permissioned candidates. That source tree’s production profile includes a Cardano node, db-sync, and Postgres. The follower failure paths stop proposal construction when Cardano data is stale. Verification retries an indeterminate Cardano reference and rejects after its configured retry count.

The system-parameter pallet stores the Midnight-side D parameter, which supplies the registered and permissioned seat counts used in committee selection, and gives Root authority to update it. Authority selection consumes those counts alongside the Cardano-derived inputs.

A point-in-time mainnet observation ran from 2026-07-27 00:00:29 through 00:01:31 UTC and reached finalized head 1,866,780, Cardano epoch 645, and sidechain epoch 991728. The queries returned 130 permissioned entries, zero registered entries, and thirteen distinct sidechain keys, each repeated ten times. D-parameter and AURA results refer to finalized block 1,866,780. Committee and Ariadne results refer to the reported epochs. A GRANDPA authority result and the original response bodies are unavailable.

The thirteen keys identify cryptographic identities. Operator control, beneficial ownership, and organizational independence remain unresolved. The May 2026 tokenomics whitepaper separately says that thirteen institutional-grade operators produced blocks at launch, including two operated by the Foundation and eleven operated by parties contracted by it (physical page 50, printed page 49). The whitepaper does not map those operators to the observed keys.

Federated Governance and Root Authority

The examined mainnet chain specification lists six Council keys and nine Technical Committee keys. The development runtime requires at least two thirds of each body and approval from both bodies before dispatching as Root. That same source path can change system parameters and replace the Cardano addresses or policy identifiers used for governance observation. Live membership and source-to-runtime correspondence remain unresolved, which confines these counts and thresholds to the examined specification and the development runtime rather than to the membership in force at any observed block.

The May 2026 text of proposed MPS-0030 describes a small federated committee and treats permissionless entry, quantitative takeover thresholds, and recovery under shrinking participation as ongoing research and implementation work. Development source contains registered-stake-pool machinery, and live registered participation remains unverified.

The development runtime source also disables its on-chain GRANDPA and BEEFY equivocation-report paths. Off-chain detection and deployed runtime correspondence remain unresolved.

Committee multiplicity in the observed session Session-scoped committee summary for sidechain epoch 991728. The AURA summary at block 1,866,780 has the same multiplicity.
13 unique validator-key identities 10 committee entries per key 130 permissioned committee entries
Block production AURA

The examined source starts AURA. The block-level query records 130 entries under thirteen keys.

Finality GRANDPA

The examined source starts GRANDPA. The observation has no corresponding authority result.

Selection inputs Cardano follower

Authority selection consumes candidate registrations, permissioned candidates, and the epoch nonce alongside Midnight-side D.

The development branch contains features absent from the source candidate indicated by the node’s client metadata. Available repository history leaves their ancestry unresolved. Until a reproducible client and runtime mapping exists, either tree can describe possible implementation behaviour without identifying the code executed on the observed network.

Midnight–Cardano Reserve Transfer Preconditions

Project documentation distinguishes two Cardano-to-Midnight paths. In a User Transfer, Cardano-side cNIGHT sent to the illiquid-circulation-supply (ICS) address makes the corresponding Midnight-side mNIGHT, less fees, claimable by the recipient. The documented Reserve Transfer path releases corresponding mNIGHT from the Midnight Reserve for block rewards. The handler in the source candidate indicated by client metadata maps valid user, reserve, and invalid-recipient cases into ledger system transactions.

At 2026-07-27 00:00:41 UTC, the checkpoint query for finalized block 1,866,780 returned 0x00, or SCALE-encoded None. The provider in the source candidate indicated by client metadata enters Inert when the checkpoint or main-chain script configuration is absent. Runtime identity, raw response bytes, and source-to-Wasm correspondence remain unavailable.

The Cardano deployment report identifies reserve and illiquid-supply validator hashes. In the examined reserve-contract source, logic_merge accumulates Cardano ADA and cNIGHT from all consumed inputs at the guarded credential. It then requires a continuing output at the guarded address to retain at least those accumulated amounts.

At 2026-07-27 00:01:42 UTC, the Cardano observation records the original outputs as unspent and reported logic hashes as matching the deployment report. Cardano and Midnight were queried separately. If the Cardano state is accurate at its observation time and the reported hash identifies the deployed validator logic, a direct Reserve-to-ICS decrease fails the cited preservation rule. Neither an atomic cross-chain observation nor a preserved raw Koios response is available.

The development branch contains a dedicated bridge pallet, governance-approved Cardano transaction hashes, and Treasury routing for unapproved User Transfers. The source candidate indicated by client metadata contains invalid-recipient routing and predates the approval-set surface. Runtime identity is unresolved for both, which leaves each tree a candidate description of implementation behaviour rather than a record of the code executed at the observed head.

Reserve-transfer conditions at two observation times The Midnight checkpoint and Cardano reserve were queried separately. An atomic cross-chain state is unavailable.
Cardano reserve Unspent reserve output

The queried output remained unspent, and its logic hash matched the deployment report. The Koios response body was not preserved.

Contract rule Continuing output preserves consumed reserve value

The rule applies if the reported hash identifies the deployed validator logic.

Midnight observer Checkpoint value: None

The value at block 1,866,780 decodes as None. Raw response bytes are unavailable.

Runtime condition Candidate source maps missing input to Inert

Runtime Wasm identity and source correspondence remain unresolved.

A later checkpoint or validator upgrade can change these conditions. A present-state claim requires fresh Midnight and Cardano observations, preserved raw responses, and executable source correspondence.

Kachina’s Formal Scope and the Missing Implementation Correspondence

The Kachina model formalizes private smart contracts through a state-transition function, explicit leakage, and dependency functions. Its central theorem applies to a defined contract class in an ideal non-interactive zero-knowledge (NIZK) hybrid world over a simplified ledger. Concrete constructions outside the core class require a separate equivalence or emulation argument. The paper limits its general interaction treatment to small closed sets of non-malicious contracts and describes the design as largely theoretical.

Kachina’s theorem ranges over its own contract class, leakage model, and simplified ledger. Applying it to Compact, ZKIR, the prover stack, wallet custody, indexer behaviour, the consensus runtime, or arbitrary contract composition requires a refinement argument that is currently absent.

The ledger specification excludes a security proof for complete Midnight behaviour and leaves system transactions, cost, events, and concrete formats incomplete. The implementation has private and public transcript structures and declared effects. Structural resemblance supplies no refinement proof from that implementation to Kachina’s model.

The examined Zswap implementation contains segments, contract-owned coins, transient coins, and an intent structure. Because the cited 2022 Zswap paper was unavailable in a form that allowed stable page-level verification, no claim here depends on its theorem statements. The implementation’s source shape cannot substitute for the proof scope of that paper.

Midnight Proof-System and Cryptographic Records

The proof implementation record describes a customized PLONK-family system using the Kate–Zaverucha–Goldberg (KZG) polynomial-commitment scheme over the BLS12-381 curve and a historical relationship to Halo2 components. Its security case must address the customized transcript, commitment, challenge, and recursion code actually present.

Proof Sizes and Incremental Verification

The ledger constants and proving tests expect 4,832-byte proofs for Zswap inputs and outputs and a 2,912-byte proof for a DUST spend. Generic contract proof length instead varies with circuit structure, queries, columns, permutations, lookups, quotient limbs, and opening point sets in the locked proof-system cost model. Proof-system documentation uses 128 for the bit length of truncated Fiat–Shamir challenges in recursive verification.

A development incremental verifiable computation module describes proof size and verification time as constant in folded-step count. This IVC module appears on a different source surface from the ledger lockfile, whose dependency set excludes midnight-aggregation.

Trusted-Setup Custody

The ceremony repository describes a powers-of-tau structured reference string (SRS) of length 225, Filecoin ceremony lineage, a public contribution chain, checksums, linkage verification, and a drand-derived final update. Independent verification would require replaying the 3.2 GB final SRS and full contribution chain, work that remains outstanding.

Audit Scope

The audit remediation record documents responses to specific zkSecurity findings. The circuit and standard-library READMEs captured for the development and release families label those broader libraries unaudited.

Scope of Midnight’s Programmable Privacy Claim

The Compact 0.31.1 fixture records one enforceable boundary: an unmarked witness-derived ledger write is rejected. From that point onward, privacy depends on which process receives the preimage, which wallet or indexer holds discovery keys, which fields the contract emits publicly, which authority may replace verifier keys, and which network controls govern execution. Formal claims apply only where a correspondence argument connects those implementation layers to the model.

A privacy system should publish a custody statement as ordinary technical documentation:

  • where private state is created and stored

  • whether proof construction is local, wallet-delegated, or remote

  • exactly what a remote provider receives

  • whether a viewing key leaves the wallet, at what granularity, and for how long

  • which ledger fields and application events are public

  • the contract maintenance committee, threshold, and verifier-key history

  • the deployed software revision and reproducible binary identity

  • the validator-key set, selection rule, and organizational control where known

  • every external data dependency that can stop production or verification

  • the claimed formal model, established correspondence, and unresolved gaps

Risk analysis follows custody. Remote proving makes the operator, transport, and service environment material, while on-device proving makes browser and device integrity material. Maintenance authority makes key custody and recovery material. Each boundary needs a named receiving process, controller, and failure mode.

Method and Limits

The inquiry spans thirty-one public repositories covering the Compact compiler, ledger, proof system, SDK, wallet, indexer, node, architecture, applications, governance proposals, Cardano reserve contracts, partner-chain tooling, token distribution, and the Kachina source. The source records identify the exact source states and artifacts.

The application comparison follows every deployment call found in nine selected official application and scaffold repositories. ZKLoan, Leaderboard, Private Party, and Counter supply the cases on attestation, prover configuration, and key custody. The application source records preserve the package and path details behind those conclusions.

The compiler test uses the Compact 0.31.1 macOS arm64 release archive and a paired fixture that differs only by the disclose() wrapper. It inspects both the compiler result and the emitted JavaScript and ZKIR. Matching source passes were identified. Upstream release metadata and reproducible source-to-binary correspondence remain unavailable.

Formal sources include Kachina, PLONK, the proof-system version selected by the ledger lockfile, and the trusted-setup repository. Institutional and architectural context comes from the project’s tokenomics paper and proof-of-stake sidechain paper. Claims unique to the Zswap and sidechain papers are excluded because their exact editions could not be verified at page level. Independent replay of the trusted setup remains outstanding.

The network evidence is a point-in-time observation centered on finalized block 1,866,780, with committee results scoped to Cardano epoch 645 and sidechain epoch 991728. Cardano reserve state was queried separately. The original response bodies are unavailable. Reproducible compilation, deployed runtime identity, organizational ownership, atomic cross-chain state, setup replay, and formal implementation correspondence remain unresolved.

Scope of Inference

Four evidence layers carry the results above, and they do not substitute for one another. A pinned source revision establishes what code can do. An executed release archive establishes what the Compact 0.31.1 macOS arm64 binary did on the paired fixture, a result no pinned source revision attests. Retained archives and lockfiles establish which package members a declared profile resolves when an optional input is absent. A point-in-time query establishes what an endpoint returned inside its window. None of the four identifies the code that executed on the observed network, and none supports a causal claim about operator conduct or intent.

Every result above therefore holds at the layer of source capability, executed release-archive behaviour, release-mapped package resolution, or reported observation. Authority over disclosure, decryption, verifier keys, block production, and reserve movement falls inside that domain. Adoption, market structure, operator identity, the security of any deployed instance, and the behaviour of any contract this survey did not open fall outside it.

The thirteen distinct sidechain keys returned in the observed session identify cryptographic identities rather than organizations, and the tokenomics whitepaper’s operator description is not mapped to them. The nine examined applications record what official code does, and they carry no weight as a sample of third-party deployment practice. Kachina’s theorem ranges over its own contract class, leakage model, and simplified ledger, so it settles nothing about Compact, ZKIR, the prover stack, wallet custody, indexer behaviour, the consensus runtime, or arbitrary contract composition until a refinement argument connects them.

Falsification

One claim carries the analysis: the Compact 0.31.1 rule rejects an unmarked witness-derived ledger write, and every mechanism after it locates authority in a named process, key holder, or committee rather than in that rule. Five observations would defeat it. Four resolve against the pinned sources or a repeated query; the fifth requires an atomic cross-chain observation that this record does not hold and that Method and Limits leaves unresolved.

  1. Recompiling the paired fixture with the Compact 0.31.1 macOS arm64 release archive and obtaining a successful compile of the unwrapped form, or emitted JavaScript and ZKIR that retain the disclose() wrapper, would defeat the compiler result in Compact’s Witness-Dataflow Rule.

  2. Reading the cited Midnight.js HTTP proof-provider revision and finding that it refuses non-loopback addresses, or reading the ZKLoan and Leaderboard browser paths and finding a fixed device-local prover address in place of the connected wallet’s URI, would defeat the custody argument in Midnight Proof Construction and Proof-Preimage Custody and ZKLoan and Leaderboard Prover Endpoint Configuration.

  3. Finding in the cited indexer revision that connect(viewingKey) accepts a per-transaction disclosure token in place of one shielded secret encryption key, or that the wallet scan tests relevance without reconstructing the shielded secret in the service process, would defeat the granularity argument in Midnight Viewing-Key Custody.

  4. Replaying the resolved Contracts 4.0.4 with Compact JS 2.5.0 and Contracts 4.1.1 with Compact JS 2.5.1 members and obtaining an empty maintenance committee when the signing-key input is absent, or finding a signing key passed in any of the nine examined deployment calls, would defeat Contract Maintenance Authority.

  5. A preserved atomic cross-chain observation showing a consumed Reserve output whose continuing output holds less than the accumulated ADA and cNIGHT, while the reported logic hash still matches the deployment report, would defeat the preservation inference in Midnight–Cardano Reserve Transfer Preconditions.

The first four conditions resolve against a pinned source revision or a repeated network query rather than against a statement of intent, and the fifth waits on a preserved cross-chain record this survey did not obtain. A revised project description of proof locality, a fresh marketing claim about in-browser proving, or a governance proposal reaching a later status would leave all five findings standing.

References

Compact, Ledger, and Application Stack

LFDT Minokawa. Compact compiler. Witness-protection record and disclose-removal record.

Midnight Network. n.d. “Compact Language Reference.” Reference.

Midnight Network. Midnight.js source. HTTP proof-provider record and deployment-helper record.

Midnight Network. Wallet source. local WebAssembly prover record.

Midnight Network. Indexer source. viewing-key decoder record and wallet storage record.

Midnight Network. Shielded Wallet 3.0.2 source. local filtering record.

Midnight Network. n.d. “Making a Decision on Contract Updatability.” Guide.

Formal and Cryptographic Sources

Kerber, Thomas, et al. 2021. “Kachina — Foundations of Private Smart Contracts.” Paper. Formal theorem record.

Dauterman, Emma, et al. 2022. “Zswap: zk-SNARK Based Non-Interactive Multi-Asset Swaps.” Exact PDF custody and paper-specific claims remain open. Paper.

Gabizon, Ariel, Zachary J. Williamson, and Oana Ciobotaru. 2019. “PLONK: Permutations over Lagrange-bases for Oecumenical Noninteractive Arguments of Knowledge.” Paper.

Midnight Network. Proof implementation and ledger dependency records. Proof-size model record and ledger proof-size record.

Midnight Network. n.d. Trusted setup. Ceremony record.

Consensus, Governance, and Bridge

Midnight Network. Source snapshot named by the observed public node client version. Bridge-handler record and checkpoint boundary record.

Midnight Network. n.d. “Consensus Decentralization.” Proposed MPS-0030. Proposal.

Midnight Network. “Midnight Tokenomics and Incentives Whitepaper.” May 2026. Whitepaper.

Midnight Network. Reserve-contract source. Reserve-logic record.

Midnight mainnet RPC. Observation session whose finalized head was block 1,866,780. The decoded summary and response digests informed the scoped observation above. Raw response bodies were not retained.

Source Records

Repository excerpts and immutable locators

LFDT Minokawa. track-witness-data; LFDT-Minokawa/compact@cb5f94e; compiler/analysis-passes/track-witness-data.ss, including lines 18–23, 469–474, and 539–549. Git blob e2f3c59da06c7d4040aaf71adedb25fc5d448d4d. Policy. Analysis.

LFDT Minokawa. remove-disclose; LFDT-Minokawa/compact@cb5f94e; compiler/analysis-passes/remove-disclose.ss, lines 18–23. Git blob 7941daccb580a7981efb5f6b7a59a4de7a1530d0. Source.

Midnight Network. ProofPreimage; midnightntwrk/midnight-ledger@e1edad2; transient-crypto/src/proofs.rs, lines 696–729. Git blob 7b60458755b34124bebb8f11a1654e96c1edfede. Source.

Midnight Network. Proof-preimage serialization and provider calls; midnightntwrk/midnight-ledger@e1edad2; ledger-wasm/src/tx.rs, lines 370–443. Git blob 46f77545f605350fd37046834ecf29f8008aace6. Source.

Midnight Network. Privacy-sensitive transaction-data annotations at midnightntwrk/midnight-js@6120d35; packages/contracts/src/tx-model.ts, lines 25–50 and 195–239. Git blob 245a74b2fe41f1b4a5a67e8b50eeba0caac752c6. Source.

Midnight Network. HTTP check and prove; midnightntwrk/midnight-js@6120d35; packages/http-client-proof-provider/src/http-client-proving-provider.ts, lines 83–169. Git blob a37d71c6965cb53209884204d6d533e4732dae18. Source.

Midnight Network. Local WebAssembly proof provider; midnightntwrk/midnight-wallet@1b0bfb2; client at packages/prover-client/src/effect/WasmProver.ts, lines 146–255, Git blob 2740b2f56ce59ea0854bb4d55569509083ae4e0d; worker runtime at packages/prover-client/src/proof-worker.ts, lines 25–105, Git blob 5372e806d9053ab1315d81eea9ba0a41d120b086. Client. Worker.

Midnight Network. ZKLoan browser proof-provider configuration and attestation request; midnightntwrk/example-zkloan@a0846fd; zkloan-credit-scorer-ui/src/contexts/ZKLoanContext.tsx, lines 299–315 and 532–549. Git blob 194c098e9baa32271e7043a9403b232f54e64365. Source.

Midnight Network. ZKLoan private-state and witness material; midnightntwrk/example-zkloan@a0846fd; contract/src/witnesses.ts, lines 24–78, Git blob 9586afe2a6af6432d1f6df3a1b3b563aa505cc61. The UI passes amount and PIN as requestLoan circuit arguments in zkloan-credit-scorer-ui/src/contexts/ZKLoanContext.tsx, lines 518–588, Git blob 194c098e9baa32271e7043a9403b232f54e64365. Witness source. Circuit-call source.

Midnight Network. Open CORS policy, presence-only validation, and signing of caller-supplied ZKLoan values; midnightntwrk/example-zkloan@a0846fd; zkloan-credit-scorer-attestation-api/src/server.ts, lines 10–60, Git blob 3e5031aa0242cc9954b3bb941a0e6521bd3c42e8; and README.md, lines 232–236, Git blob 1faf964be0cf06631736abc8cebb6815455b58ad. Service source. Claim source.

Midnight Network. ZKLoan provider-signature verification in the examined circuit; midnightntwrk/example-zkloan@a0846fd; contract/src/zkloan-credit-scorer.compact, lines 117–132. Source.

Midnight Network. Leaderboard proof locality; midnightntwrk/midnight-leaderboard@e715681; browser provider at leaderboard-ui/src/contexts/BrowserLeaderboardManager.ts, lines 100–129, Git blob c42ee5aae0c8f8f54c5c5cd64c460fe7c49ae72d; README claim at lines 7–16, Git blob 5e0b9a5a0eb030f08c4810d6c57d416266145957; and secret witness at contract/leaderboard.compact, lines 68–79, Git blob b16567f833c560dd6422d5b67b5ac8f089c7a945. Provider source. Claim source. Witness source.

Midnight Network. Viewing-key API decoder; midnightntwrk/midnight-indexer@4565e5b; indexer-api/src/infra/api/v4/viewing_key.rs, lines 23–47. Git blob 27ebd172e86779bee9f4bb1b13a93fc69837d333. Source.

Midnight Network. Viewing-key encryption, hash identity, and session storage; midnightntwrk/midnight-indexer@4565e5b; indexer-common/src/domain/viewing_key.rs, lines 25–100, Git blob a24b45f89df85ce5928be36f79d2306812bb1a9b; and indexer-api/src/infra/storage/wallet.rs, lines 24–72, Git blob 197bb0cd027387c9d5bf973e276940a70c533d1a. Key source. Storage source.

Midnight Network. Shielded Wallet 3.0.2 global Zswap subscription and local secret-key filtering; midnightntwrk/midnight-wallet@7365f98; packages/shielded-wallet/src/v1/Sync.ts, lines 238–310, Git blob 01da3e663783d385e952b9c2e9d413bdcf0a7821; retained Connect query at packages/indexer-client/src/graphql/queries/Connect.ts, lines 16–22, Git blob 7ff33eec38e504c08170efbc36a09a5625e2dc9b. Sync source. Query source.

Midnight Network. New contract maintenance state; midnightntwrk/midnight-ledger@e1edad2; onchain-state/src/state.rs, lines 700–720. Git blob 585f6150625309168938d8818728240e8eaf893b. Source.

Midnight Network. Optional deployment signing key; midnightntwrk/midnight-js@6120d35; packages/contracts/src/deploy-contract.ts, lines 32–53 and 91–97. Git blob 5880b8f693c4710daf71016a1a7debda2ac3f40b. Source.

Midnight Network. Generated one-of-one maintenance authority; midnightntwrk/midnight-sdk@80e6707; compact-js/compact-js/src/effect/ContractExecutable.ts, lines 672–693. Git blob 115eb0c7fccf6d44fd976f5483c4186687a90133. Source.

Midnight Network. Stable deployment helper and nine retained application or scaffold paths that omit signingKey. Midnight.js 5f8a5d1, Git blob 21fe1c30af1b59b6a8862aa95968580f97449709; create-mn-app d159206, blob a65c5c6ba4fb15ebd9b5bd911fd0111d9f3c6336; Battleship 7512cb3, blob 33bb2a6f9277e51dea51fac0186538e0f2e4fe14; BBoard 0b68b23, blob f19f2021b3a13255f46a0010da3fb5dadabc84f4; Counter d7dd408, source blob 4b044d71958dbedcdae711eb11f12d3aedd1e867 and lockfile blob 6807510debf413a0327ad60c5087721a284c64a3; Hello World 96f323b, blob 0b2dac93dcedbd8e569da026e34ae9b56aac0201; Private Party 837975a, blob 4b01306909f7b763320fbb9841b18ec21d927db6; ZKLoan a0846fd, blob 194c098e9baa32271e7043a9403b232f54e64365; Leaderboard e715681, blob 065d5e5782963d652c038e9681c3baad1c8f85e5; Wallet DApp 457b589, blob 1398a923eda900cf239d85a9a4d798cda1280a72. Counter’s lock resolves Contracts 4.0.4 and Compact JS 2.5.0; retained archives have SHA-256 d0c45a1c0b8b2ef72038d3781490d7b8071ecb8a588a1e9519cfe3a22b735284 and fc699818139d7abe8429d9499877e2b93435ffb16b1cde968ec28b728ccf7fb0. Seven other repositories have retained locks resolving Contracts 4.1.1 and Compact JS 2.5.1. Create-mn-app declares Contracts and Protocol 4.1.1 in its template manifest; its generated application closure is unavailable. Helper. Scaffold. Battleship. BBoard. Counter. Counter lock. Hello World. Private Party. ZKLoan. Leaderboard. Wallet DApp.

Midnight Network. Midnight.js 5f8a5d1 returns an unproven deployment’s maintenance signing key in private deploy data at packages/contracts/src/unproven-deploy-tx.ts, lines 109–156, Git blob a554221f1afacfd12a37fc50ea70807690d9c980. Private Party’s manual path proves and submits that deployment, then persists only application private state at midnightntwrk/example-private-party@837975a, src/test/party.test.ts, lines 410–445, Git blob 4b01306909f7b763320fbb9841b18ec21d927db6. Its declared Contracts 4.1.1 profile resolves Compact JS 2.5.1; the retained Compact archive SHA-256 is df8be5fe83483bcda5fbade157be7423c5833c3a44dc777a908026ad9fa13a67, and its ContractExecutable.js member SHA-256 is 173260f05faa4e61a60f54db774e8576ae7bfdd6e535a5105ca2b2c3b7bcc2a6. Deploy-data source. Tutorial source.

Midnight Network. Counter derives its storage password from a public coin key; midnightntwrk/example-counter@d7dd408; counter-cli/src/api.ts, lines 529–548, Git blob 4b044d71958dbedcdae711eb11f12d3aedd1e867; exact lockfile lines 607–619, Git blob 6807510debf413a0327ad60c5087721a284c64a3. The lock selects Level Private State Provider 4.0.4; retained archive SHA-256 4f96b81d08e734925e2f0ff2b4eb7520b58b8781afc88ff2504b93c70e58c350. Its provider member, SHA-256 d791338bfe619c7dfdbb5ebe13773cf40c58a094a9d58c47c0bc8dda6f93392a, warns against public material and encrypts both private state and stored maintenance keys through the password-backed layer. Examined source revision 5f8a5d1 carries the same warning, Git blob f14bf07e708f33ccf0036a0611e8b1dd834dd55b. Example source. Exact lock. Provider source.

Midnight Network. Formal-security and specification scope; midnightntwrk/midnight-ledger@e1edad2; spec/properties.md, lines 1–6, Git blob cb5182c04a75b66c7df78438bca31dafc060db6a; and spec/README.md, lines 8–16, Git blob a8b3188c33d8f36fa86c8e3a29e8327f1e1e48fd. Properties. Scope.

Kerber et al. Kachina theorem; tkerber/kachina@f97ec7e; proof/theorem.tex, lines 1–6. Git blob d679d07b99fc1b9554afa31c78f19368e83a4d44. Source.

Midnight Network. Proof-size cost model used by ledger proof-system family; midnightntwrk/midnight-zk@0e3ebfa; proofs/src/dev/cost_model.rs, lines 129–250. Git blob a6d71871e99b2bca84bafde6aba8f970c9eefcdf. Source.

Midnight Network. Zswap and DUST proof constants and tests; midnightntwrk/midnight-ledger@e1edad2; zswap/src/structure.rs, lines 629–633, Git blob b21db4eb7db151cad58d9c73e9ddf2487bafeddf; and ledger/src/dust.rs, lines 2101–2144, Git blob 70bf0e74a8f08585d5792f27017921a13c8e7713. Zswap source. DUST source.

Midnight Network. AURA, BEEFY, and GRANDPA service startup; midnightntwrk/midnight-node@706fc087; node/src/service.rs, lines 744–898. Git blob 65f8abaa4bd13bda914eb5ccdabae73ab7811bd0. Source.

Midnight Network. Cardano-derived authority-selection inputs; midnightntwrk/midnight-node@706fc087; partner-chains/toolkit/committee-selection/authority-selection-inherents/src/select_authorities.rs, lines 14–58. Git blob 6f4e464292a69a468713a48cb1fc208db8a08178. Source.

Midnight Network. Approved-motion Root dispatch; midnightntwrk/midnight-node@706fc087; pallets/federated-authority/src/lib.rs, lines 267–318. Git blob 54c1b8250434a67020a3716ff809921ec702a316. Source.

Midnight Network. Bridge transfer handler in the source revision named by the observed client version; midnightntwrk/midnight-node@8af7d08a; runtime/src/c2m_bridge.rs, lines 25–88. Git blob 9bddd72de27b50fd68ad1ea8ca165a9688a8a829. Source.

Midnight Network. Bridge inherent-data provider configuration boundary in the source revision named by the observed client version; midnightntwrk/midnight-node@8af7d08a; partner-chains/toolkit/bridge/primitives/src/lib.rs, lines 411–428. Git blob 837af976cb4d21aa1798b610a5d8c2cb8a14b7ce. Source.

Midnight Network. Documented Reserve Transfer and User Transfer effects at development revision 706fc087; docs/c-to-m-bridge.md, lines 13–34. Git blob c05a920c84fa8efd5a6fb3d99f491122bfd8a150. The documentation distinguishes reserve distribution for block rewards from recipient claimability and limits the approval-set special case to User Transfers. Runtime identity at the recorded head remains unresolved. Source.

Midnight Network. Reserve value-preservation rule; midnightntwrk/midnight-reserve-contracts@3eecaa0; lib/logic/script.ak, lines 14–77. Git blob 998183e01fb50ae5da47dc65a7bb852ccbe02eee. Source.

Midnight Network. Server-side wallet connection and relevance scan at midnightntwrk/midnight-indexer@4565e5b: mutation blob 69d55e013a019459725b5371f0a3844a6eff529d; schema blob 66eab2bf6139fe74ab965ec4fea44d7ef1bee7d8; transaction-relevance blob f8a20722b822efa64f68765a91d126c74eb00fcb; wallet-scan blob a1d37bf61f2e0a69d9b95a4a87a5f16c70dd9df6. The transaction-granular documentation and wallet-session API are retained at midnightntwrk/midnight-docs@0771012, blobs 36c907a2774ffa7500afd96aace5afb559befa1a and ede6a4d8ff0b4ea9e0f315df0d7add518986ac92. Mutation. Scan. Documentation.

Midnight Network. Public contract and transaction fields in Indexer GraphQL schema v4, Git blob 66eab2bf6139fe74ab965ec4fea44d7ef1bee7d8. Ledger contract-call transcripts at midnightntwrk/midnight-ledger@e1edad2, blob acbb9f2f216c3041f54afc4480707c7a35c3ffc6; transcript structure blob 09fb1abc6bac5270588fac9d62b53cbe7b114980; declared-effects application blob bf7f0be835432d26c8e3c2e3f121b3d5aac0035a. Contract schema. Transaction schema. Contract call.

Midnight Network. Maintenance update types, application, and authorization at midnightntwrk/midnight-ledger@e1edad2: ledger/src/structure.rs, lines 2684–2722, Git blob acbb9f2f216c3041f54afc4480707c7a35c3ffc6; ledger/src/semantics.rs, lines 1472–1526, blob 7c423bfcd603bae3620e00637e6a2baf14c7b296; ledger/src/verify.rs, lines 1738–1787, blob 78c179480377e30656f13a318c01d18836ddb052. Types. Application. Authorization.

Kerber et al. Kachina model and stated limits at tkerber/kachina@f97ec7e: state and leakage, blob fc81a2a3d106d814292fe874092190efd35f9979; contract class, e5b65e8698f24bbc1c146ba10a6e17f19055cddc; emulation boundary, 0098598e7c3492fee8034f11e10b27308073725d; interaction boundary, 2642375f0aa39a5a12b3cb5620c82c3635f858e2; implementation boundary, 5c49dcb8c07d4a02241c2e670fb5c821d8068f2b; simplified ledger, fc9d7d6f8151691ba1f9e8e626446a2173da34dc. State and leakage. Class. Implementation boundary.

Midnight Network. Zswap proving test and implementation model at midnightntwrk/midnight-ledger@e1edad2: proving test blob 75a11ac5ef60a989ac0072f9580c6589c6faef38; contract-owned, segmented, and transient coin structure blob b21db4eb7db151cad58d9c73e9ddf2487bafeddf; executable intent and segment structure blob acbb9f2f216c3041f54afc4480707c7a35c3ffc6; explanatory intent specification blob 7bd6aa127a20454b9946760fd4cbf7fe6529ab0e. Zswap structure. Intent model. Proving test.

Midnight Network. Proof lineage and 128-bit truncated challenge record at midnightntwrk/midnight-zk@31435e9, proofs/README.md, Git blob 228665a0a9197fc6a52b1a9fc98eaef74f622690; truncation utility warning, blob bcdc707e94f01b44b7d5ac8f31bd7b810f16458c; ledger PLONK/KZG construction at midnightntwrk/midnight-ledger@e1edad2, blob 7b60458755b34124bebb8f11a1654e96c1edfede. Proof record. Ledger construction.

Midnight Network. Development IVC module at midnightntwrk/midnight-zk@31435e9, aggregation/src/ivc/mod.rs, lines 1–20, Git blob daf0dfc70e6586054abe4e5a4f5bcb375587e0e2. Examined ledger dependency lock at midnightntwrk/midnight-ledger@e1edad2, Git blob 6c42ead8aabb024d671e62b0d575b16a27a38108; no midnight-aggregation name appears in the retained Cargo manifests or lockfile. IVC. Dependency lock.

Midnight Network. Ceremony lineage, final artifact, verification procedure, and drand-derived final update at midnightntwrk/midnight-trusted-setup@3ea6102, README.md, lines 1–237, Git blob 5f594cfa428aa51e8865e2c957f739ba750fc416. Lineage and verification. Final update.

Midnight Network. Audit disclaimers and remediation history at midnightntwrk/midnight-zk@31435e9: Circuits README blob 7525b2ace124a75151ffff9b4fe669ea738e566e; Standard Library README blob 9736ed947e13bfd1b91a3a17676dce6c1774d343; Proofs changelog blob ee21f4b5415c72beb1d1f1ada50847071b536c9a; Circuits changelog blob 9104ef9ae5721f995b2745eb7578fe2377103685. Release-family disclaimers at 1c158e2: Circuits blob f413829c904a49ebab0d181f120bf5552ed4ca0b; Standard Library blob f2762e9320a0cfef96f60122fb4cecb3fb888fd1. Proof remediation. Revision disclaimer. Release-family disclaimer.

Midnight Network. Cardano follower health and block-production failure paths at midnightntwrk/midnight-node@706fc087: db-sync health blob 9e91e7fdb9b9223947d552c1065f29856ce5edcf; main-chain reference classification blob 21504e0aaf6b4ef94750be1a2ff1eea98dbc5f75; proposal and verification inherent-data blob 8391603523bfc4f2caed86d5c544bc0680f37945; proposal digest failure blob f14e83216b04e7e613dedbb47f09f5160b73635f; retry and rejection verifier blob bd53dea9ed4f2d610a7100466294dffa5a7f03ca. Inherent data. Verifier.

Midnight Network. D-parameter storage and governance origin at midnightntwrk/midnight-node@706fc087: system-parameters pallet blob 10f57bcb32528e02f7fbbe3c723b0d4541571ad1; runtime wiring blob 41b40d84e8ba83e940d31cead5f405abe7f7b23e. Storage. Runtime origin.

Midnight Network. Mainnet chain-spec membership and development federated authority at midnightntwrk/midnight-node@706fc087: mainnet specification blob 411e47099344f911ab9961e283e9b449ff72444a; threshold composition blob 41b40d84e8ba83e940d31cead5f405abe7f7b23e; Root dispatch blob 54c1b8250434a67020a3716ff809921ec702a316; Cardano reference replacement blob c49bc3658ae8db8287d44ffd7454f1368cddbf86. Chain specification. Thresholds. Reference replacement.

Midnight Network. Disabled on-chain GRANDPA and BEEFY equivocation-report paths in the development runtime; midnightntwrk/midnight-node@706fc087; runtime/src/lib.rs, lines 1515–1687. Git blob 41b40d84e8ba83e940d31cead5f405abe7f7b23e. Source.