extend and refactor nut11 sig_all message aggregation (#804)

This commit is contained in:
callebtc
2025-10-28 11:41:44 +01:00
committed by GitHub
parent f84028ca3f
commit 7000e5c7ee
7 changed files with 69 additions and 18 deletions

View File

@@ -9,7 +9,7 @@ from ..core.errors import (
TransactionError,
)
from ..core.htlc import HTLCSecret
from ..core.nuts.nut14 import verify_htlc_spending_conditions
from ..core.nuts import nut11, nut14
from ..core.p2pk import (
P2PKSecret,
SigFlags,
@@ -163,7 +163,7 @@ class LedgerSpendingConditions:
# HTLC
if SecretKind(secret.kind) == SecretKind.HTLC:
htlc_secret = HTLCSecret.from_secret(secret)
verify_htlc_spending_conditions(proof)
nut14.verify_htlc_spending_conditions(proof)
return self._verify_p2pk_sig_inputs(proof, htlc_secret)
# no spending condition present
@@ -285,8 +285,8 @@ class LedgerSpendingConditions:
if not pubkeys:
return True
message_to_sign = message_to_sign or "".join(
[p.secret for p in proofs] + [o.B_ for o in outputs]
message_to_sign = message_to_sign or nut11.sigall_message_to_sign(
proofs, outputs
)
# validation