If you pay it on your personal income tax, legally you pay on ALL money received, not on profit. You're not allowed to deduct costs.
If you steal $100K, then give it back, the IRS says you have to pay tax on $100K because you had control of it which makes it income.