
Individuals subject to Spanish Personal Income Tax (IRPF) may buy and sell virtual currencies. When these transactions are not carried out as part of an economic activity, they may give rise to a capital gain or loss equal to the difference between the disposal value and the acquisition value.
Article 33(1) of the Personal Income Tax Act (LIRPF) provides:
“1. Capital gains and losses are changes in the value of a taxpayer’s assets that become apparent as a result of any change in their composition, unless this Act classifies them as income.”
Since sales of cryptocurrencies for euros are not carried out as part of an economic activity, they give rise to capital gains or losses under Article 33(1) LIRPF.
As a general rule, Article 34(1)(a) LIRPF provides that, in the case of a transfer for consideration or a gratuitous transfer, the amount of the capital gain or loss is the difference between the acquisition value and the disposal value of the assets. For transfers for consideration, those values are defined in Article 35 LIRPF, which provides:
“1. The acquisition value consists of the sum of:
(a) The actual amount paid for the acquisition.
(b) The cost of investments and improvements made to the acquired assets, and the expenses and taxes inherent in the acquisition, excluding interest, paid by the purchaser.
(…)
2. The disposal value is the actual amount for which the transfer takes place. The expenses and taxes referred to in paragraph 1(b), insofar as they are paid by the transferor, are deducted from this value.
The actual disposal amount is the amount effectively paid, provided that it is not below normal market value; if it is, market value shall prevail.”
Capital gains and losses must be calculated separately for each type of cryptocurrency.
Units or fractions of a given type of cryptocurrency originate from the same computer protocol and share the same characteristics. They are therefore identical to one another, which means that the units or fractions of that cryptocurrency are treated as homogeneous assets.
According to the Directorate General for Taxation’s interpretation (including binding rulings V0975-22 and V2520-22), when partial sales are made of homogeneous virtual currencies of the same type acquired at different times, the units transferred are deemed to be those acquired first when calculating the corresponding capital gain or loss.
Swaps
An exchange of one virtual currency for another is a swap under Article 1538 of the Civil Code, which provides:
“A swap is a contract under which each party undertakes to give one thing in exchange for another.”
Accordingly, taking into account the above-mentioned Article 33(1) LIRPF, an exchange of different virtual currencies outside an economic activity gives rise to income classified as a capital gain or loss under that provision. The amount is calculated under Articles 34(1)(a) and 35, as mentioned above, and Article 37(1)(h) LIRPF, which provides that where the change in the value of assets results from:
“(h) A swap of assets or rights, including an exchange of securities, the capital gain or loss shall be determined by the difference between the acquisition value of the asset or right transferred and the higher of the following two amounts:
The market value of the asset or right transferred.
The market value of the asset or right received in exchange.”
For subsequent transfers, the acquisition value of virtual currencies received in a swap is the value taken into account by the taxpayer under Article 37(1)(h) LIRPF as the disposal value for that swap.
Both cryptocurrency sales and swaps involve fees paid to the platforms (“trading fees”) and network usage fees (“gas fees”). The latter are associated with a blockchain network that uses what is known as “proof of work” or mining as a consensus mechanism to validate transactions. Where these expenses arise from the transactions, are directly related to them and are paid by the user, they are included in calculating the respective acquisition and disposal values as provided for in Article 35 above.
In both cases—transferring virtual currencies for euros or for other virtual currencies—the capital gain or loss must be included in the taxpayer’s savings tax base for the tax period in which the change in assets takes place, in accordance with Articles 46 and 49 LIRPF.



I had a really urgent problem in the middle of the summer that I needed to get fixed. I tried contacting a bunch of agencies but they were either unavailable, slow, had terrible service or were crazy expensive (one company quoted me 1000€!). Josep replied to me within 10 minutes and managed to submit my forms on the deadline and all for a great price. He saved my life - 100% recommend!