Thank you for the question on the authorship of the Ten Commandments.
Modern scholars attribute the Torah to different authors as the JEDP Theory.
For one’s consideration that the author is God who verbalized the Ten Commandments and Moses wrote the words down in the Book of the Covenant.
A. The Ten Commandments were first spoken by God to his people (Exodus 20:1–2). Moses wrote all the words of God which was called, The Book of Covenant (Exod. 24:3–8) and the Israelites agreed to obey the Covenant.
B. The Ten Commandments were later inscribed by God on stones (Exod. 24:12) when Moses went up the mountain to meet with God.
C. The Ten Commandments prohibits bearing false witness. Thus for Jews to falsely attributed the writing or reception of the Ten Commandments to Moses is bearing false witness.
Though some modern scholars date the Torah to the Post-Exilic Period, there are recent discoveries that indicated there was a Temple. The Jews returned to rebuild the Temple and the Jerusalem walls. The post exotic Jews could not have built the Temple or Wall from scratch but rather they were able to used the materials that were torn down by the Babylonians.
Summary: Moses wrote the Ten Commandments in the Book of the Covenant before God inscribed it on stone tablets.
For more perspectives:
https://www.quora.com/Who-wrote-the-Ten-Commandments-for-the-first-time