Allusion to Daniel
Adding just a few more comments to the astute answers already given . . .
“Of a truth, friend, that matter remaineth a riddle; and the Daniel who shall expound it is yet a-wanting” (Hawthorne 46) is an allusion to the book of Daniel reading:
Forasmuch as an excellent spirit, and knowledge, and understanding,
interpreting of dreams, and shewing of hard sentences, and dissolving
of doubts, were found in the same Daniel, whom the king named
Belteshazzar: now let Daniel be called, and he will shew the
interpretation (Daniel 5:12, KJV).
Daniel was the fourth of the greater prophets, taken as hostage in the first deportation to Babylon (c. 605 B.C.), because of the gift of God of the interpretation of dreams, he became the second in command of the Babylon empire and lasted through the end of the Babylonian empire and into the Persian empire. His prophecies are the key to the understanding of end time events. Noted for his purity and holiness by contemporary prophet, Ezekiel: “Though these three men, Noah, Daniel, and Job, were in it, they should deliver but their own souls by their righteousness, saith the Lord GOD” (Ezekiel 14:14, KJV) (see also Wood 344ff).
While Daniel is famous for being the interpreter of dreams, it is worth noting also that his name Daniel ( דִּנִיֵּאל) in Hebrew means "God is my judge" (Davidson 153). Also, while it is significant to the story (Scarlet Letter) that Daniel is an interpreter of dreams, it is equally significant that Daniel was known for his righteousness. Additionally, in historical context, Daniel is quick to give God the credit for his is ability to interpret dreams (see Daniel 2:23ff).
It is interesting, perhaps ironic, to note that in The Scarlett Letter, this allusion is in the context of Hester Prynne’s husband (the “stranger”) who is incognito and conversing with the “townsman” (45) and who later assumes the name “Chillingworth” (a name denoting coldness as in a “cold-hearted” person). He proceeds to extract the truth of Hester Prynne’s “accomplice” through manipulation and inhumane torture (of Dimmesdale)—decidedly “ungodly” behaviors (quite the opposite of righteous Daniel).
Sources
Davidson, Benjamin. The Analytical Hebrew and Chaldee Lexicon, Hendrickson Publishers, 1995.
The Holy Bible, Authorized King James Version, Thomas Nelson, 1972.
Pearson, Leland. The Scarlet Letter (Norton Critical Edition), W.W. Norton and Company, 2005.
Wood, Leon J. The Prophets of Israel, Baker Book House, 1979.