From 5074c4b379fff3db165e890a4cb28d01fb908783 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 25 Jan 2026 16:09:36 -0800 Subject: [PATCH 1/2] Remove dependency on cose for message signing --- pycardano/cip/cip8.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pycardano/cip/cip8.py b/pycardano/cip/cip8.py index cc81069f..c923c31b 100644 --- a/pycardano/cip/cip8.py +++ b/pycardano/cip/cip8.py @@ -90,20 +90,16 @@ def sign( msg.key = cose_key # attach the key to the message - if isinstance(signing_key, ExtendedSigningKey): - _message = [ - msg.phdr_encoded, - msg.uhdr_encoded, - msg.payload, - signing_key.sign(msg._sig_structure), - ] - - encoded = dumps( - CBORTag(msg.cbor_tag, _message), default=msg._custom_cbor_encoder - ) - - else: - encoded = msg.encode() + _message = [ + msg.phdr_encoded, + msg.uhdr_encoded, + msg.payload, + signing_key.sign(msg._sig_structure), + ] + + encoded = dumps( + CBORTag(msg.cbor_tag, _message), default=msg._custom_cbor_encoder + ) # turn the enocded message into a hex string and remove the first byte # which is always "d2" From 98fac73201d2391ef7367eafe23d4a499d485d2b Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 25 Jan 2026 16:14:46 -0800 Subject: [PATCH 2/2] format --- pycardano/cip/cip8.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pycardano/cip/cip8.py b/pycardano/cip/cip8.py index c923c31b..d7526d7c 100644 --- a/pycardano/cip/cip8.py +++ b/pycardano/cip/cip8.py @@ -97,9 +97,7 @@ def sign( signing_key.sign(msg._sig_structure), ] - encoded = dumps( - CBORTag(msg.cbor_tag, _message), default=msg._custom_cbor_encoder - ) + encoded = dumps(CBORTag(msg.cbor_tag, _message), default=msg._custom_cbor_encoder) # turn the enocded message into a hex string and remove the first byte # which is always "d2"