Empirical evidence suggests the presence of bubble effects on Bitcoin price dynamics during its lifetime, starting in 2009. Previous research, mostly empirical, focused on statistical tests in order to detect a bubble behavior at some point in time. Few exceptions suggested specific time series models capable to describe such phenomena. We contribute this stream of literature by considering a continuous time stochastic model for Bitcoin dynamics, depending on a market attention factor, which is proven to boost in a bubble under suitable conditions. Here, we define a bubble following the theory of mathematical bubbles introduced by Philip E. Protter and coauthors. Specifically, we prove that the presence of a bubble is related to the correlation between the market attention factor on Bitcoin and Bitcoin returns being above a threshold, i.e. when marked attention affects Bitcoin prices and converse, creating a vicious loop. This phenomenon has been labelled market exuberance by Robert J. Shiller, recipient of the 2013 Nobel prize in Economic Sciences. The model is fitted on historical data of Bitcoin prices, by considering either the total trading volume or the Google Search Volume Index as proxies for the attention measure. According to our numerical results, a bubble effect is evidenced in the early years of Bitcoin introduction, namely 2012–2013, as well as in the recent race of 2017.