diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index eaa29a4e3..64b6ab3b8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,8 +4,8 @@ kotlinx-coroutines = "1.10.2" kotlinx-datetime = "0.6.2" kotlinx-serialization = "1.8.1" ktor = "3.1.2" -bitcoinkmp = "0.25.1" # when upgrading bitcoin-kmp, keep secpjnijvm in sync! -secpjnijvm = "0.18.0" +bitcoinkmp = "0.26.0" # when upgrading bitcoin-kmp, keep secpjnijvm in sync! +secpjnijvm = "0.19.0" kermit = "2.0.5" slf4j = "2.0.16" diff --git a/modules/core/src/commonMain/kotlin/fr/acinq/lightning/channel/InteractiveTx.kt b/modules/core/src/commonMain/kotlin/fr/acinq/lightning/channel/InteractiveTx.kt index 2a48ceef1..4cc8ffb80 100644 --- a/modules/core/src/commonMain/kotlin/fr/acinq/lightning/channel/InteractiveTx.kt +++ b/modules/core/src/commonMain/kotlin/fr/acinq/lightning/channel/InteractiveTx.kt @@ -733,7 +733,7 @@ data class InteractiveTxSession( // Generate a secret nonce for this input if we don't already have one. is InteractiveTxInput.LocalSwapIn -> when (secretNonces[inputOutgoing.serialId]) { null -> { - val secretNonce = Musig2.generateNonce(randomBytes32(), swapInKeys.userPrivateKey, swapInKeys.userPublicKey, listOf(swapInKeys.userPublicKey, swapInKeys.remoteServerPublicKey), null, null) + val secretNonce = Musig2.generateNonce(randomBytes32(), Either.Left(swapInKeys.userPrivateKey), listOf(swapInKeys.userPublicKey, swapInKeys.remoteServerPublicKey), null, null) secretNonces + (inputOutgoing.serialId to secretNonce) } else -> secretNonces @@ -819,7 +819,7 @@ data class InteractiveTxSession( // Generate a secret nonce for this input if we don't already have one. is InteractiveTxInput.RemoteSwapIn -> when (secretNonces[input.serialId]) { null -> { - val secretNonce = Musig2.generateNonce(randomBytes32(), swapInKeys.localServerPrivateKey(remoteNodeId), input.serverKey, listOf(input.userKey, input.serverKey), null, null) + val secretNonce = Musig2.generateNonce(randomBytes32(), Either.Right(input.serverKey), listOf(input.userKey, input.serverKey), null, null) secretNonces + (input.serialId to secretNonce) } else -> secretNonces diff --git a/modules/core/src/commonTest/kotlin/fr/acinq/lightning/transactions/TransactionsTestsCommon.kt b/modules/core/src/commonTest/kotlin/fr/acinq/lightning/transactions/TransactionsTestsCommon.kt index 715c3a115..a0411eb1d 100644 --- a/modules/core/src/commonTest/kotlin/fr/acinq/lightning/transactions/TransactionsTestsCommon.kt +++ b/modules/core/src/commonTest/kotlin/fr/acinq/lightning/transactions/TransactionsTestsCommon.kt @@ -8,6 +8,7 @@ import fr.acinq.bitcoin.Script.pay2wsh import fr.acinq.bitcoin.Script.write import fr.acinq.bitcoin.crypto.Pack import fr.acinq.bitcoin.crypto.musig2.Musig2 +import fr.acinq.bitcoin.utils.Either import fr.acinq.lightning.CltvExpiry import fr.acinq.lightning.CltvExpiryDelta import fr.acinq.lightning.Lightning.randomBytes32 @@ -514,8 +515,8 @@ class TransactionsTestsCommon : LightningTestSuite() { ) // The first step of a musig2 signing session is to exchange nonces. // If participants are disconnected before the end of the signing session, they must start again with fresh nonces. - val userNonce = Musig2.generateNonce(randomBytes32(), userPrivateKey, userPrivateKey.publicKey(), listOf(userPrivateKey.publicKey(), serverPrivateKey.publicKey()), null, null) - val serverNonce = Musig2.generateNonce(randomBytes32(), serverPrivateKey, serverPrivateKey.publicKey(), listOf(serverPrivateKey.publicKey(), userPrivateKey.publicKey()), null, null) + val userNonce = Musig2.generateNonce(randomBytes32(), Either.Left(userPrivateKey), listOf(userPrivateKey.publicKey(), serverPrivateKey.publicKey()), null, null) + val serverNonce = Musig2.generateNonce(randomBytes32(), Either.Left(serverPrivateKey), listOf(serverPrivateKey.publicKey(), userPrivateKey.publicKey()), null, null) // Once they have each other's public nonce, they can produce partial signatures. val userSig = swapInProtocol.signSwapInputUser(tx, 0, swapInTx.txOut, userPrivateKey, userNonce.first, userNonce.second, serverNonce.second).right!!