Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

feat: Implement Secure Database Storage for Gakimint Wallet CLI #3

Open
20 tasks
AbdelStark opened this issue Sep 26, 2024 · 0 comments
Open
20 tasks

Comments

@AbdelStark
Copy link
Collaborator

Implement Secure Database Storage for Gakimint Wallet CLI

Issue Description

The current Gakimint wallet CLI uses simple JSON files for data storage, which is not suitable for a production environment. We need to implement a more robust and secure storage solution for the wallet, including the ability to encrypt sensitive data.

Objectives

  1. Research and select an appropriate database solution for the Gakimint wallet CLI.
  2. Implement the chosen database solution, replacing the current JSON file storage.
  3. Add encryption capabilities for sensitive data (e.g., private keys, proofs).
  4. Update the wallet CLI code to use the new database storage.

Tasks

  • Research Phase:

    • Evaluate different database options suitable for Elixir applications (e.g., PostgreSQL, SQLite, LMDB).
    • Consider factors such as performance, security, ease of use, and portability.
    • Investigate encryption libraries compatible with the chosen database and Elixir.
    • Document findings and recommend a solution.
  • Implementation Phase:

    • Set up the chosen database in the Gakimint project.
    • Create necessary schemas for wallet and proof storage.
    • Implement data access layer (e.g., using Ecto if applicable).
    • Integrate encryption for sensitive data (e.g., private keys).
    • Update Gakimint.Wallet module to use the new storage solution.
    • Modify Gakimint.Wallet.CLI to work with the new database storage.
  • Testing and Validation:

    • Write unit tests for the new database interactions.
    • Ensure all existing functionality works with the new storage solution.
    • Perform security testing, especially for encrypted data.
  • Documentation and Cleanup:

    • Update project documentation to reflect the new storage solution.
    • Provide instructions for setting up and configuring the database.
    • Remove old JSON file storage code and related comments.

Considerations

  • Security: Ensure that sensitive data (e.g., private keys) is properly encrypted at rest.
  • Performance: The chosen solution should not significantly impact the CLI's performance.
  • Portability: Consider how easy it is for users to backup or transfer their wallet data.
  • Upgrades: Implement a migration strategy for existing users to move from JSON files to the new database.

Acceptance Criteria

  • The wallet CLI successfully stores and retrieves data using the new database solution.
  • Sensitive data is encrypted in the database.
  • All existing functionality (load/create wallet, store proofs, show balance) works with the new storage.
  • Database operations are properly handled, including error cases.
  • Documentation is updated to reflect the new storage solution and any necessary setup steps.

Resources

Estimated Effort

Medium to High: This task involves research, implementation of a new storage system, and ensuring security for sensitive data.

Priority

High: Proper and secure storage is crucial for a production-ready wallet CLI.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant