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

feat: add ledger, stronghold and keychain into cli #2655

Merged
merged 42 commits into from
Feb 13, 2024
Merged

Conversation

lmoe
Copy link
Contributor

@lmoe lmoe commented Jul 2, 2023

Description of change

Adds a more secure layer into the wasp-cli.

It is based on the wasp-wallet-sdk library
Which is based on the iota-sdk native library

This feature introduces Ledger and Stronghold wallet providers.

Alternatively, the user can choose to remain using the common seed - but it will now be stored in the OS Keychain instead of the wasp-cli.json. The seed will be loaded into a more secure encrypted in-memory vault at runtime.

Starting from this version, each user is required to have the iota_sdk library next to the wasp-cli. Prebuilt releases are available here and are shipped with wasp-cli releases as well.

Type of change

Choose a type of change, and delete any options that are not relevant.

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)

How the change has been tested

The most delicate parts are in the two referenced dependencies.

The Go library has tests, which are to be found here
The Rust native lib does not have tests yet.

}

func (k *KeyPair) Sign(addr iotago.Address, payload []byte) (iotago.Signature, error) {
// TODO: Validate this
Copy link
Collaborator

Choose a reason for hiding this comment

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

So... who is going to validate this? 🤣

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did! Seems to work fine. :D

err := keyChain.SetSeed(seed)
log.Check(err)

log.Printf("In memory seed saved in the keychain.\n")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
log.Printf("In memory seed saved in the keychain.\n")
log.Printf("In-memory seed saved in the keychain.\n")

@Dr-Electron
Copy link
Contributor

After some weeks of working with this branch I didn't really have any major problems.

Some notes tho:

  • If I run init -c wasp-cli.json no config is created. It uses my keychain as default. But maybe a wasp-cli.json with that info should at least get generated. This allows me to specify a different config path with the -c option on init so that I can use that file for all future commands
  • Even if I change the scheme to stronghold the cli still seems to look for the keychain and store stuff there. Everything is working with stronghold just needs som cleanup I guess to not check for keychain stuff 🤔

@lmoe lmoe force-pushed the add_keychain_ledger branch 2 times, most recently from ac86e4b to f119eea Compare February 12, 2024 13:06
@lmoe lmoe marked this pull request as ready for review February 12, 2024 22:40
@lmoe lmoe merged commit b671dec into develop Feb 13, 2024
5 checks passed
@lmoe lmoe deleted the add_keychain_ledger branch February 13, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants