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

Add Support for Multisig Wallets #120

Closed
wants to merge 21 commits into from
Closed

Add Support for Multisig Wallets #120

wants to merge 21 commits into from

Conversation

alan-ssvlabs
Copy link

@alan-ssvlabs alan-ssvlabs commented Sep 16, 2024

Solves issue #118

To support Gnosis multisig wallet, this PR modifies the workflow of reshare and resign. Before this PR, an initiator starts a reshare/resign by sending a signedReshare/signedResign message. This PR breaks this process into two stages:

  1. Initiator sends a unsigned Reshare/Resign message. The original message and its hash are stored by the operators in a map.
  2. Initiator send signature(s) of the message hash. Operators starts Reshare/Resign upon successful signature(s) verification.

In the case of multisig users, this allows the users collect signatures for the Reshare/Resign message from external processes and submit to the operators later.

We support signature verification for multisig wallets that follows standard EIP-1271 signature verification process (Gnosis Safe is tested to work successfully)

Copy link

@GalRogozinski GalRogozinski left a comment

Choose a reason for hiding this comment

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

Hey,
can you delete all cli paths that work with using keystore directly?

cli/flags/flags.go Outdated Show resolved Hide resolved
pkgs/initiator/initiator.go Outdated Show resolved Hide resolved
pkgs/initiator/initiator.go Outdated Show resolved Hide resolved
pkgs/initiator/initiator.go Outdated Show resolved Hide resolved
pkgs/operator/instances_manager.go Outdated Show resolved Hide resolved
pkgs/utils/utils.go Outdated Show resolved Hide resolved
cli/flags/flags.go Outdated Show resolved Hide resolved
Comment on lines +83 to +93
// Contruct the resign message
rMsg, err := dkgInitiator.ConstructReshareMessage(
oldOperatorIDs,
newOperatorIDs,
signedProofs[0][0].Proof.ValidatorPubKey,
ethNetwork,
cli_utils.WithdrawAddress[:],
cli_utils.OwnerAddress,
cli_utils.Nonce,
signedProofs[0],
)

Choose a reason for hiding this comment

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

In the issue I had the requirement:

In the cli pass the resign/reshare messages along with their signatures as a string in serialized form (Talk with product about the serialization).

But maybe you are doing this in bulk?

Anyhow, the current way is good enough for me and if @RaekwonIII wants to change this he can talk to @MatusKysel

Copy link
Author

Choose a reason for hiding this comment

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

Indeed in this cli users pass the data for generating the reshare/resign messages instead of the messages themselves. Everything can be a string now including the signedProofs (updated in the bulk PR), so from the users perspective it would be pretty much the same. But of course we can update this if required.

pkgs/utils/utils.go Show resolved Hide resolved
KeystorePass = viper.GetString("ethKeystorePass")
if strings.Contains(KeystorePath, "../") {
return fmt.Errorf("😥 ethKeystorePass should not contain traversal")
Signatures = viper.GetString("signature")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Signatures = viper.GetString("signature")
Signatures = viper.GetString("signatures")

Copy link
Author

Choose a reason for hiding this comment

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

updated in Bulk PR

Copy link
Contributor

@MatusKysel MatusKysel left a comment

Choose a reason for hiding this comment

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

looks good, left few minor comments

pkgs/utils/utils.go Show resolved Hide resolved
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.

4 participants