Crypto mining is completely legal in most countries. It has been banned in a few places around the world, most notably in China, but for the vast majority of people it’s legal.