def f(xprv): _, _, _, _, c, k = deserialize_xprv(xprv) pk = bip32_private_key([0, 0], k, c) key = ecc.ECPrivkey(pk) sig = key.sign_message(message, True) return base64.b64encode(sig).decode()