mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-01-04 01:14:21 +01:00
extend and refactor nut11 sig_all message aggregation (#804)
This commit is contained in:
18
cashu/core/nuts/nut11.py
Normal file
18
cashu/core/nuts/nut11.py
Normal 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
|
||||
Reference in New Issue
Block a user