The Worshipful and Ancient Law of Gallifrey (also called The Book of Rassilon) was a book that was once stored in the Panopticon Archive on Gallifrey. One of the Artefacts of Rassilon, it was also the "key" to Shada, the Time Lords' prison planet. When the pages were turned inside a TARDIS, it would take the craft to Shada.
The text of the book was written in ancient Gallifreyan and read largely as gibberish, though the book itself had several remarkable features, such as absorbing radiation, having no discernible atomic structure, time running backwards over it, being impervious to damage or even spectrographic analysis. The book had the power to absorb radiation and energy and feed it back, causing damage to the equipment studying it. (TV: Shada, WC: Shada, PROSE: Shada)
Removal from Gallifrey and subsequent use
While studying at the Time Lord Academy, the Master schemed to obtain the book from the Panopticon Archives, believing it held the key to ultimate power. He manipulated one of his Professors, Salyavin, and, when things went awry, framed Salyavin for the attempted theft. Realising he would be imprisoned whether guilty or innocent, Salyavin ironically decided to actually steal the book for himself before he was arrested. (PROSE: The Legacy of Gallifrey) In its place, he left a decoy, really just a copy of a human work of fiction entitled The Hitchhiker's…, which he disguised in a red binding based on that of the original. (PROSE: Shada)
After escaping from Shada, Salyavin, in his new identity as Chronotis, decided to take the book with him to 20th century Earth when he officially retired; he knew it was the only remaining way for other Time Lords to get back to Shada now that he had erased all knowledge of it from their minds so as to hide his jailbreak. Chronotis would later describe his crime in bringing such a dangerous book to Earth an argument, an oversight — but only inasmuch as he had "overlooked the fact that he had decided to take it". (TV: Shada)
An alternate timeline was once created by the introduction of anachronistic technology to 331 BC Alexandria by Rhakotis. One such piece of technology was the installation of time-travel portals to the royal library, which allowed the library's scholars to travel to the 20th century where they acquired the book and brought it back home to Alexandria. The reading aloud of the book by Barbara Wright resulted in the reversion of the timeline such that Rhakotis's arrival only resulted in his death, averting the timeline. (PROSE: The Book of Shadows)
In 1979, a remorseful Chronotis subsequently requested that the Fourth Doctor return it to Gallifrey for him. Following this meeting it was stolen by Skagra, who used it and the Doctor's TARDIS to travel to Shada. (TV: Shada, WC: Shada)