Context. Evaporating rocky exoplanets, such as KIC 12557548b, eject large amounts of dust, which can trail the planet in a comet-like tail. When such objects occult their host star, the resulting transit signal contains information about the dust in the tail. Aims: We aim to use the detailed shape of the Kepler light curve of KIC 12557548b to constrain the size and composition of the dust grains that make up the tail, as well as the mass loss rate of the planet. Methods: Using a self-consistent numerical model of the dust dynamics and sublimation, we calculated the shape of the tail by following dust grains from their ejection from the planet to their destruction due to sublimation. From this dust cloud shape, we generated synthetic light curves (incorporating the effects of extinction and angle-dependent scattering), which were then compared with the phase-folded Kepler light curve. We explored the free-parameter space thoroughly using a Markov chain Monte Carlo method. Results: Our physics-based model is capable of reproducing the observed light curve in detail. Good fits are found for initial grain sizes between 0.2 and 5.6 μm and dust mass loss rates of 0.6 to 15.6 M⊕ Gyr-1 (2σ ranges). We find that only certain combinations of material parameters yield the correct tail length. These constraints are consistent with dust made of corundum (Al2O3), but do not agree with a range of carbonaceous, silicate, or iron compositions. Conclusions: Using a detailed, physically motivated model, it is possible to constrain the composition of the dust in the tails of evaporating rocky exoplanets. This provides a unique opportunity to probe to interior composition of the smallest known exoplanets.