Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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!!
Expand Down