我正在尝试使用> python3中的ecdsa算法创建签名,并出现断言错误:
my_private_key = "93AZYqkwkPsKAjHg7FqjXVMukwRrXkzGXYFNUsov2zFhDdfH8DT"
my_hexedd_prk = base58.b58decode_check(my_private_key)
my_hexed_str_prk = my_hexed_prk.hex()
my_hexed_bytes_prk = bytes.fromhex(my_hexed_str_prk)
import ecdsa#to create signing key out of my private key #electpic curve digital signing algorithm
signing_ky = ecdsa.SigningKey.from_string(my_hased_str_prk, curve = ecdsa.SECP256k1)
给出错误:
回溯(最近通话最近一次):
文件
中的文件“ C:/Users/bi/Desktop/resTran.py”,第121行signing_ky = ecdsa.SigningKey.from_string(my_hased_str_prk, curve = ecdsa.SECP256k1)
文件 “ C:\ Users \ bi \ AppData \ Local \ Programs \ Python \ Python37 \ lib \ site-packages \ ecdsa \ keys.py”, 第149行,位于from_string
assert len(string) == curve.baselen, (len(string), curve.baselen)
AssertionError:(66,32)
我无法弄清这个错误的开头或结尾。