Skip to content

Allow wallet policies with musig() to pre-generate nonces before the transaction is known #551

Description

@bigspider

Currently, the psbt_session_id (and the entire MuSig2 Round 1 flow) are dependent on the actual transaction being signed.

This prevents software wallets that want to benefit from the non-interactive signing with preprocessing, which would allow the UX of MuSig2-based wallet policies to practically be a single round like a normal multisig wallet policy (by pre-executing Round 1 when given the chance - for example right after sending a transaction).

The coordinator software wallet would therefore need to pregenerate the pubnonces (after deciding a maximum number of inputs - as large as possible, but taking into account what is feasible on embedded devices), and then directly execute Round 2 once the transaction is known.

For that to happen, we would need some changes in the app:

  • change the psbt_session_id to only depend on the wallet policy, and not on the transaction
  • modify musig_nonce_gen - currently it depends on the aggregate key tweaked for the input pair (base don (is_change, address_index); it could rather depend on the untweaked aggregate key.
  • make it easy and cheap to execute Round 1. Currently, even in Round 1, the app does the full inputs/outputs validation to check whether inputs are internal, which is expensive. All those checks should be skipped for pubnonce-only generation. We can probably figure out how to signal 'MuSig Round 1 only' from the PSBT in order to avoid changes in the wire protocol, but we need to figure out the cleanest way.

To consider:

  • Making the psbt_session_id only depend on the wallet policy would have the side effect of only allowing a single signing request to happen for that account. It might be worth allowing the software wallet to optionally provide an ID and committing to it in psbt_session_id, allowing multiple sessions per account managed by the same (or multiple) coordinators.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions