Upvote:1
Apparently it comes from popular legends.
From the Encyclopedia Brittanica entry on Nagarjuna:
Nagarjuna is particularly associated with the Prajnaparamita (“Perfection of Wisdom”) sutras in this corpus. According to legend, he retrieved from the bottom of the sea a perfection-of-wisdom sutra that the Buddha had entrusted to the king of the nagas (water deities) for safekeeping.
From the New World Encyclopedia entry on Nagarjuna:
Popular legends of Nagarjuna's life state that he traveled deep into the earth through his meditative powers (siddhi) to the lair of the nāga king, who had been entrusted by the Buddha with the Prajñā Pāramitā Sutras. Seeing that Nagarjuna was the one prophesied by Gautama who would "give vast and perfect explanations of the Buddha's teachings" (Gyamtso 2003, ix), he gave these texts to him to bring back to the surface. This story is used to explain the first part of his name (the second, arjuna, meaning “bright,” “shining,” or “silver”), his close association with the Prajñā Pāramitā Sutras, and his depiction in iconography with snakes extending over his head.