Iran has announced a four-month ban on the energy-consuming mining of cryptocurrencies such as Bitcoin after cities suffered unplanned blackouts.

President Hassan Rouhani told a cabinet meeting the main cause of the blackouts was a drought that had affected hydro-electric power generation.

But he said cryptocurrency mining, 85% of which is unlicensed, was draining more than 2GW from the grid each day.

An estimated 4.5% of all Bitcoin mining takes place in Iran.

According to analytics firm Elliptic, the activity allows the country to bypass sanctions and earn hundreds of millions of dollars in crypto-assets that can be used to purchase imports.

Iran’s banks were cut off from the global financial system and its oil exports plummeted, depriving it of a major source of hard currency and revenue, as a result of sanctions reinstated by the US in 2018 when then President Donald Trump abandoned a landmark nuclear deal.

Bitcoin operates on the blockchain, a digital ledger of transactions. Miners audit Bitcoin transactions in exchange for an opportunity to acquire the digital currency. It requires enormous computing power, which in turn uses huge amounts of electricity.

Elliptic said Iranian authorities officially recognised cryptocurrency mining in 2019 and later established a licensing regime that required miners to identify themselves, pay a higher tariff for electricity, and to sell their mined bitcoins to the Central Bank of Iran.

The national electricity company said on Saturday that licensed cryptocurrency mining facilities had already voluntarily shut down their operations to ease the burden.

But Mr Rouhani said on Wednesday that unlicensed facilities were using between six and seven times more power and that he therefore had to ban all cryptocurrency activities until 22 September.

The president also said the energy minister had been right to apologise to Iranians for the unplanned blackouts that affected businesses and households in Tehran and several other cities last week.