Although most of the narrative takes place in the 17th century, the long introductory chapter takes place in the 19th century. "The Custom House" describes how the frame narrator (basically a stand-in for Hawthorne) works as a tax surveyor in a Custom House and finds, in storage there, the fabric letter that inspires him to write the novel:
It was the capital letter A. By an accurate measurement, each limb proved to be precisely three inches and a quarter in length. It had been intended, there could be no doubt, as an ornamental article of dress; but how it was to be worn, or what rank, honor, and dignity, in by-past times, were signified by it, was a riddle which (so evanescent are the fashions of the world in these particulars) I saw little hope of solving.
The main story is introduced as the solution to the "riddle" the fabric letter presents. The entire plot concerning Hester, Pearl, Dimmesdale, and Chillingworth is the frame narrator's answer to the question of what the scarlet letter might have signified when it was first made.
Interestingly, the frame narrator does not pretend to have found a document detailing the events of the main story. He has only found the scarlet letter, and he has completely fabricated the story about it. Still, he emphasizes that this frame narrative adds "authenticity" to the novel:
It will be seen, likewise, that this Custom-House sketch has a certain propriety, of a kind always recognized in literature, as explaining how a large portion of the following pages came into my possession, and as offering proofs of the authenticity of a narrative therein contained.
The claim of authenticity seems contradictory with the frame narrator's outright claim that he made the story up. The "following pages" came into the frame narrator's possession primarily out of his imagination after he found the letter—not through a traceable chain of evidence. Other frame narrators might admit to embellishing details, but they usually keep up a charade of trying to preserve documented history. But the narrator of The Scarlet Letter is not so interested in preserving and reproducing the historical archive as he is in using history as a key to authentically understanding the present. With this in mind, boring details about the Custom House are more important than they may appear to readers who are tempted to skip the long-winded introductory chapter, as these details provide the key to understanding the novel as a commentary on American capitalism in the 19th century.