async def METHOD_NAME(
    s: KeyImageSync,
    msg: MoneroKeyImageExportInitRequest,
    keychain: Keychain,
) -> MoneroKeyImageExportInitAck:
    from trezor.crypto import random
    from trezor.messages import MoneroKeyImageExportInitAck
    from apps.common import paths
    from apps.monero import misc
    from apps.monero.xmr import monero
    await paths.validate_path(keychain, msg.address_n)
    s.creds = misc.get_creds(keychain, msg.address_n, msg.network_type)
    await layout.require_confirm_keyimage_sync()
    s.num_outputs = msg.num
    s.expected_hash = msg.hash
    s.enc_key = random.bytes(32)
    for sub in msg.subs:
        monero.compute_subaddresses(
            s.creds, sub.account, sub.minor_indices, s.subaddresses
        )
    return MoneroKeyImageExportInitAck()