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

Generation of genesis keypairs #20

Merged
merged 40 commits into from
Apr 6, 2023
Merged

Generation of genesis keypairs #20

merged 40 commits into from
Apr 6, 2023

Conversation

lrettig
Copy link
Member

@lrettig lrettig commented Mar 28, 2023

Closes #25
Closes #17
Closes #16
Closes #15
Closes #14
Closes #13
Closes #12

Allow generation of wallet files in the correct format (as expected by smapp). Harmonize encryption and wallet data structure/file format. Allow reading of wallet files.

TODO: HDPaths are slightly different between smapp and smcli, fix this.

HD derivation has been removed for now. It'll be re-added when we finalize the spec.

Fix some typos
Create dot dir if it doesn't already exist
Add gitignore
Allow only `wallet' subcommand for now.
Fix a typo.
Copy over some speculos test boilerplate from go-ledger-sdk
Begin adding HW-related commands
Allow user to enter a mnemonic or else create a new one.
Don't overwrite existing wallet files.
Making compatible with SMIP-17 and the wallet file format used by smapp
Expected keys have changed since we're now (correctly) including the salt in the master key derivation
Don't use master key as address
Use core ed25519 library where possible, but continue using spacemesh version for child key derivation
Update tests again to match expected keys
Save the master key in the Wallet (but don't persist it)
@lrettig lrettig mentioned this pull request Mar 28, 2023
@lrettig lrettig marked this pull request as draft March 29, 2023 06:41
Increased Pbkdf2Iterations per OWASP recommendations
Refactoring of wallet key/store data structures
Use same salt for PBKDF2 and AES
Make salt deterministic
Expand tests
Refactor wallet command code
Correctly set default path
Bugfix in path to string
@lrettig lrettig mentioned this pull request Mar 29, 2023
@lrettig lrettig marked this pull request as ready for review March 29, 2023 10:30
@lrettig lrettig requested a review from fasmat March 29, 2023 10:31
@lrettig lrettig mentioned this pull request Mar 29, 2023
lrettig and others added 7 commits March 29, 2023 21:55
Reset to higher iterations for PBKDF2
WIP: getting MAC error when trying to read file with lower iterations
Remove or comment-out mnemonic-related code
Generate wallets using simple random seeds
Remove references to mnemonic, for now
Copy link
Member

@fasmat fasmat left a comment

Choose a reason for hiding this comment

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

Sorry for taking so long to review the code but it was a lot 😅.

Any reason as to why you prefer assert over require in tests? Usually when an assertion fails the test should end.

wallet/store_test.go Show resolved Hide resolved
wallet/bip32_ed25519_wrapper.go Outdated Show resolved Hide resolved
wallet/bip32_ed25519_wrapper.go Outdated Show resolved Hide resolved
wallet/store.go Show resolved Hide resolved
wallet/store.go Outdated Show resolved Hide resolved
cmd/wallet.go Outdated Show resolved Hide resolved
cmd/wallet.go Outdated Show resolved Hide resolved
cmd/wallet.go Outdated Show resolved Hide resolved
cmd/wallet.go Outdated Show resolved Hide resolved
wallet/store.go Outdated Show resolved Hide resolved
Also minor fix to test
Thanks mafa! Better error handling, better handling of JSON marshal/unmarshal
wallet/store.go Outdated Show resolved Hide resolved
wallet/store.go Outdated Show resolved Hide resolved
wallet/wallet.go Outdated Show resolved Hide resolved
@lrettig lrettig merged commit a4caaca into develop Apr 6, 2023
@lrettig lrettig deleted the lane-patch branch April 6, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants