glacierscript.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:GlacierProtocol 作者: GlacierProtocol 项目源码 文件源码
def hex_private_key_to_WIF_private_key(hex_key):
    """ 
    Converts a raw 256-bit hex private key to WIF format
    returns => <string> in hex format
    """

    hex_key_with_prefix = "80" + hex_key

    h1 = hash_sha256(hex_key_with_prefix.decode("hex"))
    h2 = hash_sha256(h1.decode("hex"))
    checksum = h2[0:8]

    wif_key_before_base58Check = hex_key_with_prefix + checksum
    wif_key = b58encode(wif_key_before_base58Check.decode("hex"))

    return wif_key


################################################################################################
#
# Bitcoin helper functions
#
################################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号