lightninglabs / lightninglabs/pool

account: use cooperative spend by default for MuSig2/Taproot accounts

Open
#410 0 comments 0 reactions 0 assignees View on GitHub
accounts taproot
Dominant language
Go
Stars
259
Forks
51
PR merge metrics
No merged PRs in 30d

Description

The expiry script path spend used to be cheaper for v0 (p2wsh) accounts because only one signature needed to be put on chain vs. 2 signatures for the cooperative spend. That's why we use the expiry script path by default if an account has expired and that path becomes available.
With the new v1 (p2tr) MuSig2/Taproot enabled accounts the cooperative spend now becomes cheaper in terms of chain space needed, since only a single Schnorr signature needs to be put in the witness and no script needs to be revealed. So we should always attempt a cooperative spend by default for v1 accounts.

Because the cooperative spend requires interaction with the server, the expiry script path spend should still be available as an option (e.g. `pool accounts close --no-server`) to allow fully server-independent withdrawal of funds for expired accounts.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the `pool accounts close` command and trace how expired v0 and v1 accounts choose between cooperative and expiry-script spends. Verify that v1 MuSig2/Taproot accounts try the cooperative spend by default, while `--no-server` still selects the expiry script path; add or update tests for both behaviors.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.