Wainaina died in a hospital in Nairobi on Tuesday night after a brief illness, the friend who did not want to be named. Wainaina, founder of the literary magazine Kwani, had previously had a stroke in 2015.
He was a prolific writer who won the Caine award for African writing for his short story "Discovering Home" in 2002.
Before he Wainaina had been awarded a one-year written residence permit in Germany.
Wainaina was never one to be away from the controversy and was one of the most profiled people to publicly declare their sexuality in Africa, where homosexuality is largely considered taboo.
In an article in 2014 entitled "I am gay, mother" Wainaina wrote: "Never, mother. I did not trust you, mother. And I pulled air hard and pounded it into my navel and let it slowly and firmly, cleanly and without bumping out of the mouth, loud and clear over a shoulder in her ear. I am gay mum. "
He tweeted it later:" I am, for any confused or in doubt, a gay. quite happy. "
Wainaina also announced on Twitter on Worl ds Aid Day 201
Binyavanga Wainaina was a master of African art, creativity and culture, in 2010 he devised an idea to promote African writing through the pilgrimage project – a venture that would see 14 African writers taking African cities in an attempt to write Africa's largest travel book.
"The idea is to introduce our cities to ourselves because Africans always see each other through the eyes of others."
"For example, people travel back and forth between London and Lagos or New York and Nairobi, but not between African countries.
Shelves have since poured on Twitter to him.