It looks like fair-market value when you receive your virtual currency is counted as income. And you're also subject to self-employment tax on that income. Here's an FAQ from the IRS:
Q-8: Does a taxpayer who “mines” virtual currency (for example, uses
computer resources to validate Bitcoin transactions and maintain the
public Bitcoin transaction ledger) realize gross income upon receipt
of the virtual currency resulting from those activities?
when a taxpayer successfully “mines” virtual currency, the fair market
value of the virtual currency as of the date of receipt is includible
in gross income. See Publication 525, Taxable and Nontaxable Income,
for more information on taxable income.
Q-9: Is an individual who
“mines” virtual currency as a trade or business subject to
self-employment tax on the income derived from those activities?
If a taxpayer’s “mining” of virtual currency constitutes a trade or
business, and the “mining” activity is not undertaken by the taxpayer
as an employee, the net earnings from self-employment (generally,
gross income derived from carrying on a trade or business less
allowable deductions) resulting from those activities constitute
selfemployment income and are subject to the self-employment tax. See
Chapter 10 of Publication 334, Tax Guide for Small Business, for more
information on selfemployment tax and Publication 535, Business
Expenses, for more information on determining whether expenses are
from a business activity carried on to make a profit.
You'd of course be able to offset that income with the expense of mining the virtual currency, depreciation of dedicated mining equipment, electricity, not sure what else.
Edit: Here's a good resource on filing taxes with Bitcoin:
Filling in the 1040
Income from Bitcoins and all crypto-currencies is
declared as either capital gains income or ordinary income, for
example from mining.
Ordinary income will be declared on either
your 1040 (line 21 - Other Income) for an individual, or within your
Schedule C, if you are self-employed or have sole-proprietor business.
Capital gains income, or losses, are declared on
Schedule D. Since there are no reported 1099 forms from Bitcoin
exchanges, you will need to include your totals with Box C checked for
short-term gains, and with Box F checked for long-term gains.
Interesting notes from that article, your first example could actually be trickier than expected if you started mining before there was a Monero to USD exchange. Also, there can also be capital gains implications from using your virtual currency to buy goods, which sounds like a pain to keep track of.