The Kotmai Tra Sam Duang (hereafter abbreviated as KTSD) is a popular appellation given to a corpus of traditional laws of Thailand compiled in 1805 by the order of King Rama I of the reigning Chakri Dynasty. The importance of the KTSD lies in the fact that it is virtually the single source for those who wish to study the pre-nineteenth century legal texts of Thailand. It is generally believed that the Ayutthayan royal archives were almost completely destroyed when the old capital was sacked by the invading Burmese army in 1767. In fact, it is stated in a royal decree issued in 1794 that only a ninth or tenth of the Ayutthayan code of laws survived the catastrophe brought by the Burmese invasion.(Phraratchakamnot Mai 28 ) King Rama I who ascended the throne in Bangkok in 1782, would have felt it necessary to review the existing legal texts which obviously were not only far from complete but also should have understandably been corrupted in the war-stricken confusion.
The preamble of the KTSD refers to a divorce case that eventually came to reveal the inappropriate state of the existing legal texts. This led the king to order a prompt and total "cleansing" or kaan chamra or the corpus of laws. The task was commissioned to a group of specialists who started the operation on January 31, 1805 and ended, it is believed, either on September 3rd or December 16th of the same year. It took, therefore, nine or eleven months depending on which is to be taken as the date of its completion. The results of this enterprise can be seen today in the form of Chabap Luang or the Royal Copy of the KTSD. This Royal Copy is said to have been made in three sets, each consisting of forty-one volumes of samut khoi. They were kept in Ho Khruang. Sanluang samrap Lukkhun, and Ho Luang, respectively. Besides, another copy known today as Chabap Rongsong or a secondary copy was also produced.
Due to unknown reasons, however, all of these copies seem to have become scattered and lost by 1980, when a systematic attempt was made to reclaim the missing copies. As a result, 80 volumes of Chabap Luang and 17 volumes of Chabap Rongsong were recovered. Thus we are now able to have some idea as to what the whole corpus originally looked like.