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

18
cashu/core/nuts/nut11.py Normal file
View File

@@ -0,0 +1,18 @@
from typing import List
from ..base import BlindedMessage, Proof
def sigall_message_to_sign(proofs: List[Proof], outputs: List[BlindedMessage]) -> str:
"""
Creates the message to sign for sigall spending conditions.
The message is a concatenation of all proof secrets and signatures + all output attributes (amount, id, B_).
"""
# Concatenate all proof secrets
message = "".join([p.secret + p.C for p in proofs])
# Concatenate all output attributes
message += "".join([str(o.amount) + o.id + o.B_ for o in outputs])
return message