Thanks to all for the replies.
My question really boils down this: does an exchange have the power to collect taxes or does that belong to a government only?
More details: when trying to withdrawal some profits from a transaction, the exchange said I must pay them for the capital gains. It sounds shady to me, like a scam, as I thought only the IRS could actually collect taxes.
Thanks again to the community.
SCAM. Anything that asks you to deposit first before you can withdraw is a scam. It simply doesn't make sense when they could just deduct the fee from your balance.
Another thing, exchanges don't collect your taxes, the only ones who do are scammers. It's a common part of a scam scheme actually, for instance pig butchering scam:
The Slaughter
Capitalizing on the relationship they’ve established with you, scammers will point to impressive gains from initial investments and urge you to deposit increasingly larger amounts. Once you do, however, the switch will flip, often leaving you facing devastating losses. The price of a stock that seemed poised to take off might rapidly plummet once the scammer’s market manipulation kicks into high gear. Or the new crypto platform you recently moved your assets into might suddenly become inaccessible.
If you confront the bad actor regarding the losses, they might express empathy and offer to help you recover your money, perhaps attempting to persuade you to invest in another stock. They might cite additional taxes and fees that you must pay before withdrawing your funds, especially if the investment scam involved crypto or other digital assets. And sometimes the bad actor will ghost you once the investment goes south.
Lastly, when trying to withdraw your money off an exchange, you typically only need to pay for the withdrawal fee which should just be couple of bucks. There may be other service charge depending on the platform and the payment method you're using but overall total shouldn't be high - should stay near couple of bucks. And yes, the fee will be deducted on your account balance.