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

feat: Lightning Network Integration #2

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

feat: Lightning Network Integration #2

AbdelStark opened this issue Sep 26, 2024 · 0 comments

Comments

@AbdelStark
Copy link
Collaborator

Lightning Network Integration for Gakimint

Description

Currently, Gakimint uses a simulated Lightning Network, and all payments for mint quotes are automatically considered as being made. We need to integrate a real Lightning Network implementation to handle actual payments.

Objectives

  1. Replace the mock Lightning Network service with a real Lightning Network implementation.
  2. Implement proper payment verification for mint quotes.
  3. Update the mint quote workflow to handle real Lightning Network payments.

Tasks

  • Research and choose a suitable Lightning Network library or implementation for Elixir.
  • Implement a new LightningNetworkService module to interface with the chosen Lightning Network implementation.
  • Update the create_invoice function to generate real Lightning invoices.
  • Implement a proper check_payment function that verifies the payment status with the Lightning Network.
  • Update the MintController to use the new LightningNetworkService instead of the mock version.
  • Modify the create_mint_quote and get_mint_quote functions to handle real payment states.
  • Implement error handling for failed or expired Lightning payments.
  • Update tests to work with the new Lightning Network integration.
  • Add configuration options for connecting to a Lightning Network node.
  • Document the setup process for connecting Gakimint to a Lightning Network node.

Additional Considerations

  • Security: Ensure that the Lightning Network integration follows best practices for handling payments securely.
  • Performance: Consider the impact of real-time payment verification on the system's performance.
  • Error Handling: Implement robust error handling for various Lightning Network-related scenarios (e.g., network issues, payment failures).
  • Testnet Support: Consider adding support for both mainnet and testnet Lightning Network operations.

Resources

Definition of Done

  • Gakimint can create real Lightning invoices for mint quotes.
  • Payments for mint quotes are verified against actual Lightning Network transactions.
  • The system correctly handles different payment states (unpaid, paid, expired).
  • All tests pass with the new Lightning Network integration.
  • Documentation is updated to reflect the new Lightning Network setup and configuration.

Estimated Effort

Medium to High: This is a significant change that affects core functionality and requires integration with external systems.

Priority

High: This is a critical feature for the real-world usage of Gakimint.

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