@@ -268,7 +268,7 @@ class LocalOnChainKeyManager(override val walletName: String, seed: ByteVector,
268268 // Check that we're signing a p2wpkh input and that the keypath is provided and correct.
269269 require(input.getDerivationPaths.size() == 1 , " bip32 derivation path is missing: bitcoin core may be malicious" )
270270 val (pub, keypath) = input.getDerivationPaths.asScala.toSeq.head
271- val priv = fr.acinq.bitcoin. DeterministicWallet . derivePrivateKey(master.priv, keypath.keyPath).getPrivateKey
271+ val priv = master.priv. derivePrivateKey(keypath.keyPath).getPrivateKey
272272 require(priv.publicKey() == pub, s " derived public key doesn't match (expected= $pub actual= ${priv.publicKey()}): bitcoin core may be malicious " )
273273 val expectedScript = ByteVector (Script .write(Script .pay2wpkh(pub)))
274274 require(kmp2scala(input.getWitnessUtxo.publicKeyScript) == expectedScript, s " script mismatch (expected= $expectedScript, actual= ${input.getWitnessUtxo.publicKeyScript}): bitcoin core may be malicious " )
@@ -305,7 +305,7 @@ class LocalOnChainKeyManager(override val walletName: String, seed: ByteVector,
305305 // Check that we're signing a p2tr input and that the keypath is provided and correct.
306306 require(input.getTaprootDerivationPaths.size() == 1 , " bip32 derivation path is missing: bitcoin core may be malicious" )
307307 val (pub, keypath) = input.getTaprootDerivationPaths.asScala.toSeq.head
308- val priv = fr.acinq.bitcoin. DeterministicWallet . derivePrivateKey(master.priv, keypath.keyPath).getPrivateKey
308+ val priv = master.priv. derivePrivateKey(keypath.keyPath).getPrivateKey
309309 require(priv.publicKey().xOnly() == pub, s " derived public key doesn't match (expected= $pub actual= ${priv.publicKey().xOnly()}): bitcoin core may be malicious " )
310310 val expectedScript = Script .write(Script .pay2tr(pub, KeyPathTweak ))
311311 require(kmp2scala(input.getWitnessUtxo.publicKeyScript) == expectedScript, s " script mismatch (expected= $expectedScript, actual= ${input.getWitnessUtxo.publicKeyScript}): bitcoin core may be malicious " )
0 commit comments