TL;DR
Miden keeps private state (accounts and notes) off-chain, preserving user privacy and reducing on-chain data bloat. However, this architecture comes with two major challenges:
- Loss of local state = permanent loss of access
- Shared accounts (e.g. multisigs) require manual and insecure state sync
There are workarounds today (e.g. encrypted backups via Google Cloud), but we lack a canonical and user-friendly solution for both solo and shared state management. This discussion outlines the problems, proposes potential directions, and invites contributions for a robust and developer-friendly private state strategy.
Problem
1. State Loss
In Miden, private state lives locally on the user's machine. If users lose their local state (e.g., due to disk failure or device change), the state is gone forever — there’s no way to recover it from the chain or another party.
2. Shared State Synchronization
When multiple parties share control over the same account (e.g., in a multisig setup), they each need the latest state to generate valid transactions. This opens up two issues:
- Manual state exchange is required and error-prone
- Trust assumptions arise: a dishonest party can withhold or manipulate state updates, potentially invalidating others' actions or locking funds
Current Workaround
- The WebClient allows exporting/importing local state
- Users can manually encrypt their
.mac state files (e.g., with a password or derived key) and upload them to a cloud provider like Google Drive
- State can then be re-imported on another device or restored in case of loss
However:
- There’s no standard backup format or strategy
- It’s not user-friendly
- It doesn’t solve the shared state problem
Vision
We envision a canonical private state management solution with the following properties:
- Automatic encryption + off-device storage (cloud, IPFS, Matrix, etc.)
- Seamless recovery on device loss
- Multi-party sync support for shared accounts, without relying on trust
- Optional delegation to “state guardians” who hold the latest encrypted state (and potentially co-sign all txs)
Proof of Concept Ideas
For Solo Users:
- Encrypt state client-side and store it:
- On IPFS + pin via a gateway
- On a cloud storage provider (Drive, Dropbox, S3)
- On a Matrix room or secure peer channel
- Automatically retrieve latest backup on boot if keys match
- API to integrate solution for app developers
For Shared Accounts:
- Introduce a “state guardian” contract/account:
- Guardian(s) receive state updates signed by the account controller
- All multisig members can pull the latest state from them
- Optionally require guardian co-signatures for tx validity
- API to integrate solution for app developers
Final Product (Desired Outcomes)
Timelines
| Milestone |
Target |
| PoC: Cloud-based encrypted backup |
4 weeks |
| PoC: State guardians & sync |
4 weeks |
| Canonical solution integrated into Wallet/SDK |
2-3 month |
Open Questions
- Where should state be stored? IPFS? Matrix? Centralized cloud? All of them?
- How can we ensure forward secrecy for backups?
- How do we coordinate state versioning between multiple users?
- What are the trade-offs between guardians vs. full p2p sync?
Feel free to suggest improvements, share ideas, or volunteer to prototype below! 👇
TL;DR
Miden keeps private state (accounts and notes) off-chain, preserving user privacy and reducing on-chain data bloat. However, this architecture comes with two major challenges:
There are workarounds today (e.g. encrypted backups via Google Cloud), but we lack a canonical and user-friendly solution for both solo and shared state management. This discussion outlines the problems, proposes potential directions, and invites contributions for a robust and developer-friendly private state strategy.
Problem
1. State Loss
In Miden, private state lives locally on the user's machine. If users lose their local state (e.g., due to disk failure or device change), the state is gone forever — there’s no way to recover it from the chain or another party.
2. Shared State Synchronization
When multiple parties share control over the same account (e.g., in a multisig setup), they each need the latest state to generate valid transactions. This opens up two issues:
Current Workaround
.macstate files (e.g., with a password or derived key) and upload them to a cloud provider like Google DriveHowever:
Vision
We envision a canonical private state management solution with the following properties:
Proof of Concept Ideas
For Solo Users:
For Shared Accounts:
Final Product (Desired Outcomes)
Miden Wallet and SDK offer:
Shared account protocol:
Timelines
Open Questions
Feel free to suggest improvements, share ideas, or volunteer to prototype below! 👇