Sayyiduna Ali (may Allah be pleased with him) asked Sayyiduna Miqdad (may Allah be pleased with him) to ask the Prophet (peace and blessings be upon him) about madhy, and said: I feel too shy to ask him (peace and blessings be upon him). Sayyiduna Miqdad (may Allah be pleased with him) asked, and he (peace and blessings be upon him) said: "He should wash his private part and his testicles and perform ablution like that for prayer."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 4130