Commit Graph

24 Commits (master)

Author SHA1 Message Date
George Tsagkarelis b43fa11cc1
utils: add htlc & swap related helpers 3 months ago
Andras Banki-Horvath a8dd2dca07
loop: correct htlc script version for very old swaps 1 year ago
Andras Banki-Horvath cd91f90ed2
loop: use MuSig2 1.0 scheme for the new MuSig2 swaps 1 year ago
Andras Banki-Horvath da4bcbea10
loopdb: refactor the SwapContract to hold all HTLC keys
This commit adds a new struct to hold all HTLC keys and refactors the
SwapContract which is used by both loopin and loopout swaps to use this
new struct. The newly added internal keys will for now hold the script
keys to keep everything equivalent but are already stored and read back
if the protocol version is set to MuSig2.
1 year ago
Andras Banki-Horvath e8cfe4cea9
swap: pass in MuSig2 version when creating taproot HTLCs
This commit adds the MuSig2 version as an input parameter when creating
Taproot htlcs. This will allow us to create both old and new MuSig2
Taproot HTLCs correctly.
1 year ago
sputn1ck 4baf88c414
multi: fix linter issues
This commit fixes outstanding linter issues, that we're not found by
running `make lint` locally. The linter issues were found by running
`docker run -v $(pwd):/build loop-tools golangci-lint run --whole-files`

I added the `revive` to the excludes as it would be to much of a
refactor and IMO seems unneccesary. E.g.
`interface.go:222:6: exported: type name will be used as
loop.LoopInTerms by other packages, and that stutters; consider
 calling this InTerms (revive)`. I think `loop.LoopInTerms` is fine.
1 year ago
Andras Banki-Horvath bdb4b773ed
swap: refactor htlc construction to allow passing of internal keys
This commit is a refactor of how we construct htlcs to make it possible
to pass in internal keys for the sender and receiver when creating P2TR
htlcs. Furthermore the commit also cleans up constructors to not pass in
script versions and output types to make the code more readable.
1 year ago
Andras Banki-Horvath 88956455b4
multi: completely remove support for NP2WSH htlcs
This commit removes all code related to NP2WSH htlcs. These were
historically used when segwit adoption was very sporadic and are not
used anywhere anymore. Some historical swaps stored in the DB may be
listed with incorrect htlc adresses from here on.
1 year ago
Andras Banki-Horvath 901a935514
loopin: enable p2tr htlcs without keyspend 2 years ago
Andras Banki-Horvath 9b37d744a0
multi: add ProtocolVersion_HTLC_V3 2 years ago
Andras Banki-Horvath 9610becebd
multi: add the aggregate internal pubkey to the v3 htlc 2 years ago
Harsha Goli dec6dd7e70
swap: HTLCV3 added
In this commit we add the version 3 htlc, which is implemented with
taproot script spending the two payment paths: the claim path case, and
the timeout case.
2 years ago
Andras Banki-Horvath 133f3cac5f multi: integrate the new htlc v2 scripts to loop in/out
This commit bumps the current protocol version and integrates htlc v2
with loop in/out for new swaps, while keeping htlc v1 for any pending
swaps with previous protocol versions.
4 years ago
Andras Banki-Horvath 9fdd531130
swap: add HTLC script version 4 years ago
Joost Jager 0c9fcd790e
lndclient: move to github.com/lightninglabs/lndclient 4 years ago
carla 2ebbc78131
swap: add constructor for swap config 4 years ago
Andras Banki-Horvath b2b0bad951 loopin+loopout: move htlc out of swapKit
This commit moves htlc out of swapkit in preparation of adding separate
p2wsh and np2wsh htlcs to loop-in swaps.
4 years ago
Oliver Gugger b574e344ea
multi: add persistent logger 5 years ago
Oliver Gugger 69f2af9fdc
loop+cmd: extract types into swap module 5 years ago
Joost Jager 6efa62347b
multi: store swap cost in database 5 years ago
Joost Jager 1b306ad425
loopdb: replace swap state enum by state data object
This commits lays down the foundation in the database for adding more
persistent state data to swaps.
5 years ago
Joost Jager 30c7d71c57
use np2wsh for loop in htlc 5 years ago
Olaoluwa Osuntokun 94f347e673
multi: finalize rename from uncharge to loop out 5 years ago
Olaoluwa Osuntokun 908d82acdb
loop: extract code from client package into new loop primary package 5 years ago