staticaddr/withdraw: send per-deposit address proofs

Include the derivation key for every withdrawal input in the server
request. This lets the server validate and sign withdrawals that combine
deposits from multiple derived addresses.
This commit is contained in:
Slyghtning 2026-07-10 14:23:33 +02:00
parent b90c8fb386
commit 1b212fa105
No known key found for this signature in database
GPG key ID: F82D456EA023C9BF

View file

@ -561,6 +561,12 @@ func (m *Manager) CreateFinalizedWithdrawalTx(ctx context.Context,
return nil, nil, err
}
depositClientPubkeys, err := staticutil.DepositClientPubkeys(deposits)
if err != nil {
return nil, nil, fmt.Errorf("unable to prepare static address "+
"input proofs: %w", err)
}
withdrawalTx, unsignedPsbt, err := m.createWithdrawalTx(
ctx, outpoints, deposits, prevOuts,
btcutil.Amount(selectedWithdrawalAmount), withdrawalAddress,
@ -579,8 +585,9 @@ func (m *Manager) CreateFinalizedWithdrawalTx(ctx context.Context,
// nolint:lll
sigResp, err := m.cfg.StaticAddressServerClient.ServerPsbtWithdrawDeposits(
ctx, &staticaddressrpc.ServerPsbtWithdrawRequest{
WithdrawalPsbt: unsignedPsbt,
DepositToNonces: clientNonces,
WithdrawalPsbt: unsignedPsbt,
DepositToNonces: clientNonces,
DepositToClientPubkeys: depositClientPubkeys,
},
)
if err != nil {