legal mining