JsonPrepareExecutePipeline
The prepareExecute pipeline: JSON prepare → verify → sign → gRPC execute.
Why the transaction can cross between JSON and gRPC unharmed
In the gRPC API PrepareSubmissionResponse.prepared_transaction is a message; in the JSON API the same field is a string. Verified live against Canton 3.5.12: that string is base64 of the serialized protobuf — the server rejects non-base64 with The string is not a valid Base64 and rejects a JSON object with wrong type, expecting string.
That single fact is what makes this design sound. The prepared transaction is decoded straight back into its protobuf form and handed to the existing, golden-vector-tested hash verifier and submission path; there is no JSON→proto transcode anywhere, so nothing can drift between what the participant prepared, what the user approved, and what gets signed.
What the wallet supplies, and why
The dApp's commands are proxied verbatim. Everything around them is the wallet's, and actAs above all: it is the party the user approved, taken from PrepareExecuteContext.actAs, never from the dApp's request. A dApp able to set it could make the wallet act as any party it names. DappSession has already validated any requested actAs — and any requested readAs — against the peer's grant before this runs, so both name only parties the user approved.
Note the envelope carries fields Canton's published OpenAPI calls optional — synchronizerId and packageIdSelectionPreference. The decoder requires them anyway (verified live), so they are always sent.
Constructors
Functions
Runs prepare, verify, sign and execute for context and returns the executed event. Throw DappException to fail the request with a specific code; any other exception becomes -32603.