tax implications when i use bitcoin to buy something

I have purchased bitcoin by buying a set dollar amount every week (dollar cost average). When I use bitcoin to buy something, without transferring back to dollars, how do I :

 

Need to declare on taxes?

How do I know what the "original" cost is when I purchased at different prices of bitcoin on different days?

Is it like stocks where when I sell a stock I need to pay tax on any gains?

Thanks