  We investigate two microflares of GOES classes A9 and C1 (after background
subtraction) observed by STIX onboard Solar Orbiter with exceptionally strong
nonthermal emission. We complement the hard X-ray imaging and spectral analysis
by STIX with co-temporal observations in the (E)UV and visual range by AIA and
HMI, in order to investigate what makes these microflares so sufficient in
high-energy particle acceleration. We performed case studies of two microflares
observed by STIX on October 11, 2021 and November 10, 2022 that showed
unusually hard microflare X-ray spectra with power-law indices of the electron
flux distributions delta = 2.98 and delta = 4.08 during their nonthermal peaks
and photon energies up to 76 keV and 50 keV respectively. For both events under
study, we found that one footpoint is located within a sunspot covering areas
with mean magnetic flux densities in excess of 1500 G, suggesting that the hard
electron spectra are caused by the strong magnetic fields in which the flare
loops are rooted. In addition, we revisited the unusually hard RHESSI
microflare initially published by Hannah et al. (2008b) and found that in this
event also one flare kernel was located within a sunspot, which corroborates
the result from the two hard STIX microflares under study. We conclude that the
characteristics of the strong photospheric magnetic fields inside sunspot
umbrae and penumbrae where the flare loops are rooted play an important role in
the generation of exceptionally hard X-ray spectra in these microflares.
