diff --git a/cashu/core/base.py b/cashu/core/base.py index 067c91ae..ad944130 100644 --- a/cashu/core/base.py +++ b/cashu/core/base.py @@ -156,7 +156,12 @@ class BlindedMessage(BaseModel): amount: int B_: str # Hex-encoded blinded message - p2pksigs: Union[List[str], None] = None # signature for p2pk with SIG_ALL + witness: Union[str, None] = None # witnesses (used for P2PK with SIG_ALL) + + @property + def p2pksigs(self) -> List[str]: + assert self.witness, "Witness is missing" + return P2PKWitness.from_witness(self.witness).signatures class BlindedSignature(BaseModel): diff --git a/cashu/wallet/p2pk.py b/cashu/wallet/p2pk.py index 16ac2f01..21d7e593 100644 --- a/cashu/wallet/p2pk.py +++ b/cashu/wallet/p2pk.py @@ -155,7 +155,7 @@ async def add_p2pk_witnesses_to_outputs( """ p2pk_signatures = await self.sign_p2pk_outputs(outputs) for o, s in zip(outputs, p2pk_signatures): - o.p2pksigs = [s] + o.witness = P2PKWitness(signatures=[s]).json() return outputs async def add_witnesses_to_outputs(