Private State Manager integration #1571
Replies: 5 comments 11 replies
-
I would suggest that the dependencies with the state manager are over more generic interfaces as opposed to over crates. We do something like this with the node for example, where we import a crate to generate Rust types based on protobuf definitions (that do come from the node's codebase) at build time and use those to construct clients. I haven't deeply looked at the proposal yet but the high-level API and changes look good! |
Beta Was this translation helpful? Give feedback.
-
|
Also a fairly high-level look - but overall looks great! Thank you for writing this up. Some preliminary thoughts: I think there are 3 levels/stages of integration:
|
Beta Was this translation helpful? Give feedback.
-
Interface and flowI have a few questions on the specific items:
What is the scenario for needing to download the full account state? You mention this CLI command: miden-client psm sync --account alice --psm-url https://psm.testnet.miden.io --full # force GetState as fallbackBut I wonder in which particular scenarios we'd need the fallback, as opposed to only downloading the delta(s) and applying to whichever account state the client currently holds. For the coordinator, you mention:
Why does the coordinator have to sign? My understanding (which is based on how this is done currently in the https://github.com/0xMiden/MultiSig/ design) is that the coordinator role does not involve participation beyond collecting the signatures. One could make one of the signers assume the coordinator role, but it's not strictly required and I think easier to reason about them as separate entities. Let me know if the trust assumptions on the coordinator and their role are different to what I envisioned. I understand the lib interface might still be in draft mode, so maybe this is a premature comment:
Do we explicitly need to pass |
Beta Was this translation helpful? Give feedback.
-
|
Hey guys, just wanted to share some things I have in regards to UX, since the discussion was leaning towards implementing a separate psm-client (separate from the normal rust crate): would integrating multisig functionality directly into the main client be better for users? It would keep things to a single crate import; the recent store split from the main client crate caused some confusion for pioneers upgrading to v12. If PSM / multisig live in a dedicated crate, how does that translate to the web client? I imagine everything would still be exposed from one SDK package (as is now) with an opt-in multisig / PSM module? I don’t have a strong position yet, just want to make sure we weigh DX and upgrade friction alongside the architectural separation. |
Beta Was this translation helpful? Give feedback.
-
|
I'm coming back to this conversation with some updates and plans for integration with PSM.
(*) this is essentually a 1-of-2 multisig (**) where either the main and recovery key can send valid transactions and fetch the account state from PSM - this covers the use case of LOST key, in cases of COMPROMISED key we might need to think more about some extra security constraints. (**) we will need to create rust bindings of multisig + psm account components in @bobbinth I think of this as the "minimal valuable integration" with PSM, we can expand the feature set down the road |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I would like to share and collect feedback about a proposed integration of the private state manager (PSM) with Miden client.
This is part of the efforts for solving: 0xMiden/miden-proposals#3
The main goal is to define what are the integration areas and how the APIs will look like from the developers standpoint using
miden-clientas a library (web and rust) and the CLI.PSM Overview
Private State Manager consists of a server-side app and a client library. The server exposes both an HTTP and gRPC APIs including:
Syncronization Layer
GetPubkey(GetPubkeyRequest) -> (GetPubkeyResponse)Fetches the PSM public key for further configuration.
Configure(ConfigureRequest) -> ConfigureResponseCreates/Configures the miden account in the Private state manager server, sending the full state of the account.
PushDelta(PushDeltaRequest) -> PushDeltaResponseWhen a participant of the account wants to send a new transaction modifying the state, the change (transaction summary) is sent to the PSM server, then the PSM acknowledges the change by signing its commitment and sending the signature as a response, in the context of Multisigs the client will use this signature as an advice of the transaction execution for on-chain verification.
GetDeltaSince(GetDeltaSinceRequest) -> GetDeltaSinceResponsePulls all the deltas since the specified nonce (local nonce) - the deltas are merged in the server, so locally the client must apply the delta into the local account
GetState(GetStateRequest) -> GetStateResponsePulls the full state of the account from the PSM server, passing the account id as parameter.
Coordinator Layer (Multisig)
PushDeltaProposal(PushDeltaProposalRequest) -> PushDeltaProposalResponseSends a
TransactionSummaryobject to PSM for collecting signatures for further execution.GetDeltaProposals(GetDeltaProposalsRequest) -> GetDeltaProposalsResponseLoads all the
TransactionSummaryobjects proposed in PSM, including the signatures collected for each.SignDeltaProposal(SignDeltaProposalRequest) -> SignDeltaProposalResponseAttaches a new signature to a proposed
TransactionSummaryand sends it to PSM.miden-clientrequirementsSyncronization
ConfigureAPI).miden-clientmust load the public key of the PSM and add it as part of the account configs.miden-clientmust first simulate it, then send the tx summary to to PSM (PushDeltaAPI) and optionally (if multisig), use the signature in the response and as an advice of the transaction.GetDeltaSinceAPI), and applying the missing deltas to the local account.GetStateAPI)PushDeltaProposalAPI).Coordinator
GetDeltaProposalsAPI)TransactionSummaryafter pulling it from server (GetDeltaProposalsAPI) and then send the signature to the PSM (SignDeltaProposalAPI).General
AccountIdand add the signature as part of the request.Proposed API changes (illustrative)
CLI
Configure PSM endpoint
configure a wallet
sync deltas
miden-client psm sync --account alice --psm-url https://psm.testnet.miden.io miden-client psm sync --account alice --psm-url https://psm.testnet.miden.io --full # force GetState as fallbacktransaction submission with PSM acknowledgement
coordinator flow
Library
Initialize
configure account on PSM
sync missing deltas
load full account from psm
sending transactions
multisig proposal helpers
I would like to get opinions on this, I might be missing some details or overlooking important things about the integration as I'm not super familiar with the
miden-clientcodebaseBeta Was this translation helpful? Give feedback.
All reactions