Lawmakers are weighing legislation to clarify how cryptocurrencies and other digital assets should be treated under the U.S. tax code.