Encode a segwit script hash to a bech32 address.
    Returns the bech32-encoded string on success

def segwit_addr_encode(witprog_bin, hrp=bech32_prefix, witver=bech32_witver):
    """
    Encode a segwit script hash to a bech32 address.
    Returns the bech32-encoded string on success
    """
    witprog_bytes = [ord(c) for c in witprog_bin]
    ret = bech32_encode(hrp, [int(witver)] + convertbits(witprog_bytes, 8, 5))
    assert segwit_addr_decode(hrp, ret) is not (None, None)
    return ret