Iran’s relationship with the crypto mining sector is a love-hate one. The government is again restricting crypto mining activity as it tries to ease the strain on the country’s power supply, despite knowing the promise of crypto as a way to evade international sanctions.

Electricity to all 118 government-authorized mining operators in Iran will be cut off from June 22 ahead of seasonal spikes in power demand, Mostafa Rajabi Mashhadi, spokesman for Iran’s power industry said in an interview with state TV, per a Bloomberg report.

Bitcoin has long been considered and used as a way for countries to circumvent trade embargoes. Iran is under sweeping sanctions by the US that effectively bars it from accessing the international financial system.

In 2019, Iran officially recognized the crypto mining industry and began issuing licenses to miners, which are required to pay higher electricity rates and sell their mined bitcoins to Iran’s central bank.

But the country has also repeatedly halted operations of crypto mining centers. The government ordered two shutdowns to mitigate pressure on its power infrastructure last year, during which electricity demand hit a record high.

Crypto mining was booming in Iran before the bans. Blockchain analytics firm Elliptic estimated in May last year that 4.5% of all Bitcoin mining took place in the country. That ratio was down to 0.12% as of January, according to the Cambridge Centre for Alternative Finance (CCAF).

Miners in other countries have shown defiance towards regulators. The crypto hash rate, which measures the computational power used by proof-of-work cryptocurrencies like Bitcoin, in China plummeted to zero between last July and August after the country carried out the harshest crackdown on crypto mining.

But the industry appeared to have revived quickly. In September, China accounted for 30% of the world’s crypto hash rate and in January, that ratio was at nearly 40%, second only to that of the US, according to CCAF.

The rebound indicated that underground mining might have been well underway in China, where crypto trading is also banned. “Access to off-grid electricity and geographically scattered, small-scale operations are among the major means used by underground miners to hide their operations from authorities and circumvent the ban,” said CCAF in an analysis.

The sudden drop and resurgence of China’s hash rate further suggested that its miners might have been covertly operating right after the ban by rerouting their data via proxy services, CCAF said. As time passed and the regulation set in, they might have become less wary about hiding their locations.