The folklorist Mike Yates was of the opinion that “the song is based on an earlier pattern, namely the Elizabethan Stage Jig, a short dialogue song and dance performed by two or three characters.” It appears to be an old form but it can only be traced back to about 1820. It rejoices in many titles including The Keys of Canterbury/Heaven, Paper of Pins and so on. It is widespread in the English-speaking world, and many versions have been found in the Appalachian Mountains of the USA.
Notes by Gwilym Davies 30 March 2016