The story
Contraction of shall + not, first attested in the 16th century but likely inherited from Late Middle English. Displaced by shan't in most dialects of English after the early modern period. Parallel to cannot and obsolete or dialectal wonnot, hannot, donnot.
Etymology from Wiktionary, CC BY-SA 4.0.