def METHOD_NAME(node: messages.HDNodeType, version: int = 0x0488B21E) -> str:
    s = b""
    s += struct.pack(">I", version)
    s += struct.pack(">B", node.depth)
    s += struct.pack(">I", node.fingerprint)
    s += struct.pack(">I", node.child_num)
    s += node.chain_code
    if node.private_key:
        s += b"\x00" + node.private_key
    else:
        s += node.public_key
    s += tools.btc_hash(s)[:4]
    return tools.b58encode(s)