From 5cf7fd60c48174608f0330d08298b35472425a17 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Fri, 29 Dec 2023 09:35:38 +0100 Subject: [PATCH] multi: clean up after PRs --- doc/chantools_pullanchor.md | 16 ++++++++-------- doc/chantools_sweepremoteclosed.md | 1 + doc/chantools_sweeptimelockmanual.md | 13 +++++++++++++ lnd/signer.go | 3 --- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/doc/chantools_pullanchor.md b/doc/chantools_pullanchor.md index b1155e2..eb14045 100644 --- a/doc/chantools_pullanchor.md +++ b/doc/chantools_pullanchor.md @@ -25,14 +25,14 @@ chantools pullanchor \ ### Options ``` - --anchoraddr string the address of the anchor output (p2wsh output with 330 satoshis) - --apiurl string API URL to use (must be esplora compatible) (default "https://blockstream.info/api") - --bip39 read a classic BIP39 seed and passphrase from the terminal instead of asking for lnd seed format or providing the --rootkey flag - --changeaddr string the change address to send the remaining funds to - --feerate uint32 fee rate to use for the sweep transaction in sat/vByte (default 30) - -h, --help help for pullanchor - --rootkey string BIP32 HD root key of the wallet to use for deriving keys; leave empty to prompt for lnd 24 word aezeed - --sponsorinput string the input to use to sponsor the CPFP transaction; must be owned by the lnd node that owns the anchor output + --anchoraddr stringArray the address of the anchor output (p2wsh or p2tr output with 330 satoshis) that should be pulled; can be specified multiple times per command to pull multiple anchors with a single transaction + --apiurl string API URL to use (must be esplora compatible) (default "https://blockstream.info/api") + --bip39 read a classic BIP39 seed and passphrase from the terminal instead of asking for lnd seed format or providing the --rootkey flag + --changeaddr string the change address to send the remaining funds to + --feerate uint32 fee rate to use for the sweep transaction in sat/vByte (default 30) + -h, --help help for pullanchor + --rootkey string BIP32 HD root key of the wallet to use for deriving keys; leave empty to prompt for lnd 24 word aezeed + --sponsorinput string the input to use to sponsor the CPFP transaction; must be owned by the lnd node that owns the anchor output ``` ### Options inherited from parent commands diff --git a/doc/chantools_sweepremoteclosed.md b/doc/chantools_sweepremoteclosed.md index 943fe03..105a2f9 100644 --- a/doc/chantools_sweepremoteclosed.md +++ b/doc/chantools_sweepremoteclosed.md @@ -13,6 +13,7 @@ funds can be swept after the force-close transaction was confirmed. Supported remote force-closed channel types are: - STATIC_REMOTE_KEY (a.k.a. tweakless channels) - ANCHOR (a.k.a. anchor output channels) + - SIMPLE_TAPROOT (a.k.a. simple taproot channels) ``` diff --git a/doc/chantools_sweeptimelockmanual.md b/doc/chantools_sweeptimelockmanual.md index aae01be..0aec8d6 100644 --- a/doc/chantools_sweeptimelockmanual.md +++ b/doc/chantools_sweeptimelockmanual.md @@ -12,6 +12,9 @@ and only the channel.backup file is available. To get the value for --remoterevbasepoint you must use the dumpbackup command, then look up the value for RemoteChanCfg -> RevocationBasePoint -> PubKey. +Alternatively you can directly use the --frombackup and --channelpoint flags to +pull the required information from the given channel.backup file automatically. + To get the value for --timelockaddr you must look up the channel's funding output on chain, then follow it to the force close output. The time locked address is always the one that's longer (because it's P2WSH and not P2PKH). @@ -29,6 +32,14 @@ chantools sweeptimelockmanual \ --remoterevbasepoint 03xxxxxxx \ --feerate 10 \ --publish + +chantools sweeptimelockmanual \ + --sweepaddr bc1q..... \ + --timelockaddr bc1q............ \ + --frombackup channel.backup \ + --channelpoint f39310xxxxxxxxxx:1 \ + --feerate 10 \ + --publish ``` ### Options @@ -36,7 +47,9 @@ chantools sweeptimelockmanual \ ``` --apiurl string API URL to use (must be esplora compatible) (default "https://blockstream.info/api") --bip39 read a classic BIP39 seed and passphrase from the terminal instead of asking for lnd seed format or providing the --rootkey flag + --channelpoint string channel point to use for locating the channel in the channel backup file specified in the --frombackup flag, format: txid:index --feerate uint32 fee rate to use for the sweep transaction in sat/vByte (default 30) + --frombackup string channel backup file to read the channel information from --fromchanneldb string channel input is in the format of an lnd channel.db file --fromsummary string channel input is in the format of chantool's channel summary; specify '-' to read from stdin -h, --help help for sweeptimelockmanual diff --git a/lnd/signer.go b/lnd/signer.go index 599ee3c..19fcb68 100644 --- a/lnd/signer.go +++ b/lnd/signer.go @@ -42,8 +42,6 @@ func (s *Signer) SignOutputRawWithPrivkey(tx *wire.MsgTx, signDesc *input.SignDescriptor, privKey *secp256k1.PrivateKey) (input.Signature, error) { - fmt.Printf("Using private key %x (pubkey %x)\n", privKey.Serialize(), privKey.PubKey().SerializeCompressed()) - witnessScript := signDesc.WitnessScript privKey = maybeTweakPrivKey(signDesc, privKey) @@ -63,7 +61,6 @@ func (s *Signer) SignOutputRawWithPrivkey(tx *wire.MsgTx, // This function tweaks the private key using the tap // root key supplied as the tweak. - fmt.Printf("Using private key %x (pubkey %x)\n", privKey.Serialize(), privKey.PubKey().SerializeCompressed()) rawSig, err = txscript.RawTxInTaprootSignature( tx, sigHashes, signDesc.InputIndex, signDesc.Output.Value, signDesc.Output.PkScript,