I had read in the bible that Prophet Moses received the 10 commandments on a tablet and there was also some other revelations which were not nailed on the tablet which constitute the Torah. Hence I was curious to know how and exactly when the Pentateuch we have in our hands was canonized in a book form and by whom.
Aside from a slight ambiguity about who wrote the final verses of the Torah that discuss the death of Moses, the Torah itself addresses its own authorship. It was written in its final form by Moses.
24 And it came to pass, when Moses had made an end of writing the words of this law in a book, until they were finished,
25 that Moses commanded the Levites, that bore the ark of the covenant of the LORD, saying:
26 Take this book of the law, and put it by the side of the ark of the covenant of the LORD your God, that it may be there for a witness against thee.