The IRS ruled that bitcoins and other cryptocurrencies are property, not currency. As such, you determine gain or loss in the same was as any other type of property. Compare what you paid for the bitcoins and what you received on the sale (making adjustments for commissions, etc.).
A revenue ruling is the Commissioner’s “official interpretation of the interpretation of the law” and generally is binding on revenue agents and other IRS officials. Taxpayers generally may rely on published revenue rulings in determining the tax treatment of their own transactions that arise out of similar facts and circumstances.