Heroin is a member of the alkaloid family of chemicals (which normally contain a somewhat basic nitrogen group). It is produced by chemical modification of morphine; the principal opiate obtained from the poppy plant. The synthesis of heroin from morphine is actually fairly simple and involves the acetylation of two hydroxyl groups, hence heroin is also known as diacetylmorphine.
Heroin was synthesized and produced commercially in the late 19th century by the Bayer company in Germany and was intended to be a non-addictive substitute for morphine, which was a common medical ingredient at the time. The name “heroin” was meant to reflect the chemical’s heroic properties (an early attempt at branding!). As we all know, this idea didn’t work out so well, since heroin is actually extremely addictive. In fact, heroin is about twice as powerful as morphine, possibly because it is less polar and can more readily move into the brain once it enters the body. The dangers of heroin were quickly recognized and it was banned quite soon after it became available (in 1924 in the U.S., for example).