forked from kaspanet/rusty-kaspa
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding multisig capabilities to wallet (kaspanet#279)
* Create MultiSig account functionality Introduced logic for creating MultiSig accounts including multisig account arguments and logic to execute and create a multisig account, and the update of existing variables for multisig accounts. Removed initial warning which stated MultiSig accounts are not supported. Also added a new file for 'as_slice' functionality. This update provides a valuable addition to wallet functionality by allowing multiple signatures for account access, greatly enhancing security. * "Add multisig account creation support to wallet core and CLI" Updated wallet core and CLI to support the creation of multisig accounts. New error types were added to cater to potential failures during this operation. Added a new 'multisig' account type to the CLI. The functionality to filter accounts based on their private key data was reworked to accommodate multisig accounts. Moreover, logic to create a multisig address was incorporated into the derivation module. The use of multisig addresses also required storage updates and changes in the runtime configuration. Also, the creation wizard in the CLI was updated to include promotional messages regarding multisig addresses. * Improve error handling in key derivation Errors while getting the manager keys in the wallet derivation module are now properly handled. Instead of a potential panic when a `None` value was encountered, a more error-resilient approach is used. This improves error management and the overall robustness of the key derivation process. * "Add multi-signature account import functionality to wallet" This commit extends the import feature of the wallet by adding support for multi-signature accounts. The updated functionality allows users to import multi-signature wallets using mnemonics and an optional payment password, and adjust the number of required signatures to finalize transactions. * Remove payment secret from multi-signature accounts The 'payment_secret' field has been removed from the MultisigCreateArgs structure and all associated logic in wallet.rs and account.rs. This change is made to simplify the account creation process as the 'payment_secret' was optional and it was causing confusion. Now the account creation relies solely on prv_key_data_ids, making the flow more straightforward and user-friendly. * "Add support for exporting MultiSig account" This commit adds the ability to export MultiSig accounts in the Kaspa CLI. Previously, only SingleKey accounts were supported for export. This update adds conditions to check the kind of account (via the account_kind() method) before proceeding with the export process. For MultiSig accounts, the export_multisig_account function is invoked which retrieves the private key data IDs, asks for the wallet password and prints the required number of signatures and all associated mnemonics. If additional xpub_keys are found, they will also be printed. This change allows users to backup their MultiSig account data as conveniently as for SingleKey accounts, improving the CLI's functionality. The MultiSig struct has been updated to expose the necessary fields for this feature. * Refactor MultiSig creation to factory method To improve readability and maintainability, MultiSig struct instances creation scattered in different places are now replaced with a new factory method `MultiSig::new()`. Other changes include reduction of redundant struct declaration and removed the Debug trait from the Secret struct. --------- Co-authored-by: aspect <[email protected]>
- Loading branch information
1 parent
11cc019
commit 83f840a
Showing
18 changed files
with
561 additions
and
144 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.