diff --git a/cashu/mint/conditions.py b/cashu/mint/conditions.py index e187ac0..051947c 100644 --- a/cashu/mint/conditions.py +++ b/cashu/mint/conditions.py @@ -154,7 +154,7 @@ class LedgerSpendingConditions: assert signature, TransactionError("no HTLC refund signature provided") for pubkey in refund_pubkeys: if verify_p2pk_signature( - message=htlc_secret.serialize().encode("utf-8"), + message=proof.secret.encode("utf-8"), pubkey=PublicKey(bytes.fromhex(pubkey), raw=True), signature=bytes.fromhex(signature), ): @@ -181,7 +181,7 @@ class LedgerSpendingConditions: assert signature, TransactionError("HTLC no hash lock signatures provided.") for pubkey in hashlock_pubkeys: if verify_p2pk_signature( - message=htlc_secret.serialize().encode("utf-8"), + message=proof.secret.encode("utf-8"), pubkey=PublicKey(bytes.fromhex(pubkey), raw=True), signature=bytes.fromhex(signature), ): @@ -305,7 +305,7 @@ class LedgerSpendingConditions: for sig in p2pksigs: for pubkey in pubkeys: if verify_p2pk_signature( - message=output.B_.encode("utf-8"), + message=bytes.fromhex(output.B_), pubkey=PublicKey(bytes.fromhex(pubkey), raw=True), signature=bytes.fromhex(sig), ): diff --git a/cashu/wallet/p2pk.py b/cashu/wallet/p2pk.py index e246409..aff057c 100644 --- a/cashu/wallet/p2pk.py +++ b/cashu/wallet/p2pk.py @@ -93,7 +93,7 @@ class WalletP2PK(SupportsPrivateKey, SupportsDb): assert private_key.pubkey return [ sign_p2pk_sign( - message=output.B_.encode("utf-8"), + message=bytes.fromhex(output.B_), private_key=private_key, ).hex() for output in outputs