1
0
Commit Graph

27 Commits

Author SHA1 Message Date
ThomasV
6e92a00ec4 Remove zeroconf option for submarine swaps
Since we now accept random swap providers, it is unreasonable
to keep that option.
2025-03-21 18:18:27 +01:00
SomberNight
a99c454c00 plugin ConfigVars: enforce "key" starts with name of plugin 2025-03-19 16:49:56 +00:00
SomberNight
b132e357a3 plugin ConfigVars: define vars less dynamically
and restore ability to have different internal ConfigVar name and user-visible "key"
(Keys are hard to change as that breaks compat, but it is nice to be able to change
the internal var name, to reorganise stuff sometimes. After new ConfigVars are added,
sometimes we get better insight into how the older ones should have been named.)

follow-up https://github.com/spesmilo/electrum/pull/9648
2025-03-19 16:42:51 +00:00
ThomasV
d8964a00e7 config vars for plugins 2025-03-19 11:59:05 +01:00
f321x
a9f8048251 use manifest.json instead of loading init file for plugin registration 2025-03-19 10:38:20 +01:00
f321x
6f97b7b5f9 simplify submarine swap onchain fee model to single base fee 2025-02-20 16:51:48 +01:00
ThomasV
60f13a977e Swaps over Nostr
- Separation between SwapManager and its transport:
   Legacy transpport uses http, Nostr uses websockets
 - The transport uses a context to open/close connections.
   This context is not async, because it needs to be called
   from the GUI
 - Swapserver fees values are initialized to None instead
   of 0, so that any attempt to use them before the swap
   manager is initialized will raise an exception.
 - Remove swapserver fees disk caching (swap_pairs file)
 - Regtests use http transport
 - Android uses http transport (until QML is ready)
2024-11-12 09:32:25 +01:00
ThomasV
8f11b5d411 swapserver: rm hardcoded value for percentage 2024-10-14 13:35:31 +02:00
ThomasV
912e1a3a5b reintroduce 'unlock' command
- the unlock command was replaced by an option to load_wallet,
because some applications (the swapserver plugin) need to be
executed with an unlocked password. Now the swapserver plugin
waits until the wallet is unlocked.
- wallet.unlock now checks password unconditionally, see #8799
2024-06-08 11:10:33 +02:00
ThomasV
fd672fed9f submarine swaps: separate server logic from transport 2024-05-07 09:01:33 +02:00
ThomasV
3e7d4749cf turn classmethod 'find_all_plugins' into an instance method.
change 'use_' prefix to 'enable_plugin_'
2024-04-13 11:35:49 +02:00
ThomasV
f6312366e6 swapserver: raise exception if client uses deprecated API 2024-03-01 17:25:37 +01:00
SomberNight
f30d81a98f swapserver plugin: fix doc 2024-01-17 01:15:14 +00:00
ThomasV
df1b9a223c remove qt module from swapserver plugin (unused since a300b8968a) 2024-01-10 17:32:31 +01:00
SomberNight
9f1b8613d0 swaps: code style clean-up, add type hints, force kwargs
no intended functional changes
2023-11-22 17:50:29 +00:00
ThomasV
fb4eb86e7c submarine swaps: remove support for 'old' normal swaps,
where the user has the preimage.

The CLTV requirements between old and new flow are imcompatible.
With the current locktime value, the server was vulnerable to an
attack where the client does not settle the lightning payment
and claims a refund. In order to support both old and new flows,
one would need to use different locktimes.
2023-11-10 10:35:34 +01:00
SomberNight
a560841f3f lnworker: fix some type hints re hold_invoices 2023-09-06 19:01:41 +00:00
ThomasV
a300b8968a swapserver: do not expose the swapserver plugin in qt 2023-08-27 11:10:09 +02:00
ThomasV
9f5f802cd1 config: save ports instead of net addresses (follow-up 012ce1c1bb) 2023-08-11 08:12:54 +02:00
ThomasV
012ce1c1bb Remove SSL options from config.
This is out of scope for Electrum; HTTP services that require SSL
should be exposed to the world through a reverse proxy.
2023-08-10 17:24:29 +02:00
ThomasV
dfa0dd47b7 swapserver: remove config option LIGHTNING_SWAP_HTLC_FIRST; read it from get_pairs instead. 2023-08-10 17:06:31 +02:00
ThomasV
88883d762c swapserver: remove /api from url 2023-08-10 10:29:32 +02:00
ThomasV
fd10ae3a3b New flow for submarine swaps:
- client requests payment_hash from the server
 - client sends an invoice with that hash
 - client waits to receive HTLCs, then broadcasts funding tx

This means that we now use same script for normal and reverse swaps.
The new flow is enabled by setting option LIGHTNING_SWAP_HTLC_FIRST
in the client. The old protocol is still supported server-side.
2023-08-10 09:04:30 +02:00
SomberNight
e94d45edd8 swapserver: small clean-up 2023-08-03 17:20:58 +00:00
ThomasV
1b14692f30 swapserver: cleanup, add description 2023-07-26 19:20:18 +02:00
ThomasV
351ff1e4b5 swapserver: support prepayment of fees 2023-07-26 19:20:18 +02:00
ThomasV
098c65d732 submarine swap server plugin:
- hold invoices
 - uses the same web API as the Boltz backend
2023-07-26 19:20:18 +02:00