You can identify a specific unit of virtual currency by documenting the unit’s unique digital identifier, such as a private key, public key, and address. Alternatively, you can use records that show the transaction information for all units of a specific virtual currency held in a single account, wallet, or address. These records must include:
If you do not specifically identify the units, they are deemed to have been sold, exchanged, or otherwise disposed of on a first-in, first-out (FIFO) basis, starting with the earliest unit of the virtual currency you purchased or acquired.
Sources:
Rev. Rul. 2019-24
Notice 2014-21
Publication 544 (2023)
Everything We Know — and Don’t — About Taxing Cryptocurrency