While Twitter struggles to get new users,

its revenue side is killing it. Welcome to the not-so-dismal science of Twitternomics.

In 2009 Twitter was a 50-person company punching way above its weight in cultural impact, its micro-blogging platform blasting its way into the public imagination. But its ambitions were even higher. According to leaked internal documents, the company had privately set goals over the next few years of a billion users and well over a billion dollars of annual revenue. Many people thought that the first goal was inevitable and that the second would be a slog. After all, Twitter’s user base was skyrocketing much in the way of other Internet phenoms like Facebook and Google. But there was virtually no income and no monetization plan in sight. When a Twitter co-founder appeared on the Colbert Report that spring, the host remarked, “So I assume that ‘Biz’ in ‘Biz Stone’ does not stand for ‘Business Model’?”

It wasn’t only comedians who held that view. In that summer’s Sun Valley mogulfest, media icons Barry Diller and John Malone, on a “Making Money on the Internet” panel, called out Twitter as an example of a fad product that might never generate serious cash. Cable-TV pioneer Malone said it was unlikely that the company could build a significant advertising business.

Twitter now is a public company with a headcount of 3600 and a valuation of over $23 billion. But it has not come close to a billion users (not even 300 million). The shortfall has unleashed a torrent of criticism, and even intimations that an executive putsch will be required to address endemic product woes.

On the other hand, in 2014 Twitter did generate that billion dollars in revenue. (The final number will come in when the company reports earnings later this week, but its earlier estimate was $1.375 billion.) And the stash has been rising at an annual rate of over 100 percent. Twitter’s bottom line is not in the black, but blame that on continuing expenses in growing its business and (mainly) paying out huge amounts of “stock-based compensation” to employees. That’s not uncommon in the Internet world: more notable is that Twitter has cracked the code to making money on the net.

You heard that right: while the headlines about Twitter describe a company in crisis, the business end of the company has been nailing its targets, and its revenue team is the envy of the industry. “Twitter sold the wrong thing to investors — it sold the user story,” says analyst Brian Weiser of Pivotal Research Group of the company’s emphasis during the 2013 IPO rollup. “In spite of obvious evidence that user growth was slowing, they picked that as the story, and they failed to deliver. But revenue is doing what it should do.”

So how is Twitter making its money? The obvious answer is advertising — those “Promoted Tweets” that appear unbidden in a user’s timeline. Getting there wasn’t easy. And it takes effort to understand how those ads work. But in contrast to the well-documented turmoil in the company throughout its history, the road to revenues for Twitter has been a steady, coherent, patient and innovative path. And more recently, the company has embarked on a strategy to go beyond those ads to make money from selling products directly, and even monetizing people who don’t use Twitter. (More on this in Part Two of the series.)

What’s more, Twitter has turned this trick in its own unique way, creating a system that’s true to its peculiar culture. So here, in somewhat more than 140 characters, is the tale of Twitternomics.

In mid-2009 Twitter’s CEO was co-founder Evan Williams. (Williams is still on Twitter’s board of directors — and, I should disclose, he is also the CEO of Medium, which makes him my boss.) Just after that Sun Valley panel — Williams was in attendance— I asked him about the incident in an interview for a story for Wired. “I didn’t argue my case, but all the Internet guys I talked to were laughing at the media guys,” he said. “Are you kidding? There’s obviously a huge business there.” Later in the interview, though, he blithely admitted that Twitter had made little headway in that direction, mainly because it wasn’t yet a priority. But he noted that since Twitter was widely used by corporations to connect with their customers, the transition would be natural.