We discuss torsional oscillations of highly magnetised neutron stars (magnetars) using twodimensional, magneto-elastic-hydrodynamical simulations. Our model is able to explain both the low-and high-frequency quasi-periodic oscillations (QPOs) observed in magnetars. The analysis of these oscillations provides constraints on the breakout magnetic-field strength, on the fundamental QPO frequency, and on the frequency of a particularly excited overtone. More importantly, we show how to use this information to generically constraint properties of high-density matter in neutron stars, employing Bayesian analysis. In spite of current uncertainties and computational approximations, our model-dependent Bayesian posterior estimates for SGR 1806-20 yield a magnetic-field strengthB ∼ 2.1 +1.3 −1.0 × 10 15 G and a crust thickness of ∆r = 1.6 +0.7 −0.6 km, which are both in remarkable agreement with observational and theoretical expectations, respectively (1-σ error bars are indicated). Our posteriors also favour the presence of a superfluid phase in the core, a relatively low stellar compactness, M/R < 0.19, indicating a relatively stiff equation of state and/or low mass neutron star, and high shear speeds at the base of the crust, c s > 1.4 × 10 8 cm/s. Although the procedure laid out here still has large uncertainties, these constraints could become tighter when additional observations become available.