Cesar Rodas cesar

cesar pushed to feature/wallet-key-manager at cesar/cdk

4 days ago

cesar pushed to feature/wallet-db-transactions at cesar/cdk

  • 0a829f38e7 feat(database): add get_keys method to DatabaseTransaction trait Adds `get_keys` method to the `DatabaseTransaction` trait to enable reading keyset keys within active database transactions. This prevents database contention issues when checking for existing keys during transaction execution. Implementations added for: - cdk-sql-common: Queries key table within transaction context - cdk-redb: Reads from MINT_KEYS_TABLE using transaction handle - cdk-ffi: Bridges FFI database to CDK transaction interface with proper type conversions This change allows mint_metadata_cache to check for existing keys using the transaction handle (`tx.get_keys`) instead of the storage handle (`storage.get_keys`), avoiding concurrent database access conflicts during keyset synchronization.
  • a49466357a Feat: implement database transaction pattern across all database backends Separate read and write operations across the codebase by introducing explicit database transactions. Write methods are moved from the Database trait to a new DatabaseTransaction trait, requiring all write operations to be performed within explicit transactions. Database Layer Changes: - Create WalletDatabaseTransaction trait with all write methods - Add DbTransactionFinalizer trait with commit/rollback methods - Update WalletDatabase trait to only contain read methods and begin_db_transaction() - Add required read methods to WalletDatabaseTransaction for operations needed during transactions (get_keyset_by_id, get_mint_quote, get_melt_quote, get_proofs) This change improves transaction safety, enables proper rollback on errors, and provides a foundation for more complex multi-operation transactions. Maintains backward compatibility with the existing FFI interface while adapting to a transaction-based architecture.
  • fd6f848120 fix: Enable pure environment variable configuration for Lightning backends (#1299) * fix: Enable pure environment variable configuration for Lightning backends Removes premature validation that prevented configuring backends entirely through environment variables, enabling containerized deployments without requiring backend sections in config.toml. Changes: - Remove Stage 1 validation from Settings::new_from_default() that checked for backend config sections before environment variables were applied - Add comprehensive regression tests for all 6 Lightning backends (LND, CLN, LNbits, FakeWallet, GRPC Processor, LDK Node) validating env-var-only config - Consolidate tests into single test_env_var_only_config_all_backends() that runs sequentially to avoid environment variable interference The validation still occurs after environment variables are applied in Settings::from_env() and during backend initialization, ensuring proper configuration with clear error messages. Fixes environment variable configuration issue where users could not configure backends without uncommenting all fields in config.toml, which blocked container orchestration deployments that rely on dynamic service discovery. Fixes: https://github.com/cashubtc/cdk/issues/1281 Tests: cargo test -p cdk-mintd test_env_var_only_config_all_backends * feat(cdk-mintd): add config validation for Lightning backend connections Add validation checks for required connection fields in LND, LNbits, and CLN backend setup. Empty configuration values now produce clear error messages indicating which env vars or config fields are missing. Also improve GrpcProcessor and Lightning backend config structs with explicit Default implementations and serde defaults for better deserialization handling. * docs(mintd): add Lightning backend configuration documentation - Add comprehensive configuration guides for CLN, LND, and LNbits backends - Include both config file and environment variable examples - Update mintd README with links to backend-specific docs - Improve example.config.toml with clearer comments and consistent defaults - Standardize fee defaults to 2% with 2 sat minimum across all backends
  • 141e62a8dc feat(cdk): add Lightning address support with BIP353 fallback (#1295) * feat(cdk): add Lightning address support with BIP353 fallback Implements Lightning address (user@domain.com) resolution for melt operations with automatic fallback mechanism. When BIP353 DNS resolution fails, the wallet now falls back to LNURL-pay Lightning address resolution. Key additions: - New lightning_address module with LNURL-pay protocol implementation - melt_lightning_address and melt_human_readable_address methods - MintConnector trait methods for LNURL HTTP requests - BIP353 error variant for DNS resolution failures - Integration tests and FFI bindings
  • a12fd4dbea Prevent database contention in metadata cache load operations (#1300) * refactor(cdk/wallet): prevent database contention in metadata cache load operations Refactors mint metadata cache to eliminate database reads during active transactions by extracting database loading into a separate `load_from_storage` method that runs independently at wallet initialization. Previously, `load()` would read from storage during transaction execution, causing database contention with concurrent wallet operations. The new approach: - Introduces `load_from_storage` method that loads mint info and keysets from storage upfront - Spawns an async task during wallet initialization to populate the cache from storage - Removes all storage reads from the `load()` and `load_auth()` methods - Ensures storage is only used to sync data back, never for reading during load operations This prevents transaction conflicts and improves concurrent operation performance by ensuring the metadata cache operates independently of ongoing database transactions.
  • View comparison for these 80 commits »

4 days ago

cesar pushed to tmp-wallet-db-transactions at cesar/cdk

4 days ago

cesar created new branch tmp-wallet-db-transactions at cesar/cdk

4 days ago

cesar pushed to fix/pipeline-missing-sha256 at cesar/cdk

  • d3cc6b899b Fix broken tests Adding missing references to Sha256 in the tests. Issue was introduced in #1212
  • 9eaa6f1c02 feat: update NUT-11 SIG_ALL message aggregation per spec Implements changes from cashubtc/nuts#302 which updates the SIG_ALL message aggregation scheme for spending condition verification. SIG_ALL Message Changes: - Update message format to: secret || C || amount || B_ - Initially added keyset_id to outputs (amount || keyset_id || B_) - Removed keyset_id per final spec (amount || B_) - Applied to both swap (NUT-03) and melt (NUT-05) operations Architecture Improvements: - Introduce NUT-10 SpendingConditionVerification trait for unified verification logic across swap and melt operations - Refactor NUT-11 (P2PK) and NUT-14 (HTLC) verification to share common code paths - Add helper functions for pubkey/signature extraction with proper locktime handling - Improve error handling with specific error types (PreimageNotSupportedInP2PK, SpendConditionsNotMet) - Deprecate old verify_sig_all methods in favor of unified trait Test Coverage: - Add comprehensive test vectors for P2PK + SIG_ALL combinations - Add comprehensive test vectors for HTLC + SIG_ALL combinations - Add test helpers for spending condition verification - Cover multisig, locktime, refund keys, and mixed scenarios - Test vectors aligned with other implementations (nutshell, cashu-ts) --------- Co-authored-by: Sats And Sports <sats.and.sports@gmail.com> Co-authored-by: thesimplekid <tsk@thesimplekid.com>
  • e5882dc2eb test: add mutation testing infrastructure and security-critical coverage (#1210) Mutation testing validates test quality by introducing code changes and checking if tests catch them. This is critical for security code where missing negative tests could allow bypasses. **Infrastructure:** - `.cargo/mutants.toml` - Configuration with timeout exclusions - `justfile` commands - `mutants-quick`, `mutants-check`, `mutants-diff` - GitHub Actions - Weekly mutation testing with issue creation **Security-Critical Tests:** - NUT12 (DLEQ): 5 tests ensuring signature verification (prevents token forgery) - NUT14 (HTLC): 6 tests ensuring spending conditions (prevents unauthorized spending) - Amount operations: Tests for subtraction, checked_add, try_sum (prevents infinite loops) - Mutations Caught: 301 → 308 (+7, +2.3%) - Mutations Missed: 281 → 274 (-7, -2.5%) - Mutation Coverage: 35.5% → 36.4% (+0.9%) - All critical verification functions: 100% coverage
  • 2f9100ea4f Metadata follow up (#1268) * feat: cache_ttl as RwLock instead of Mutex This is a read heavy workflow that is not held across await points. So we can use a RwLock instead of Mutex. * refactor: remove TTL check from load_from_mint for guaranteed fresh fetches Remove TTL parameter and check from load_from_mint() to ensure it always fetches fresh metadata from the mint as documented. The method now truly forces a refresh, while load() continues to handle TTL-based caching.
  • c859939289 fix: nut14 disabled in info (#1269)

4 days ago

cesar created new branch fix/pipeline-missing-sha256 at cesar/cdk

4 days ago

cesar pushed to fix/dup-payment_id at cesar/cdk

  • 37fba7c2c6 Revert changes in sql-common
  • 5a50e243ff fix race condition when concurrent payments are processed for the same payment_id
  • fd6f848120 fix: Enable pure environment variable configuration for Lightning backends (#1299) * fix: Enable pure environment variable configuration for Lightning backends Removes premature validation that prevented configuring backends entirely through environment variables, enabling containerized deployments without requiring backend sections in config.toml. Changes: - Remove Stage 1 validation from Settings::new_from_default() that checked for backend config sections before environment variables were applied - Add comprehensive regression tests for all 6 Lightning backends (LND, CLN, LNbits, FakeWallet, GRPC Processor, LDK Node) validating env-var-only config - Consolidate tests into single test_env_var_only_config_all_backends() that runs sequentially to avoid environment variable interference The validation still occurs after environment variables are applied in Settings::from_env() and during backend initialization, ensuring proper configuration with clear error messages. Fixes environment variable configuration issue where users could not configure backends without uncommenting all fields in config.toml, which blocked container orchestration deployments that rely on dynamic service discovery. Fixes: https://github.com/cashubtc/cdk/issues/1281 Tests: cargo test -p cdk-mintd test_env_var_only_config_all_backends * feat(cdk-mintd): add config validation for Lightning backend connections Add validation checks for required connection fields in LND, LNbits, and CLN backend setup. Empty configuration values now produce clear error messages indicating which env vars or config fields are missing. Also improve GrpcProcessor and Lightning backend config structs with explicit Default implementations and serde defaults for better deserialization handling. * docs(mintd): add Lightning backend configuration documentation - Add comprehensive configuration guides for CLN, LND, and LNbits backends - Include both config file and environment variable examples - Update mintd README with links to backend-specific docs - Improve example.config.toml with clearer comments and consistent defaults - Standardize fee defaults to 2% with 2 sat minimum across all backends
  • 141e62a8dc feat(cdk): add Lightning address support with BIP353 fallback (#1295) * feat(cdk): add Lightning address support with BIP353 fallback Implements Lightning address (user@domain.com) resolution for melt operations with automatic fallback mechanism. When BIP353 DNS resolution fails, the wallet now falls back to LNURL-pay Lightning address resolution. Key additions: - New lightning_address module with LNURL-pay protocol implementation - melt_lightning_address and melt_human_readable_address methods - MintConnector trait methods for LNURL HTTP requests - BIP353 error variant for DNS resolution failures - Integration tests and FFI bindings
  • a12fd4dbea Prevent database contention in metadata cache load operations (#1300) * refactor(cdk/wallet): prevent database contention in metadata cache load operations Refactors mint metadata cache to eliminate database reads during active transactions by extracting database loading into a separate `load_from_storage` method that runs independently at wallet initialization. Previously, `load()` would read from storage during transaction execution, causing database contention with concurrent wallet operations. The new approach: - Introduces `load_from_storage` method that loads mint info and keysets from storage upfront - Spawns an async task during wallet initialization to populate the cache from storage - Removes all storage reads from the `load()` and `load_auth()` methods - Ensures storage is only used to sync data back, never for reading during load operations This prevents transaction conflicts and improves concurrent operation performance by ensuring the metadata cache operates independently of ongoing database transactions.

4 days ago

cesar created new branch fix/dup-payment_id at cesar/cdk

4 days ago

cesar pushed to fix/do-not-read-keys-from-db at cesar/cdk

  • dce00006d9 Don't read keys from the database Read the keys from `metadata_cache`
  • 836a50aaa3 fix: require 0 signatures for HTLC with no pubkeys specified (#1275) * fix: require 0 signatures for HTLC with no pubkeys specified Prior to this fix, HTLC verification incorrectly required 1 signature even when no pubkeys were specified in the spending conditions. This caused valid preimage-only HTLCs to fail verification. The issue occurred in get_pubkeys_and_required_sigs() for HTLC secrets before locktime: - Line 179: pubkeys defaults to empty vector [] when not specified - Line 180: required_sigs defaulted to 1 unconditionally - Result: impossible condition requiring 1 signature from 0 pubkeys * refactor(cashu): replace tuple with SpendingRequirements struct in nut10 Introduce SpendingRequirements struct to replace tuple return type in get_pubkeys_and_required_sigs function. This improves code clarity by using named fields (preimage_needed, pubkeys, required_sigs) instead of positional tuple elements across nut10, nut11, and nut14 modules
  • 9eaa6f1c02 feat: update NUT-11 SIG_ALL message aggregation per spec Implements changes from cashubtc/nuts#302 which updates the SIG_ALL message aggregation scheme for spending condition verification. SIG_ALL Message Changes: - Update message format to: secret || C || amount || B_ - Initially added keyset_id to outputs (amount || keyset_id || B_) - Removed keyset_id per final spec (amount || B_) - Applied to both swap (NUT-03) and melt (NUT-05) operations Architecture Improvements: - Introduce NUT-10 SpendingConditionVerification trait for unified verification logic across swap and melt operations - Refactor NUT-11 (P2PK) and NUT-14 (HTLC) verification to share common code paths - Add helper functions for pubkey/signature extraction with proper locktime handling - Improve error handling with specific error types (PreimageNotSupportedInP2PK, SpendConditionsNotMet) - Deprecate old verify_sig_all methods in favor of unified trait Test Coverage: - Add comprehensive test vectors for P2PK + SIG_ALL combinations - Add comprehensive test vectors for HTLC + SIG_ALL combinations - Add test helpers for spending condition verification - Cover multisig, locktime, refund keys, and mixed scenarios - Test vectors aligned with other implementations (nutshell, cashu-ts) --------- Co-authored-by: Sats And Sports <sats.and.sports@gmail.com> Co-authored-by: thesimplekid <tsk@thesimplekid.com>
  • e5882dc2eb test: add mutation testing infrastructure and security-critical coverage (#1210) Mutation testing validates test quality by introducing code changes and checking if tests catch them. This is critical for security code where missing negative tests could allow bypasses. **Infrastructure:** - `.cargo/mutants.toml` - Configuration with timeout exclusions - `justfile` commands - `mutants-quick`, `mutants-check`, `mutants-diff` - GitHub Actions - Weekly mutation testing with issue creation **Security-Critical Tests:** - NUT12 (DLEQ): 5 tests ensuring signature verification (prevents token forgery) - NUT14 (HTLC): 6 tests ensuring spending conditions (prevents unauthorized spending) - Amount operations: Tests for subtraction, checked_add, try_sum (prevents infinite loops) - Mutations Caught: 301 → 308 (+7, +2.3%) - Mutations Missed: 281 → 274 (-7, -2.5%) - Mutation Coverage: 35.5% → 36.4% (+0.9%) - All critical verification functions: 100% coverage
  • 2f9100ea4f Metadata follow up (#1268) * feat: cache_ttl as RwLock instead of Mutex This is a read heavy workflow that is not held across await points. So we can use a RwLock instead of Mutex. * refactor: remove TTL check from load_from_mint for guaranteed fresh fetches Remove TTL parameter and check from load_from_mint() to ensure it always fetches fresh metadata from the mint as documented. The method now truly forces a refresh, while load() continues to handle TTL-based caching.

4 days ago

cesar created new branch fix/do-not-read-keys-from-db at cesar/cdk

4 days ago

cesar pushed to feature/fix-missing-swap-try-proof at cesar/cdk

  • 821f9ce49b Fix missing try_proof_operation_or_reclaim wrapping of a swap
  • 24d397d10b Don't read keys from the database (#1280) Read the keys from `metadata_cache`
  • 2dfac3425e Update Wallet::fetch_mint_info (#1277) Make `fetch_mint_info` fetch the mint_info through the mint metadata cache instead of calling the Mint Connector directly. This will make sure to persist the data correctly in other instances and the database
  • 4723e32886 fix: return actual error from get_payment_quote (#1274)
  • 836a50aaa3 fix: require 0 signatures for HTLC with no pubkeys specified (#1275) * fix: require 0 signatures for HTLC with no pubkeys specified Prior to this fix, HTLC verification incorrectly required 1 signature even when no pubkeys were specified in the spending conditions. This caused valid preimage-only HTLCs to fail verification. The issue occurred in get_pubkeys_and_required_sigs() for HTLC secrets before locktime: - Line 179: pubkeys defaults to empty vector [] when not specified - Line 180: required_sigs defaulted to 1 unconditionally - Result: impossible condition requiring 1 signature from 0 pubkeys * refactor(cashu): replace tuple with SpendingRequirements struct in nut10 Introduce SpendingRequirements struct to replace tuple return type in get_pubkeys_and_required_sigs function. This improves code clarity by using named fields (preimage_needed, pubkeys, required_sigs) instead of positional tuple elements across nut10, nut11, and nut14 modules

4 days ago

cesar created new branch feature/fix-missing-swap-try-proof at cesar/cdk

4 days ago

cesar pushed to feature/fetch_mint_info-with-cache at cesar/cdk

  • 9778bc3e31 Update Wallet::fetch_mint_info Make `fetch_mint_info` fetch the mint_info through the mint metadata cache instead of calling the Mint Connector directly. This will make sure to persist the data correctly in other instances and the database
  • 836a50aaa3 fix: require 0 signatures for HTLC with no pubkeys specified (#1275) * fix: require 0 signatures for HTLC with no pubkeys specified Prior to this fix, HTLC verification incorrectly required 1 signature even when no pubkeys were specified in the spending conditions. This caused valid preimage-only HTLCs to fail verification. The issue occurred in get_pubkeys_and_required_sigs() for HTLC secrets before locktime: - Line 179: pubkeys defaults to empty vector [] when not specified - Line 180: required_sigs defaulted to 1 unconditionally - Result: impossible condition requiring 1 signature from 0 pubkeys * refactor(cashu): replace tuple with SpendingRequirements struct in nut10 Introduce SpendingRequirements struct to replace tuple return type in get_pubkeys_and_required_sigs function. This improves code clarity by using named fields (preimage_needed, pubkeys, required_sigs) instead of positional tuple elements across nut10, nut11, and nut14 modules
  • 9eaa6f1c02 feat: update NUT-11 SIG_ALL message aggregation per spec Implements changes from cashubtc/nuts#302 which updates the SIG_ALL message aggregation scheme for spending condition verification. SIG_ALL Message Changes: - Update message format to: secret || C || amount || B_ - Initially added keyset_id to outputs (amount || keyset_id || B_) - Removed keyset_id per final spec (amount || B_) - Applied to both swap (NUT-03) and melt (NUT-05) operations Architecture Improvements: - Introduce NUT-10 SpendingConditionVerification trait for unified verification logic across swap and melt operations - Refactor NUT-11 (P2PK) and NUT-14 (HTLC) verification to share common code paths - Add helper functions for pubkey/signature extraction with proper locktime handling - Improve error handling with specific error types (PreimageNotSupportedInP2PK, SpendConditionsNotMet) - Deprecate old verify_sig_all methods in favor of unified trait Test Coverage: - Add comprehensive test vectors for P2PK + SIG_ALL combinations - Add comprehensive test vectors for HTLC + SIG_ALL combinations - Add test helpers for spending condition verification - Cover multisig, locktime, refund keys, and mixed scenarios - Test vectors aligned with other implementations (nutshell, cashu-ts) --------- Co-authored-by: Sats And Sports <sats.and.sports@gmail.com> Co-authored-by: thesimplekid <tsk@thesimplekid.com>
  • e5882dc2eb test: add mutation testing infrastructure and security-critical coverage (#1210) Mutation testing validates test quality by introducing code changes and checking if tests catch them. This is critical for security code where missing negative tests could allow bypasses. **Infrastructure:** - `.cargo/mutants.toml` - Configuration with timeout exclusions - `justfile` commands - `mutants-quick`, `mutants-check`, `mutants-diff` - GitHub Actions - Weekly mutation testing with issue creation **Security-Critical Tests:** - NUT12 (DLEQ): 5 tests ensuring signature verification (prevents token forgery) - NUT14 (HTLC): 6 tests ensuring spending conditions (prevents unauthorized spending) - Amount operations: Tests for subtraction, checked_add, try_sum (prevents infinite loops) - Mutations Caught: 301 → 308 (+7, +2.3%) - Mutations Missed: 281 → 274 (-7, -2.5%) - Mutation Coverage: 35.5% → 36.4% (+0.9%) - All critical verification functions: 100% coverage
  • 2f9100ea4f Metadata follow up (#1268) * feat: cache_ttl as RwLock instead of Mutex This is a read heavy workflow that is not held across await points. So we can use a RwLock instead of Mutex. * refactor: remove TTL check from load_from_mint for guaranteed fresh fetches Remove TTL parameter and check from load_from_mint() to ensure it always fetches fresh metadata from the mint as documented. The method now truly forces a refresh, while load() continues to handle TTL-based caching.

4 days ago

cesar created new branch feature/fetch_mint_info-with-cache at cesar/cdk

4 days ago

cesar pushed to feature/add-function-to-load-mint-info-from-storage at cesar/cdk

  • e97d598058 Fixed clippy issues
  • 12fa798a36 refactor(cdk/wallet): prevent database contention in metadata cache load operations Refactors mint metadata cache to eliminate database reads during active transactions by extracting database loading into a separate `load_from_storage` method that runs independently at wallet initialization. Previously, `load()` would read from storage during transaction execution, causing database contention with concurrent wallet operations. The new approach: - Introduces `load_from_storage` method that loads mint info and keysets from storage upfront - Spawns an async task during wallet initialization to populate the cache from storage - Removes all storage reads from the `load()` and `load_auth()` methods - Ensures storage is only used to sync data back, never for reading during load operations This prevents transaction conflicts and improves concurrent operation performance by ensuring the metadata cache operates independently of ongoing database transactions.
  • ee910578ab fix: nightly ci (#1298)
  • 15c315ea09 feat(cdk): add invoice decoding for bolt11 and bolt12 (#1294) * feat(cdk): add invoice decoding for bolt11 and bolt12 Add decode_invoice function to parse both bolt11 invoices and bolt12 offers, extracting amount, expiry, and description. Includes FFI bindings for cross-language support.
  • c880ef7027 refactor(cdk/wallet): extract keyset key loading into helper method (#1296) Consolidate duplicate keyset key loading logic from melt_bolt11 and swap modules into reusable load_keyset_keys() helper method. Also add load_mint_info() helper for consistent metadata cache access.

4 days ago

cesar pushed to feature/add-function-to-load-mint-info-from-db at cesar/cdk

  • ee910578ab fix: nightly ci (#1298)
  • 15c315ea09 feat(cdk): add invoice decoding for bolt11 and bolt12 (#1294) * feat(cdk): add invoice decoding for bolt11 and bolt12 Add decode_invoice function to parse both bolt11 invoices and bolt12 offers, extracting amount, expiry, and description. Includes FFI bindings for cross-language support.
  • c880ef7027 refactor(cdk/wallet): extract keyset key loading into helper method (#1296) Consolidate duplicate keyset key loading logic from melt_bolt11 and swap modules into reusable load_keyset_keys() helper method. Also add load_mint_info() helper for consistent metadata cache access.
  • e1c18e51d4 fix: flaky test by using wait and pay (#1292)
  • e7fe058188 feat: add test coverage for mutants caught in https://github.com/cashubtc/cdk/issues/1290 (#1293)

4 days ago

cesar pushed to main at cesar/cdk

  • fd6f848120 fix: Enable pure environment variable configuration for Lightning backends (#1299) * fix: Enable pure environment variable configuration for Lightning backends Removes premature validation that prevented configuring backends entirely through environment variables, enabling containerized deployments without requiring backend sections in config.toml. Changes: - Remove Stage 1 validation from Settings::new_from_default() that checked for backend config sections before environment variables were applied - Add comprehensive regression tests for all 6 Lightning backends (LND, CLN, LNbits, FakeWallet, GRPC Processor, LDK Node) validating env-var-only config - Consolidate tests into single test_env_var_only_config_all_backends() that runs sequentially to avoid environment variable interference The validation still occurs after environment variables are applied in Settings::from_env() and during backend initialization, ensuring proper configuration with clear error messages. Fixes environment variable configuration issue where users could not configure backends without uncommenting all fields in config.toml, which blocked container orchestration deployments that rely on dynamic service discovery. Fixes: https://github.com/cashubtc/cdk/issues/1281 Tests: cargo test -p cdk-mintd test_env_var_only_config_all_backends * feat(cdk-mintd): add config validation for Lightning backend connections Add validation checks for required connection fields in LND, LNbits, and CLN backend setup. Empty configuration values now produce clear error messages indicating which env vars or config fields are missing. Also improve GrpcProcessor and Lightning backend config structs with explicit Default implementations and serde defaults for better deserialization handling. * docs(mintd): add Lightning backend configuration documentation - Add comprehensive configuration guides for CLN, LND, and LNbits backends - Include both config file and environment variable examples - Update mintd README with links to backend-specific docs - Improve example.config.toml with clearer comments and consistent defaults - Standardize fee defaults to 2% with 2 sat minimum across all backends
  • 141e62a8dc feat(cdk): add Lightning address support with BIP353 fallback (#1295) * feat(cdk): add Lightning address support with BIP353 fallback Implements Lightning address (user@domain.com) resolution for melt operations with automatic fallback mechanism. When BIP353 DNS resolution fails, the wallet now falls back to LNURL-pay Lightning address resolution. Key additions: - New lightning_address module with LNURL-pay protocol implementation - melt_lightning_address and melt_human_readable_address methods - MintConnector trait methods for LNURL HTTP requests - BIP353 error variant for DNS resolution failures - Integration tests and FFI bindings
  • a12fd4dbea Prevent database contention in metadata cache load operations (#1300) * refactor(cdk/wallet): prevent database contention in metadata cache load operations Refactors mint metadata cache to eliminate database reads during active transactions by extracting database loading into a separate `load_from_storage` method that runs independently at wallet initialization. Previously, `load()` would read from storage during transaction execution, causing database contention with concurrent wallet operations. The new approach: - Introduces `load_from_storage` method that loads mint info and keysets from storage upfront - Spawns an async task during wallet initialization to populate the cache from storage - Removes all storage reads from the `load()` and `load_auth()` methods - Ensures storage is only used to sync data back, never for reading during load operations This prevents transaction conflicts and improves concurrent operation performance by ensuring the metadata cache operates independently of ongoing database transactions.
  • 36c6037442 fix: allow starting insecure man server (#1297)
  • 288be4a377 fix: nightly fmt pr
  • View comparison for these 34 commits »

4 days ago

cesar pushed to feature/wallet-key-manager at cesar/cdk

  • 11adbf9f36 Address feedback left on code review
  • 071f2eeedc Fix typo
  • a28b6ac58c Move cache TTL to each wallet Each wallet have their own cache TTL and access to cache freshness status
  • 162b630aa7 Fixed race conditions The first time keys are fetched from the mint, they do not yet exist in the wallet database; therefore, the counter is not updated correctly, because the code performs an update that expects the keyset row to exist. To solve this issue, I introduced a new keyset_counter table that will upsert the data, even if the proper keyset info is pulled later.
  • 9fbf109ddf Add Mutex to serialize external requests to the mint
  • View comparison for these 26 commits »

1 week ago