Mahayoga teachings belong either to the tantra class (Tib. Gyüdé) and the sadhana class (Tib. Drupdé). In the sadhana class there are the sadhanas in which the Kagyé appear altogether and the sadhanas of the individual Kagyé deities. There are sadhanas such as Lama Rigdzin Düpa or Tukdrup Barché Künsel which are sadhanas of this particular Kagyé deity, Lama Rigdzin.
Lama Rigdzin is the lama practice. If you accomplish the practice of the lama, then you also accomplish the yidam, the dakini and the dharmapalas. Generally it is said that the root of all blessings is the lama, the root of all accomplishment is the yidam and the root of all activity is the dakini and the dharmapalas. These are the practices known as the “three roots”. Even so, since they are all accomplished through the force of the lama’s compassion, if you accomplish the lama you accomplish the others as well.
Vajradharma, the "keeper of secrets", compiled the Kagyé teachings and wrote them down. He then took them to the Shankarakuta (Tib. Deché Tsekpa) where they were buried in the presence of the great dakini Lekyi Wangmo. In the stupa together with the eight caskets, one for each of the Kagyé, there was one additional casket made from five different precious materials and studded with precious gems, within which were eight divisions corresponding to the eight Kagyé. Unlike the other teachings which were for the separate practice of each individual deity, these teachings were for the joint integrated practice of all eight simultaneously. This casket was put in the centre of the eight vajra masters, without being given to any one in particular. The teachings that came from this chest were the Kagyé Deshek Düpa: ‘The Gathering of the Sugatas of Kagyé’.
When each one of the great vajra masters who had gathered at Deché Tsekpa—Humkara, Manjushrimitra, Nagarjuna, Padmasambhava, Dhanasamskrita, Vimalamitra, Rambuguhya and Shantigarbha—had received their particular chest, they opened them and extracted their respective teachings (see the Kagyé article). However none of them were able to open the final casket containing the eight sectioned Kagyé Deshek Düpa, so for seven days the vajra masters became absorbed together in meditative equipoise, and prayed single-pointedly to the dakinis to assist them. As a result, after the seven days had elapsed, the seal of the last casket sprang free and it opened of its own accord. This is how they were able to extract the teachings of Kagyé Deshek Düpa.
Another historical account records how, since this receptacle could not be opened by the eight vajra masters, it was placed back inside the Deché Tsekpa stupa and buried once again. Then at a later date Guru Padmasambhava returned to open the seal and reveal it. When he extracted the Kagyé Deshek Düpa from the casket, the dakinis guarding the treasure asked Padmasambhava to practise these teachings and transmit them to others.
According to yet another account, the Vajrakilaya teachings were brought out and passed by the dakinis into the hands of the vajra master Prabhahasti, who then later transmitted them to Guru Padmasambhava. However, the casket of five precious substances containing the Kagyé Deshek Düpa was given directly by the dakinis to the vajra guru Padmasambhava.