On August 15, 1840, in Nauvoo, Illinois, USA, the Prophet Joseph Smith delivered a powerful sermon at the funeral of Seymour Brunson. He read much of 1 Corinthians 15, including verse 29 which refers to the practice of baptism for the dead. Then he revealed that the Lord would permit the Saints to be baptized for their deceased ancestors. The first proxy baptisms were done in the Mississippi River.
A few months later, on January 19, 1841, the Lord commanded the Saints to build a temple with a baptismal font (see D&C 124:29–31). The Prophet directed that the font rest on the backs of twelve oxen, as did the font King Solomon built for his temple anciently (see 1 Kings 7:23–25).
Concerning baptism for the dead, the Lord, speaking through the Prophet Joseph, said to the Saints on September 1, 1842, “Let the work of my temple, and all the works which I have appointed unto you, be continued on and not cease; and let your diligence, and your perseverance, and patience, and your works be redoubled, and you shall in nowise lose your reward” (D&C 127:4).