Skip to content

[Feature] Support sample_authorization_with_tvks for externally signing call graphs with record inputs #3307

Description

@vicsn

🚀 Feature

NOTE: this is wontfix for now because existing MPC runs sign exactly one request. Multiple requests can be handled as a multi-session flow: we can simply run the protocol once per request. That keeps the MPC self-contained and sidesteps the nested-call / dependent-request handling out of the MPC.

--
In the flow we currently have in mind, one:

  • Calls sample_authorization and gets the mock requests
  • Samples random tvks and populates the requests with correct values, IDs and signatures
  • Calls authorize_requests on the correct requests to get a correct authorization

The issue is that, for request inputs of type Record or DynamicRecord, the nonce they contain is constructed (and asserted in-circuit to correspond to) the tvk of the transaction that minted the (corresponding static) record. In particular, if any of the requests takes as an input a Record or DynamicRecord produced by another request in the same transaction, sample_authorization will have constructed its nonce from a bogus tvk and it will fail to verify.

To resolve this, we can create a sample_authorization_with_tvks which operates like sample_authorization but receives the tvks and makes sure the Record and DynamicRecords input and output are populated with the correct nonces from the provided tvk. We could reuse the CallStack variant from sample_authorization, add the tvk information to it, and transform sample_authorization into a wrapper: sample dummy tvks and call sample_authorization_with_tvks. I estimate this at 1-2 days of work, including testing, but ofc it can be less or more contingent on potential snags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions