Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web-client multisig primitives #3246

Open
wants to merge 4 commits into
base: albatross
Choose a base branch
from
Open

Web-client multisig primitives #3246

wants to merge 4 commits into from

Conversation

sisou
Copy link
Member

@sisou sisou commented Jan 16, 2025

What's in this pull request?

Expose basic primitives for multisig operations through the web-client API.

The primitves are:

  • RandomSecret
  • Commitment
  • CommitmentPair
  • PartialSignature

Also add a Address.fromPublicKeys(public_keys, num_signers) method to calculate a multisig address from the participating public keys.

These primitives enable the client-side operations of the multisig app with the @nimiq/core package alone and thus remove the need for custom Rust-compiled-to-WASM in both the Multisig App and Keyguard.

This PR does not include what are currently server-side operations, such as aggregating commitments, summing partial signatures or calculating merkle paths. That might get added later in a separate PR (tracked by a separate upcoming issue).

This fixes #1578.

Pull request checklist

  • All tests pass. The project builds and runs.
  • I have resolved any merge conflicts.
  • I have resolved all clippy and rustfmt warnings.

@sisou sisou added the enhancement New feature or request label Jan 16, 2025
@sisou sisou requested a review from jsdanielh January 16, 2025 20:15
@sisou sisou self-assigned this Jan 16, 2025
@sisou
Copy link
Member Author

sisou commented Jan 16, 2025

I was not able to bundle the multisig primitives into a separate entry point, unfortunately, as the multisig primitives also use common primitives like PublicKey and PrivateKey. When loaded in two separate WASM modules, they cannot access each other's memory (pointers).

Copy link
Member

@jsdanielh jsdanielh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add multisig support for the web client
2 participants