Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →In Midnight, private state is kept locally by the user or application, while public state is recorded on the ledger. Contract logic can use private inputs to create zero-knowledge proofs for validators, but anything deliberately written to public state—or explicitly disclosed—does not become secret just because a later computation uses it privately. For developers, the job is to define that boundary clearly and design local storage, account isolation, and recovery around it.
What counts as private state in Midnight?
Midnight separates public ledger state from private state held locally. Public fields and transactions designated public are visible on-chain. Contract logic can use private inputs to produce zero-knowledge proofs that validators can check without receiving those inputs. A proof can protect the inputs used to establish a result; it cannot conceal a value that the contract makes public. Midnight’s overview describes the network’s public and private model, and its FAQ explains disclosure and recovery concerns.
As an Amazon Associate I earn from qualifying purchases.
| State or operation | Where it is held or used | What others can see |
|---|---|---|
| Public state | On the ledger | Public ledger values are visible, including when private logic later reads them. |
| Private state | Locally by the user or application | Raw private inputs are not sent to validators merely because they are used in proof generation. |
| Intentionally disclosed value | Exposed by contract logic | The disclosed value is public; private computation does not reverse that disclosure. |
The developer defines the boundary in Compact, including which fields synchronize to the ledger. Treat classification as a design decision for each field, not as a property automatically supplied by a zero-knowledge proof.
How Midnight.js handles private and public state
Midnight.js gives the two state domains separate provider roles. Its privateStateProvider handles encrypted local application state; its publicDataProvider queries public chain state through the indexer. Other providers support ZK artifacts, proof generation, wallet operations, and transaction submission. The API reference documents contract initialization with initialPrivateState and separate queries for private and public state. These details are from the Midnight.js API reference, labeled v4.0.4; use the compatibility guidance for the versions in your project rather than treating API behavior as a timeless protocol rule.
#1 Best Overall
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Execution context changes the storage backend
The deployment guide says browser builds use browser storage, while server-side contexts resolve to native LevelDB. Keep private-state handling in the client code where that is the intended context, and inspect server routes, edge functions, and other execution paths before allowing them to access private state. A server-side path may not use the same storage location or isolation assumptions as a browser path. See the deployment and operations guide.
Scope each store to an account
The documented LevelDB provider requires an accountId; the guide describes this as preventing state from leaking across accounts. Choose a stable identifier that fits the wallet and account model, and do not reuse one store namespace for unrelated users. Confirm the provider’s exact configuration against the SDK version you deploy.
Rank #2
- Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Set the privacy boundary before writing contract logic
- Classify every field. Decide whether it must be public, remain private, or be intentionally disclosed. Record that decision alongside the contract’s state model.
- Trace each output. Follow private inputs through proof generation and identify what the contract writes to public state or otherwise exposes.
- Do not confuse private use with private origin. A computation may consume a public ledger value, but that does not hide the original value.
- Review disclosure deliberately. The official FAQ identifies
disclose()as the Compact operation for intentionally exposing values derived from private witness data. Check syntax and compiler behavior for your Compact version before relying on it.
This review should cover values derived from private inputs as well as fields named explicitly in the contract: the important question is what the contract exposes, not only where a value began.
Recommended Free Tools
Protect encrypted local state and its credentials
The v4.0.4 Midnight.js API reference identifies AES-256-GCM for private-state encryption at rest. The deployment guide specifies a password of at least 16 characters, using at least three of uppercase letters, lowercase letters, digits, and special characters. Those are documented SDK guidance and may be version-sensitive; verify the current requirements for the packages you use.
Rank #3
- Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
The guide advises deriving the password from wallet credentials or a key management system rather than hardcoding it in source. Encryption does not remove credential risk: a lost credential can make persisted state inaccessible, while a password embedded in application code is not a safe secret. Decide how credentials are provisioned, protected, and recovered before relying on the store in a transaction flow.
Make password failures visible at unlock time
The deployment guide warns that a wrong password may not be detected until encrypted state is first decrypted, potentially deep into a transaction flow. It documents a canary pattern to check for wrong-password failures during unlock.
Rank #4
- Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
- Provision deliberately. Create the expected canary as part of the initial setup for the account’s private-state store.
- Verify on unlock. Read and validate the canary before allowing the application to proceed as though the store were usable.
- Separate missing from invalid. Treat an absent canary during first-time provisioning differently from a failed check on an existing store. Do not silently accept a missing canary as proof that the supplied password is valid.
- Stop before transaction work. If verification fails, surface the problem before a user enters a flow that depends on decrypting private state.
The guide establishes the canary as a failure-detection pattern, not as a replacement for secure credential storage or a recovery plan.
Free tools Windows power users keep installed
One-click scans. No signup required.
Plan backup and recovery separately from wallet recovery
A wallet seed phrase can restore unshielded addresses and assets, but the official FAQ cautions that it does not necessarily restore shielded notes or contract-specific private data. If required local state is lost, a user may be unable to generate proofs needed to access or spend shielded assets. Therefore, do not describe a seed phrase as a universal backup for an application’s private state.
Design backup coverage around the actual data your application needs and the consequences of losing it. Explain to users which state is backed up, how they can restore it, and what may remain unavailable if local device or browser storage is lost. The available sources do not establish one backup method that applies to every Midnight application.
Keep versions and generated artifacts compatible
The deployment guide advises following the official support matrix for package versions and warns that duplicate copies of ledger packages can produce incompatible TypeScript types. Recheck the matrix and regenerate or validate artifacts when changing the compiler, runtime, or SDK. The API reference’s v4.0.4 label identifies the documentation version reviewed here; it is not a substitute for checking the versions supported by your own project.
Quick Recap
Implementation review checklist
- Can the team explain which fields are public, private, and intentionally disclosed?
- Does each execution path use the intended local storage backend?
- Is private state scoped to the correct account rather than shared across users?
- Are encryption credentials kept out of source code, and is their recovery addressed?
- Does unlock detect a wrong password before transaction logic depends on decrypted state?
- Does the backup plan cover the application’s required private data, not just wallet assets and addresses?
- Are compiler, runtime, SDK packages, and generated artifacts aligned with the current support guidance?
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




