Make either a p2sh-p2wpkh or p2sh-p2wsh
    redeem script and p2sh address.

    Return {'address': p2sh address, 'redeem_script': **the witness script**, 'private_keys': privkeys, 'segwit': True}
    * privkeys and redeem_script will be hex-encoded

def make_multisig_segwit_info( m, pks ):
    """
    Make either a p2sh-p2wpkh or p2sh-p2wsh
    redeem script and p2sh address.

    Return {'address': p2sh address, 'redeem_script': **the witness script**, 'private_keys': privkeys, 'segwit': True}
    * privkeys and redeem_script will be hex-encoded
    """
    pubs = []
    privkeys = []
    for pk in pks:
        priv = BitcoinPrivateKey(pk, compressed=True)
        priv_hex = priv.to_hex()
        pub_hex = priv.public_key().to_hex()

        privkeys.append(priv_hex)
        pubs.append(keylib.key_formatting.compress(pub_hex))

    script = None

    if len(pubs) == 1:
        if m != 1:
            raise ValueError("invalid m: len(pubkeys) == 1")

        # 1 pubkey means p2wpkh
        key_hash = hashing.bin_hash160(pubs[0].decode('hex')).encode('hex')
        script = '160014' + key_hash
        addr = btc_make_p2sh_address(script[2:])

    else:
        # 2+ pubkeys means p2wsh 
        script = make_multisig_script(pubs, m)
        addr = make_multisig_segwit_address_from_witness_script(script)

    return {
        'address': addr,
        'redeem_script': script,
        'private_keys': privkeys,
        'segwit': True,
        'm': m
    }