def _random_private_key(index: int) ->int:
    """
    Using the algorithm from:
    https://github.com/ethereum/eth2.0-pm/blob/master/interop/mocked_start/keygen.py
    """
    from py_ecc.optimized_bls12_381 import curve_order
    from hashlib import sha256
    return int.from_bytes(sha256(index.to_bytes(length=32, byteorder=
        'little')).digest(), byteorder='little') % curve_order
