Every time I go to sleep in withdrawals, I have wet dreams.

Not wet dreams necessarily, but a big spike in sexual interest while you're withdrawing wouldn't be unusual. Opioids seem to murder your sex drive while you're on them, then you withdraw and you're hit with maybe a few month's worth of sexual interest in one go.

There's evidence linking wet dreams with testosterone promoting drugs. It's probably fair to say that a spike in testosterone can cause wet dreams to happen/happen more often.

https://en.wikipedia.org/wiki/Nocturnal_emission#In_males

http://press.endocrine.org/doi/10.1210/jcem.83.7.4961

Opioid dependence results in decreased testosterone levels generally. I guess withdrawing means your testosterone jumps back to normal levels and you start needing sex again/having wet dreams in your case.

https://en.wikipedia.org/wiki/Opioid#Adverse_effects

/r/Drugs Thread