From 0ae7242692c3e14bef366a9a37dac9e18157168c Mon Sep 17 00:00:00 2001 From: ziggie Date: Mon, 15 Jan 2024 16:08:25 +0100 Subject: [PATCH] fixup! add log for revocation pk and local htlc pk. --- cmd/chantools/sweeptimelockmanual.go | 31 +++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/cmd/chantools/sweeptimelockmanual.go b/cmd/chantools/sweeptimelockmanual.go index 17d2786..1440945 100644 --- a/cmd/chantools/sweeptimelockmanual.go +++ b/cmd/chantools/sweeptimelockmanual.go @@ -156,6 +156,25 @@ chantools sweeptimelockmanual \ } func (c *sweepTimeLockManualCommand) Execute(_ *cobra.Command, _ []string) error { + + // delayedBase, _ := pubKeyFromHex("035b4fd46f5f985500cf3343ddf1205dc3da4a4fae988f53aee93731bbb3ec4e9f") + // commitPoint, _ := pubKeyFromHex("0232f0db3924b7fc231656a7c8a192b405cae86bf3380c15f5145c26069433836f") + // revBase, _ := pubKeyFromHex("02c9b095733fef24ab67888d95fcfa1dd1deb79312b34db2d59a01c65c32ff8f29") + + // root := &hdkeychain.ExtendedKey{} + + // lockScript, err := lnd.PrepareWalletAddress( + // c.TimeLockAddr, chainParams, nil, root, "time lock", + // ) + + // _, _, _, err = bruteForceDelay( + // input.TweakPubKey(delayedBase, commitPoint), + // input.DeriveRevocationPubkey(revBase, commitPoint), + // lockScript, 600, 600, + // ) + + // fmt.Println("DONEDONE") + extendedKey, err := c.rootKey.read() if err != nil { return fmt.Errorf("error reading root key: %w", err) @@ -621,11 +640,17 @@ func bruteForceDelayPoint(delayBase, revBase, htlcBase *btcec.PublicKey, } commitPoint := input.ComputeCommitmentPoint(revPreimage[:]) - log.Infof("RevocationPK(RIPEMD160): %v", + log.Infof("RevocationPK(RIPEMD160): %x", btcutil.Hash160(input.DeriveRevocationPubkey(revBase, commitPoint).SerializeCompressed())) - log.Infof("LocalHTLCPK: %v", - btcutil.Hash160(input.TweakPubKey(htlcBase, commitPoint).SerializeCompressed())) + log.Infof("LocalHTLCPK: %x", + input.TweakPubKey(htlcBase, commitPoint).SerializeCompressed()) + + log.Infof("DelayedBase: %x", + delayBase.SerializeCompressed()) + + log.Infof("HTLCBase: %x", + htlcBase.SerializeCompressed()) log.Infof("CommitPoint at ChanUpdate#%v", i)