In which country do you have to pay taxes on BTC profits if you move?

1M Ago
So let's say you have been living in the US for over a decade and you accumulated some BTC. Now you decide to move to Spain and obviously, you take your cold wallet with you. After a few months of living in Spain, you decide to sell your BTC in profits. So essentially: You bought the crypto in the US but you sold it in Spain. Question: In which country do you pay taxes? Thanks and sorry if it's an obvious one.