It depends in what country you live in. In my country if you cash out and pay an income tax then it's fully legal.
That situation happens in most of the countries, you need to pay tax for income that you receive, only in some of them it is just illegal or you can sell those coins without doing anything.