The IRS imposes a flat 30% tax on U.S. source capital gains if present for 183 days or more:
The Taxation of Capital Gains of Nonresident Alien Students, Scholars
and Employees of Foreign Governments
A flat tax of 30 percent was imposed on U.S. source capital gains in
the hands of nonresident alien individuals physically present in the
United States for 183 days or more during the taxable year. This
183-day rule bears no relation to the 183-day rule under the
substantial presence test of IRC section 7701(b)(3).
To calculate capital gains, you have to look at each individual sale/trade and determine gain/loss based on values at the time. For example, if you bought 1 bitcoin at $10,000, then sold half a bitcoin for $7,500, you'd have gain of $2,500. If you traded the bitcoin for $7,500 worth of litecoin, you'd still have $2,500 in capital gain. If later in the year you sold your entire litecoin position for $5,000 you'd have no net capital gain/loss, if you sold it for $10,000 you'd have $5,000 in capital gain for the year, etc.
You'd file a non-resident alien version of the standard tax return, form 1040NR along with any required schedules and additional forms.
You could investigate 1031 exchanges for your trade from BTC to altcoins, it's potentially permissible on your 2017 tax return, but definitely not for 2018 forward (now limited to real-estate). It seems unlikely that the IRS would interpret crytpocurrency trades as 'like-item' when they don't consider gold for silver to be like-item trades. That said, I think a lot of people are trying that for tax-year 2017.