Skip to content

Commit

Permalink
fixup! add log for revocation pk and local htlc pk.
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggie1984 committed Jan 16, 2024
1 parent 809ea83 commit 0ae7242
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions cmd/chantools/sweeptimelockmanual.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 0ae7242

Please sign in to comment.