In 2017, bitcoin went from trading at below $1,000 early in the year to a peak of over $19,000 in December, while other virtual currencies also enjoyed gains. For anyone who ignored the common crypto-slang advice to "HODL," to hold on to your investment for dear life, and decided to cash out, those profits are considered income by the IRS. If you sold crypto-coins or used crypto to buy anything in 2017, you probably owe the IRS taxes, says Ryan Losi, a certified public accountant and the executive vice president of Virginia accounting firm PIASCIK. "For Americans there is no free lunch," Losi says. "If you're richer tomorrow than you were today, it is likely you have some tax burden associated with that." And not paying up can have consequences. If the IRS discovers you under-reported your income when you file your taxes in April, "there is a failure-to-pay penalty of 0.5 percent per month, starting after the month in which it was due," Losi explains. "Then there is a failure-to-pay penalty of 5 percent on top of that." Then, there's interest. To avoid penalties, here's what you need to know about paying taxes on bitcoin.

Dan Kitwood | Getty Images

1. Crypto is on the IRS's radar

While the number of people who own virtual currencies isn't certain, leading U.S. cryptocurrency exchange Coinbase had an estimated 11.7 million users at the end of October 2017, according to data compiled by Alistair Milne, co-founder and chief investment officer of Altana Digital Currency Fund. (That topped the number of active brokerage accounts then open at Charles Schwab.) But unlike with traditional investments, in which case you're likely to be issued a 1099 form (which is also sent to the IRS) to keep track of your holdings and tax obligations, that isn't necessarily the case with virtual currency. Coinbase will provide 1099 forms to "certain business customers" and "customers that have received at least $20,000 cash for sales of virtual currency related to at least 200 transactions in a calendar year," according to the company's customer support page. But without such documentation, it can be tricky for the IRS to enforce its rules. "[For] now it is difficult for the IRS to really find out on an individual basis whether you reported your virtual currency sales or exchanges," Losi says. Indeed, it appears barely anyone is paying taxes on their crypto-gains. For example, in 2015, only 802 Coinbase users told the IRS about bitcoin gains, despite the exchange having 2.9 million users in December of that year, according to Milne's data. Recently however, the IRS has taken steps to identify tax-payers who are profiting, but not reporting. In 2016, the IRS summoned records from Coinbase, and a court ruled the company had to disclose information on about 14,000 users who have "either bought, sold, sent or received at least $20,000 worth of bitcoin in a given year," CNBC reports. Even if you aren't a hefty Coinbase user, you're obligated to report, and every U.S. taxpayer can potentially be audited by the IRS. The IRS examined 0.6 percent of the 193 million tax returns filed in fiscal year 2016, or about 1.2 million.

2. You owe taxes if you sold or spent crypto

In 2014, the IRS first issued official guidance on how to treat virtual currencies, which outlined that they are considered property. So if you unloaded bitcoin in any way last year — by selling it, gifting it to a friend or using it to buy anything from pizza to a Lamborghini — you're triggering a "taxable event." And you're then responsible for paying taxes on the appreciation of the virtual currency from the price at which you bought it, to the price at which you sold (or spent) it. For example, if you paid for a house using bitcoin, whatever your actual methods, the IRS thinks of it this way: You sold bitcoin for cash and used cash to buy a home. So, you're obligated to pay taxes on how much the bitcoin appreciated from the time you invested up until the time you shelled out for the house. That gain can be taxed at different rates. If you held a virtual currency for over a year before selling or paying for something with it, you pay a capital gains tax, which can range from 0 percent to 20 percent. Use Form 8949 to report it. If you held for less than a year, you pay ordinary income tax.

3. You don't owe taxes if you bought and held

If you just bought and held last year, then you don't owe taxes on the asset's appreciation because there was no "taxable event." Like with stocks, bonds or any other investment on which you might pay capital gains, you only have to pay after you sell or exchange virtual currency. If you just bought and held, "there is no triggering of gain that you would recognize on a 2017 tax return," Losi says.

4. It's smart to keep your own records

If you're transacting with crypto-coins frequently, you'll want to keep diligent notes on the prices at which you buy and cash out. "You really, really need to have documentation down," Losi says. "If you can not prove your [cost] basis," he explains, referring to the price at which you purchased, "guess how much is taxable? Not the gain, the gross proceeds." Here's an example to demonstrate: If you bought a cryptocurrency at $5 and sold it for $10, you should only be taxed on the gain, the $5 increase. But if you don't have proof that you bought at $5, you're taxed on the amount you sold it for, the $10 total. To keep track of all of your transactions, Tyson Cross, a tax attorney in Reno, Nevada recommends to CNBC that you frequently download reports of your transaction histories from whatever exchanges you use and keep them for your files. Coinbase users can generate a "Cost Basis for Taxes" report online.

5. Taking losses