The concept that Mashiach will arrive and reestablish the Davidic dynasty and rebuild the Beis Hamikdash is commonly known. The Rambam puts Mashiach as one of the fundamentals of belief. My question is, when was the concept of Mashiach created? Was this always the plan of the Torah or was this only after the sin of the golden calf? Perhaps after the destruction of the first temple?
Pirkei deRabbi Eliezer 3 lists seven things which were created before the world, one of which is the Name of Mashiach.