Creating and securing cryptocurrencies is a legal activity. According to the latest article by Joaquín Muñoz, Head of IT&IP at ONTIER, for Expansión, cryptocurency-mining 'verifies the transactions and adds them to the public registry (blockchain) solving mathematical algorithms that keep this network safe, which is why bitcoin miners get a retribution.' This activity is totally legal. 'Bitcoin-mining itself is not a criminal offence, according to our legal system. Actually the judgement delivered in the European Court of Justice in regards to the Hedqvist case considered bitcoins to be a type of currency, just as bills and coins and any legal payment method' states Muñoz.
Bitcoin miners in Spain need to get registered, sign in to the Social Security and pay fees for the commission or the gains derived from those activities. But there are also cybercriminals who are taking advantage of bitcoin-mining to commit illegal activities. Apparently hackers sneak into Internet users' computers, install malware in them and use them to make the calculations required to create cryptocurrencies.
According to Muñoz, a recently published study shows that about two million people are unaware that their computers are currently doing this. 'If a hacker installs a malware in someone's computer for it to start mining bitcoins, the hacker is committing a criminal offence and has civil liability regarding the damage caused to the computer and the derived gains' notes Muñoz in the article.
For further information you can check out the full article by Expansión (SP only): Bitcoin-Mining, the Latest Weapon Used by Cybercriminals