Feat: Refactor multisig to use signer addresses instead of public keys#694
Merged
Feat: Refactor multisig to use signer addresses instead of public keys#694
Conversation
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
- Updated `ChainCallDTO` to enforce requirements for multisig, including mandatory `signerAddress` and `dtoOperation`. - Modified signature validation to throw errors for unsupported multisig operations. - Enhanced `PublicKeyContract` to streamline multisig user registration and signer management. - Improved test cases to reflect changes in multisig logic and ensure proper validation. Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
… of the key Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
Signed-off-by: Jakub Dzikowski <jakub.t.dzikowski@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key improvements in the new flow:
Details:
The authorization in SDK is built around public keys. In the most common flow you register a user, you need to provide user alias (similar to username), and user public key. As a result two objects saved on chain:
The authorization process:
The first pass on multisig implementation used the same approach. That was reasonable, because of the relevant low shift, small incremental change. Instead of a single public key a multisig registration requires multiple public keys, and saves multiple objects on chain:
The multisig authorization process:
But that approach turned out to be problematic when we started discussions about actually using multisig profiles (wallets). There were two major friction points:
GCUP/<eth-addr>to be unique on chain. That means any public key needs to be unique, and you cannot use your existing metamask account to sign your personal account and also participate in multisig wallets.All of that led to major reimplementatation of the multisig feature which have been done in this PR. The most important change is that multisig profiles no longer require a list of public keys. Instead they require a list of user refs (can be both eth address and gala chain user alias) - and that resolves a friction point number 1. Additionally, we no longer need to save public keys (
GCPKobjects) what resolves friction point number 2. Any existing user on GalaChain (excluding TON users) can now participate as a signer in a multisig profile.In the new flow on registration you need to provide user alias and signer addresses, for instance:
And it saves only one object on chain:
Notes:
GCUP/<eth-addr>client|user2, then the valueclient|user2will be saved as the signer.In this case the authorization flow:
a. and multisig user alias in
signerAddress(in this caseclient|multisig2)b. and
dtoOperationparameter (protection against using dto for wrong method)c. and
dtoExpiresAtparameter (additional security enforcement)That also means the core change is not in the authorization process, but in the API (
signerAddress,dtoExpiresAt), and the underlying data model (signersinstead ofpublicKeys).