Commit Graph

1497 Commits

Author SHA1 Message Date
thesimplekid
dad23eafee Merge pull request #991 from lollerfirst/fix-auth-blind-messages-table 2025-08-22 19:18:09 +01:00
lollerfirst
ea9b9324f6 fix left-over y in blind_signatures table auth database 2025-08-22 13:10:43 +02:00
thesimplekid
6f25620f06 feat: mintd db features (#977) 2025-08-21 22:41:46 +01:00
thesimplekid
8dec41dd55 refactor(cdk-lnbits): migrate to LNbits v1 websocket API and remove w… (#987)
* refactor(cdk-lnbits): migrate to LNbits v1 websocket API and remove webhook support

- Remove webhook-based payment notifications in favor of v1 websocket API
- Add explicit documentation that only LNbits v1 API is supported
- Remove webhook_url parameter and related router setup code
- Simplify payment status handling by removing pending status logic
- Switch to local lnbits-rs dependency for development
- Remove unused axum dependency and clean up imports
- Update configuration documentation and examples

* refactor(cdk-lnbits): extract payment processing logic into helper methods

Improve code readability by separating message processing, payment response
creation, and payment hash decoding into dedicated methods. This reduces
complexity in the main payment waiting loop while maintaining identical
functionality

* chore: bump lnbits-rs
2025-08-21 21:54:48 +01:00
thesimplekid
7e33078961 Merge pull request #988 from vnprc/zeroize_on_drop
feat: zeroize cryptographic secrets on drop
2025-08-21 21:53:26 +01:00
thesimplekid
b18d69f3cf Merge pull request #989 from crodas/bug/bolt12-missing-notifications
Fixed bolt12 missing payments notifications
2025-08-21 20:54:44 +01:00
Cesar Rodas
9b5f8d0534 Fixed bolt12 missing payments notifications 2025-08-21 15:26:08 -03:00
thesimplekid
9e595f0344 Merge pull request #965 from ubbabeck/nix-flake-set-nixpath
chore(flake): add NIX_PATH for flake
2025-08-21 17:15:10 +01:00
vnprc
951ff054fb feat: zeroize cryptographic secrets on drop
implement zeroize on Drop for Secret, Wallet, and MultiMintWallet
this erases sensitive memory addresses before deallocation
2025-08-21 11:26:52 -04:00
thesimplekid
4e13c1958f feat: mintd db features 2025-08-21 16:20:30 +01:00
thesimplekid
9a3d9b7139 feat: bip353 (#969) 2025-08-21 16:16:48 +01:00
thesimplekid
b6f7a75fba feat: cln as msats (#982)
* feat: cln as msats

* fix(logging): correct bolt12 payment amount units and reduce log noise

- Fix CLN bolt12 payment logging to display msats instead of sats
- Add tower_http filter to reduce integration test log verbosity
- Use correct payment amount variable in mint quote pubsub notifications
2025-08-21 16:13:06 +01:00
gudnuf
a4aaef705e fix: pass auth cfg through mintd to axum (#986) 2025-08-21 09:55:32 +01:00
thesimplekid
aa624d3afd fix: lnbits payment check and units (#981)
* fix: lnbits payment check and units

---------

Co-authored-by: asmo <asmogo@protonmail.com>
2025-08-20 18:01:46 +01:00
asmo
818367a8fa fix: reduce mmap_size to 5 MiB (#980) 2025-08-20 17:29:44 +01:00
thesimplekid
ecdc78135d refactor(cdk): defer BOLT12 invoice fetching to payment execution (#978)
* refactor(cdk): defer BOLT12 invoice fetching to payment execution

Move BOLT12 invoice generation from quote creation to payment time, make
request_lookup_id optional for offers, and simplify payment structures by
removing unnecessary boxing and intermediate storage of invoices.
2025-08-20 11:20:30 +01:00
thesimplekid
5c5075af71 feat: refresh keysets (#974)
* feat: refresh keysets

* feat: rename get_mint_info to fetch_mint_info
2025-08-19 19:19:08 +01:00
C
86d51ed54d Merge pull request #975 from crodas/bug/939-retry
Http retry should only happen at Http Error (which are transport errors)
2025-08-19 12:46:32 -03:00
thesimplekid
761ed82554 feat: log to file (#967) 2025-08-19 14:57:14 +01:00
Cesar Rodas
2e63a631e4 Fixed clippy 2025-08-19 10:38:08 -03:00
C
e31a9b1905 Update crates/cdk/src/wallet/mint_connector/http_client.rs
Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2025-08-19 10:38:08 -03:00
Cesar Rodas
29ce2e4f4d Http retry should only happen at Http Error (which are transport errors)
Fixes #939
2025-08-19 10:38:03 -03:00
thesimplekid
d3a3c30d99 feat(cdk): add Bolt12 mint quote subscription support (#976)
* feat(cdk): add Bolt12 mint quote subscription support

Extends subscription to handle Bolt12 payment method alongside existing Bolt11 support across wallet, mint, and CLI components.
2025-08-19 12:01:01 +01:00
C
28a01398fd Add PostgreSQL support for mint and wallet (#878)
* Add PostgreSQL support for mint and wallet

* Fixed bug to avoid empty calls `get_proofs_states`

* Fixed SQL bug

* Avoid redudant clone()

* Add more tests for the storage layer

* Minor enhacements

* Add a generic function to execute db operations

This function would log slow operations and log errors

* Provision a postgres db for tests

* Update deps for msrv

* Add postgres to pipeline

* feat: add psgl to example and docker

* feat: db url fmt

---------

Co-authored-by: thesimplekid <tsk@thesimplekid.com>
2025-08-18 17:45:11 +01:00
thesimplekid
2e424e629f feat: uuid version (#891)
* feat: uuid version

* feat: rustls version
2025-08-18 16:25:24 +01:00
thesimplekid
0a8a0a6ea5 Repay fake queue (#973)
* feat: implement secondary repayment queue for any-amount invoices

- Keep original immediate payment behavior for ALL invoices (fixed and any-amount)
- Add secondary repayment queue that randomly repays any-amount invoices again
- Secondary repayments occur at random intervals between 30 seconds and 3 minutes
- Only any-amount invoices (amount=0) are added to secondary repayment queue
- Each any-amount invoice gets paid twice: once immediately, once from secondary queue
- Queue has configurable max size with LRU eviction policy
- Add comprehensive tests and update documentation

* test: add test for multiple payment verification

- Add test to verify that secondary repayment system creates multiple payments
- Test checks that immediate payment is received first
- Demonstrates the dual payment system working correctly
2025-08-18 16:17:57 +01:00
thesimplekid
22926f8b21 fix: bolt12 ws on mint (#972)
* fix: bolt12 ws on mint

* fix: bolt12 ws on mint
2025-08-18 14:46:18 +01:00
C
f8d58e419f Merge pull request #963 from crodas/feature/wait-for-invoice
Add `wait_for_payment` function in the wallet
2025-08-18 12:57:45 +01:00
thesimplekid
da21ce655a Merge pull request #971 from thesimplekid/allow_mint_less_then_paid
feat(cdk): allow minting less than paid amount for non-bolt11 payments
2025-08-18 12:53:27 +01:00
thesimplekid
5ef2be36f2 feat(cdk): allow minting less than paid amount for non-bolt11 payments
For bolt11 payments, enforce exact amount matching between outputs and quote.
For other payment methods, allow minting less than paid amount while preventing overspending.
2025-08-18 11:34:53 +01:00
Ruben
8c425dee8c chore(flake): add NIX_PATH for flake 2025-08-17 08:45:13 +02:00
thesimplekid
0e15904b2f Merge pull request #968 from thesimplekid/remove_unwrap_from_startup
fix: remove unwrap in startup check
2025-08-16 10:43:16 +01:00
thesimplekid
43a13878b1 fix: remove unwrap in startup check 2025-08-15 17:59:23 +01:00
thesimplekid
3104a999e9 Merge pull request #944 from vnprc/keyset_counter_atomic_increment_2
fix: implement atomic keyset counter
2025-08-15 15:43:29 +01:00
thesimplekid
6588c54e3d Merge pull request #966 from thesimplekid/fake_bolt12
feat: fake mint bolt12
2025-08-15 12:24:32 +01:00
thesimplekid
b885c8d78e feat: fake mint bolt12 2025-08-15 12:23:02 +01:00
vnprc
5b30ca546d fix: implement atomic keyset counter
- remove get_keyset_counter
- update increment_keyset_counter to atomically increment and return counter value
- replace get+increment pattern with atomic increment everywhere
2025-08-15 11:50:33 +01:00
thesimplekid
51b26eae62 chore: clippy 2025-08-15 11:49:38 +01:00
thesimplekid
7b18e47ce5 Merge pull request #962 from thesimplekid/justfile_errors
Reduce clippy ci and catch errors in justfile scripts
2025-08-14 18:17:08 +01:00
thesimplekid
28ef002c34 Merge pull request #964 from gudnuf/fix/bolt12-internal-settlment
fix: allow paid and issued bolt12 quotes to settle internally
2025-08-14 09:41:51 +01:00
gudnuf
325afd75f7 fix: allow paid and issued bolt12 quotes to settle internally 2025-08-13 19:14:43 -07:00
thesimplekid
8578e8532b Merge pull request #957 from thesimplekid/bump_msrv_1.85
feat: bump msrv from 1.75.0 to 1.85.0
2025-08-13 22:13:51 +01:00
thesimplekid
c563bc53a4 Merge pull request #961 from thesimplekid/nutshell_tests
fix: nutshell itests
2025-08-13 21:41:51 +01:00
thesimplekid
500aae862e Merge pull request #960 from thesimplekid/free_disk_ci
chore: free disk space on ci
2025-08-13 21:41:39 +01:00
thesimplekid
31459fcb95 fix: nutshell itests 2025-08-13 20:14:38 +01:00
thesimplekid
8c66114b27 chore: free disk space on ci 2025-08-13 19:46:22 +01:00
thesimplekid
9f7a632056 fix: fake mint multiple units (#958) 2025-08-13 17:14:12 +01:00
thesimplekid
47c5bb7465 fix: fake mint multiple units 2025-08-13 13:59:32 +01:00
C
64f7b07855 Do not perform external calls during a database transaction. (#954)
The codebase was used to correctly perform signatory calls during a database
transaction, as the signatory was previously exclusively in process. However, a
few months ago, it was changed to be a trait that can be either local or
remote. Making external calls to services, adding latency, during an ongoing
database transaction is a bad idea because it will lock the rows until the
service call is finalized, which is unpredictable.

The issue is even worse in our pipeline where the SQLite storage driver is used
with the ":memory:" path, which forces the Database pool to have a size of 1.
Since our tests run in parallel, they would randomly fail.

This issue was failing in the CI, but the error was not making the pipeline
fail. This bug was fixed as well.
2025-08-13 12:25:59 +01:00
thesimplekid
ec9108d69d feat: bump msrv from 1.75.0 to 1.85.0 2025-08-13 10:56:09 +01:00