  We present the detection of potassium in the atmosphere of HAT-P-1b using
optical transit narrowband photometry. The results are obtained using the 10.4
m Gran Telescopio Canarias (GTC) together with the OSIRIS instrument in tunable
filter imaging mode. We observed four transits, two at continuum wavelengths
outside the potassium feature, at 6792 {\AA} and 8844 {\AA}, and two probing
the potassium feature in the line wing at 7582.0 {\AA} and the line core at
7664.9 {\AA} using a 12 {\AA} filter width (R~650). The planet-to-star radius
ratios in the continuum are found to be $R_{\rm{pl}}/R_{\star}$ = 0.1176 $\pm$
0.0013 at 6792 {\AA} and $R_{\rm{pl}}/R_{\star}$ = 0.1168 $\pm$ 0.0022 at 8844
{\AA}, significantly lower than the two observations in the potassium line:
$R_{\rm{pl}}/R_{\star}$ = 0.1248 $\pm$ 0.0014 in the line wing at 7582.0 {\AA}
and $R_{\rm{pl}}/R_{\star}$ = 0.1268 $\pm$ 0.0012 in the line core at 7664.9
{\AA}. With a weighted mean of the observations outside the potassium feature
$R_{\rm{pl}}/R_{\star}$ = 0.1174 $\pm$ 0.0010, the potassium is detected as an
increase in the radius ratio of {\Delta}$R_{\rm{pl}}/R_{\star}$ = 0.0073 $\pm$
0.0017 at 7582.0 {\AA} and {\Delta}$R_{\rm{pl}}/R_{\star}$ = 0.0094 $\pm$
0.0016 at 7664.9 {\AA} (a significance of 4.3 and 6.1 $\sigma$ respectively).
We hypothesise that the strong detection of potassium is caused by a large
scale height, which can be explained by a high-temperature at the base of the
upper atmosphere. A lower mean molecular mass caused by the dissociation of
molecular hydrogen into atomic hydrogen by the EUV flux from the host star may
also partly explain the amplitude of our detection.
