Eight Consciousnesses
The Eight Consciousnesses (Skt. aṣṭa vijñānakāyāḥ) is a classification developed in the tradition of the Yogācāra school of Mahayana Buddhism. They enumerate the five sense consciousnesses, supplemented by the mental consciousness (manovijñāna), the defiled mental consciousness (kliṣṭamanovijñāna), and finally the fundamental store-house consciousness (ālāyavijñāna),  which is the basis of the other seven. This eighth consciousness is said to store the impressions (vāsanāḥ) of previous experiences, which form the seeds (bīja) of future karma in this life and in the next after rebirth. Eightfold network of primary consciousnesses
All surviving schools of Buddhist thought accept – "in common" – the existence of the first six primary consciousnesses (Sanskrit: , ). The internally coherent  school associated with Maitreya, Asaṅga, and Vasubandhu, however, uniquely – or "uncommonly" – also posits the existence of two additional primary consciousnesses, kliṣṭamanovijñāna and , in order to explain the workings of karma. The first six of these primary consciousnesses comprise the five sensory faculties together with mental consciousness, which is counted as the sixth. According to Gareth Sparham, The  doctrine arose on the Indian subcontinent about one thousand years before Tsong kha pa. It gained its place in a distinctly  system over a period of some three hundred years stretching from 100 to 400 , culminating in the , a short text by Asaṅga (circa 350), setting out a systematic presentation of the  doctrine developed over the previous centuries. It is the doctrine found in this text in particular that Tsong kha pa, in his Ocean of Eloquence, treats as having been revealed in toto by the Buddha and transmitted to suffering humanity through the  founding saints (Tib. shing rta srol byed): Maitreya[-nātha], Asaṅga, and Vasubandhu.While some noteworthy modern scholars of the Gelug tradition (which was founded by Tsongkhapa's reforms to Atisha's Kadam school) assert that the  is posited only in the Yogācāra philosophical tenet system, all non-Gelug schools of Tibetan buddhism maintain that the  is accepted by the various Madhyamaka schools, as well. The  eightfold network of primary consciousnesses –  in Sanskrit (from compounding , "eight", with , the plural of vijñāna "consciousnesses"), or  –  is roughly sketched out in the following table. Origins and development

Early Buddhist texts
The first five sense-consciousnesses along with the sixth consciousness are identified in the Suttapiṭaka, especially in the Sabbasutta, Saṃyuttanikāya 35.23:

The early Buddhist texts speak of anusayā (Sanskrit: anuśayāḥ), the “underlying tendencies” or “latent dispositions” which keep beings caught in the circle of samsara. These potential tendencies are generally seen as unconscious processes which "lie beneath" our everyday consciousness, and according to Waldron "they represent the potential, the tendency, for cognitive and emotional afflictions (Pali: kilesā, Sanskrit: kleśāḥ) to arise". Sautrāntika and Theravāda theories
The Sautrāntika school of Buddhism, which relied closely on the sutras, developed a theory of seeds (bīja, 種子) in the mindstream (cittasaṃtāna, 心相續, lit. "mind-character-continuity") to explain how karma and the latent dispositions continued throughout life and rebirth. This theory later developed into the alayavijñana view. The Theravāda theory of the bhavaṅga may also be a forerunner of the ālāyavijñana theory. Vasubandhu cites the bhavaṅgavijñāna of the Sinhalese school (Tāmraparṇīyanikāya) as a forerunner of the ālāyavijñāna. The Theravadin theory is also mentioned by Xuánzàng. Yogācāra

The texts of the Yogācāra school gives a detailed explanation of the workings of the mind and the way it constructs the reality we experience. It is "meant to be an explanation of experience, rather than a system of ontology". The theory of the ālāyavijñana and the other consciousnesses developed out of a need to work out various issues in Buddhist Abhidharma thought. According to Lambert Schmithausen, the first mention of the concept occurs in the Yogācārabhumiśāstra, which posits a basal consciousness that contains seeds for future cognitive processes. It is also described in the Saṃdhinirmocanasūtra and in the Mahāyānasaṃgraha of Asaṅga. Vasubandhu is considered to be the systematizer of Yogācāra thought. Vasubandhu used the concept of the six consciousnesses, on which he elaborated in the Triṃśikaikākārikā (Treatise in Thirty Stanzas). Vijñānāni
According to the traditional interpretation, Vasubandhu states that there are eight consciousnesses (vijñānāni, singular: vijñāna):
 Five sense-consciousnesses,
 Mind (perception),
 Manas (self-consciousness),
 Storehouse-consciousness. According to Kalupahana, this classification of eight consciousnesses is based on a misunderstanding of Vasubandhu's Triṃśikaikākārikā by later adherents. Ālayavijñāna
The ālayavijñāna (Japanese: 阿頼耶識 arayashiki), or the "All-encompassing foundation consciousness", forms the "base-consciousness" (mūlavijñāna) or "causal consciousness". According to the traditional interpretation, the other seven consciousnesses are "evolving" or "transforming" consciousnesses originating in this base-consciousness. The store-house consciousness accumulates all potential energy as seeds (bīja) for the mental (nāma) and physical (rūpa) manifestation of one's existence (nāmarūpa). It is the storehouse-consciousness which induces rebirth, causing the origination of a new existence. Role
The ālayavijñāna is also described in the Saṃdhinirmocanasūtra as the "mind which has all the seeds" (sarvabījakam cittam) which enters the womb and develops based on two forms of appropriation or attachment (upādāna); to the material sense faculties, and to predispositions (vāsanāḥ) towards conceptual proliferations (prapañca). The Saṃdhinirmocanasūtra also defines it in varying ways:

This consciousness is also called the appropriating consciousness ("adana-vijñana") because the body is grasped and appropriated by it. It is also called the "alaya-vijñana" because it dwells in and attaches to this body in a common destiny ("ekayogakṣema-arthena"). It is also called mind ("citta") because it is heaped up and accumulated by [the six cognitive objects, i.e. :] visual forms, sounds, smells, flavors, tangibles and dharmas. In a seemingly innovative move, the Saṃdhinirmocanasūtra states that the alayavijñana is always active subliminally and occurs simultaneously with, "supported by and depending upon" the six sense consciousnesses. According to Asanga's Mahāyānasaṃgraha, the alayavijñana is taught by other Buddhist schools by different names. He states that the alaya is what the Mahasamghikas call the “root-consciousness” (mulavijñana), what the Mahīśāsakas call “the aggregate which lasts as long as samsara” (asaṃsārikaskandha) and what the Sthaviras call the bhavaṅga. Rebirth and purification
The store-house consciousness receives impressions from all functions of the other consciousnesses, and retains them as potential energy, bīja or "seeds", for their further manifestations and activities. Since it serves as the container for all experiential impressions it is also called the "seed consciousness" (種子識) or container consciousness. According to Yogācāra teachings, the seeds stored in the store consciousness of sentient beings are not pure. The store consciousness, while being originally immaculate in itself, contains a "mysterious mixture of purity and defilement, good and evil". Because of this mixture the transformation of consciousness from defilement to purity can take place and awakening is possible. Through the process of purification the dharma practitioner can become an Arhat, when the four defilements of the mental functions  of the manas-consciousness are purified. Tathagata-garbha thought
According to the Laṅkāvatārasūtra and the schools of Chan and Zen Buddhism, the ālāyavijñāna is identical with the tathāgatagarbha, and is fundamentally pure. The equation of ālāyavijñāna and tathāgatagarbha was contested. It was seen as "something akin to the Hindu notions of ātman (permanent, invariant self) and  (primordial substrative nature from which all mental, emotional and physical things evolve)." According to Lusthaus, the critique led by the end of the eighth century to the rise of the logico-epistemic tradition of Yogācāra and a hybrid school combining Tathāgatagarbha thought with basic Yogācāra doctrines:

Transformations of consciousness
The traditional interpretation of the eight consciousnesses may be discarded on the ground of a reinterpretation of Vasubandhu's works. According to Kalupahana, instead of positing such an consciousnesses, the Triṃśikaikākārikā describes the transformations of this consciousness:

These transformations are threefold:

The first transformation results in the ālāya:

The ālāyavijñāna therefore is not an eighth consciousness, but the resultant of the transformation of consciousness:

The second transformation is manana, self-consciousness or "Self-view, self-confusion, self-esteem and self-love". According to the Lankavatara and later interpreters it is the seventh consciousness. It is "thinking" about the various perceptions occurring in the stream of consciousness". The alaya is defiled by this self-interest;

The third transformation is viṣayavijñapti, the "concept of the object". In this transformation the concept of objects is created. By creating these concepts human beings become "susceptible to grasping after the object":

A similar perspective is give by Walpola Rahula. According to Walpola Rahula, all the elements of the Yogācāra storehouse-consciousness are already found in the Pāli Canon. He writes that the three layers of the mind (citta, manas, and vijñāna) as presented by Asaṅga are also mentioned in the Pāli Canon:

Understanding in Buddhism

China

Fǎxiàng and Huayan 
According to Thomas McEvilley, although Vasubandhu had postulated numerous ālāya-vijñāna-s, a separate one for each individual person in the parakalpita, this multiplicity was later eliminated in the Fǎxiàng and Huayan metaphysics. These schools inculcated instead the doctrine of a single universal and eternal ālaya-vijñāna. This exalted enstatement of the ālāyavijñāna is described in the Fǎxiàng as "primordial unity". Thomas McEvilley further argues that the presentation of the three natures by Vasubandhu is consistent with the Neo-platonist views of Plotinus and his universal 'One', 'Mind', and 'Soul'. Chán
A core teaching of Chan/Zen Buddhism describes the transformation of the Eight Consciousnesses into the Four Wisdoms. In this teaching, Buddhist practice is to turn the light of awareness around, from misconceptions regarding the nature of reality as being external, to kenshō, "directly see one's own nature".. Thus the Eighth Consciousness is transformed into the Great Perfect Mirror Wisdom, the Seventh Consciousness into the Equality (Universal Nature) Wisdom, the Sixth Consciousness into the Profound Observing Wisdom, and First to Fifth Consciousnesses into the All Performing (Perfection of Action) Wisdom. Korea
The Interpenetration (通達) and Essence-Function (體用) of Wonhyo (元曉) is described in the Treatise on Awakening Mahāyāna Faith (大乘起信論, Mahāyānaśraddhotpādaśāstra, AMF in the excerpt below):

