 They performed for the nobility.During the Edo period prostitution was legal and was mostly within walled in districts such as Yoshiwara, which were licensed by the Tokugawa Shogunate, known as the pleasure quarters.In the 17th century, high-class courtesans known as "oiran", or men working as geisha, would perform at parties.