Midway through the second season of Silicon Valley, the HBO series that so skillfully spoofs the Bay Area tech scene, the plot turns to porn.

Inside the offices of Pied Piper, the fictional startup at the heart of the show, a shaggy-haired coder hacks into a rival company. The rival, he discovers, has landed a $15 million contract with a porn outfit called Intersite, also fictional, agreeing to build software that will compress Intersite's videos and send them across the 'net. Pied Piper's CEO, Richard Hendricks, is bemused. "I don't understand," he says. "How does Intersite have all this money?"

"It's pornography," says the guy with the highfalutin facial hair.

"Adult content has driven more important tech adoption than anything," says another colleague. "The first fiction ever published on a printing press was an erotic tale. And from there: super 8 film, Polaroid, home video, digital, video on demand—"

"—credit card verification systems, Snapchat—" adds a third.

"Pornography accounts for 37 percent of all Internet traffic."

"Thirty-eight when I'm on it," says the guy with the highfalutin facial hair.

In many ways, the exchange is typical of the show. It's good for multiple laughs, particularly if you're wise to the shamelessly eccentric ways of the modern tech world. Punchline aside, the big laugh is that nod to Snapchat, a mainstream private-messaging-and-video-chat app whose status as a porn service is, shall we say, unofficial. But Pied Piper's porn encounter is a rare case where Silicon Valley gets things wrong. Typically, the parody rings so very true. In this case, it doesn't.

'The thing about the adult industry today is that ... it's a very low-margin business.' Chris O'Connell, Mikandi

In the popular imagination, the eternal trope is that the porn industry drives the adoption of new technology; that it accounts for some astronomically large portion of all Internet traffic; and, yes, that it generates equally enormous sums of money for all the faceless people who run its operations. We picture these people as sleazy Southern Californians wearing pinkie rings and polyester. Or, if we've come to realize that the pinkie-ring caricature makes absolutely no sense in the age of the Internet, we see them as ruthlessly clever businesspeople with a sixth sense for where the big money lies. That's the stereotype Silicon Valley embraces. Later in the episode, when Hendricks turns up at an adult industry conference, we encounter an army of porn execs dressed like bankers.

But it isn't like that at all.

Some of it may have been true in years past. But no longer. A colleague of mine calls this a meso-idea, an idea that has ceased to be true but that people continue to repeat, ad infinitum, as if it still was. With the rise of mobile devices and platforms from the likes of Apple and Google, not to mention the proliferation of free videos on YouTube-like porn sites, the adult industry is in a bind. Money is hard to come by, and as the industry struggles to find new revenue streams, it's facing extra competition from mainstream social media. Its very identity is being stolen as the world evolves both technologically and culturally.

It's a world where Playboy is going PG-13—in print and online—because it can't compete with the Internet at large. Mobile and social media platforms have pulled us away from the openness of the worldwide web and into walled gardens, squeezing the avenues of distribution for porn, co-opting its audience (at least in part), and forcing outfits like Playboy to become more "mainstream." The larger porn industry is headed in the same direction, careening away from the stereotypes held by journalists and pundits and pop culture like Silicon Valley. "That's obviously a fictional adult company—because I don't know a single one that would pay $15 million for compression software," quips Chris O'Connell, who helps run a real adult company called Mikandi. "The thing about the adult industry today is that ... it's a very low-margin business."

Mikandi operates the world's largest porn app store. When I talked to the publisher of XBIZ, the leading adult business news organization, he called it "the future of the porn industry." And in some ways, it is. But that future isn't what the popular imagination expects.

O'Connell, Mikandi's 29-year-old chief architect, lives in Tucson, Arizona, and he runs the company with Jesse Adams and Jen McEwen, the young Seattle couple who launched the store back in 2009, providing an alternative to the Android and iPhone app stores that forbid adult content. Apple also bars Mikandi itself from iPhones, and the only way to use it on an Android phone is to download it manually through a web browser—the same browser that serves up a seemingly endless stream of free pornography.

That said, Mikandi aims to offer stuff you can't get elsewhere. A smartphone app does video and animation much better than a browser, and the store serves up carefully crafted stuff like hand-drawn hentai—aka Japanese porn animation. Over the last three years, the word "hentai" accounted for more Mikandi searches than the word "free." The premium apps carry a price tag, and the company takes a cut whenever anyone buys one.

But the audience is relatively small. About 2.5 million people are registered with the Mikandi store, with about 345,000 visiting every three months. All of which means: O'Connell, Adams, and McEwen pull in yearly salaries somewhere in the low six figures, after paying "competitive" wages to a handful of coders in Seattle and Eastern Europe. "None of us own a yacht," O'Connell says. Or as McEwen puts it: "You can't understand the obstacles that are in our way."

'The Perfect Storm'

She doesn’t mean obstacles of morality or law. Yes, many people frown on porn, calling it exploitative and debasing. But many others just see it as a part of life—a big part of life. There's an enormous audience for porn, and whatever it signifies, whatever emotions it stirs in critics, this audience isn’t going away. McEwen means economic obstacles, business obstacles, technical obstacles.

It wasn't always this way. In the early aughts, online porn was ridiculously lucrative. Colin Rowntree, a porn producer, director, distributor, and member of the Adult Video News Hall of Fame, was a just mid-level player, and in those days, he and his wife, Angie, earned millions each year. But at the end of the decade, just about everything changed. Apple introduced the iPhone, which moved so much of our digital lives onto mobile devices while officially banning pornography in its App Store. Google pushed porn to the fringes of its search engine. And as The Economist and Buzzfeed have described, an army of "Tube sites"—essentially Youtube knockoffs with names like Youporn and Pornhub—began offering a smorgasbord of online porn for free, much of it pirated, making it far more difficult for pornographers and distributors to make money. All this happened as the worldwide economy tanked.

"It was the perfect storm," says Rowntree. "People no longer wanted to pull out their credit cards. But they said: 'Oh, there's this thing called YouPorn. It may be grained and shitty, but at least I can masturbate.'"

The adult industry sought new avenues, including porn app stores, porn search engines like Rowntree's Boodigo, and other workarounds, as well as "live cams," where people pay to watch and interact with an adult performer in real time. That's pretty much what strippers and porn stars have offered over Snapchat. But this too has its limits. One of the kings of live cams, Kink.com, the company the operates out of a castle-like former armory in San Francisco's Mission District, has also seen revenues decline in recent years. Snapchat now works to shut down accounts dedicated to pornography.

Annie Marie Musselman for WIRED

Certainly, some people will pay for a better experience than they can get on a Tube site. Todd Glider is the CEO of CMP Group, whose video service, Badoink, has found another loophole in the smartphone market—-it offers a video streaming tool that's ostensibly content-neutral but can be used for porn—and he says the company pulls in $55 million a year in revenues. But the best content is often pirated and offered for free, much like Hollywood blockbusters and best-selling albums. The difference is that Hollywood has the political and economic power to suppress pirated content—and push official content through mainstream services. The porn biz can issue DMCA takedown notices and threaten legal action like anyone else, but it doesn't have the clout to enforce the notices on a wide scale—or make anyone care that it's being ripped off.

"The adult industry isn't able to enforce its intellectual property protection," says Kate Darling, a researcher at the MIT Media Lab who explored the economics of the adult industry in the 2013 study What Drives IP without IP? A Study of the Online Adult Entertainment Industry. "It's not that much different from others industries—except that policy makers don't really look at the adult industry and aren't interested in helping the adult industry."

Meanwhile, with the rise of Netflix and YouTube and so many other mainstream video services—including Facebook and Twitter—porn is no longer the dominant form of online video. It's hard to tell how much porn streams across the 'net—no reliable operation tracks this, including Sandvine, the primary source for internet traffic research—but it doesn't account for 37 percent of all traffic. It's not even close. Mikandi declines to discuss its traffic. But a better barometer is the Pornhub Network, which now spans several of the major Tube sites. Pornhub says its network receives about 100 million visits a day, and at least on part of the network, the average visit lasts about nine minutes. If you extrapolate, that's somewhere in the range of 450 million hours of viewing a month. Meanwhile, Netflix serves 60 million subscribers, and these subscribers watch over 3.3 billion hours of programming a month (10 billion a quarter). Youtube claims hundreds of millions of hours of viewing daily.

"What happens is: someone comes up with a stat [about porn traffic] and everyone repeats it, but it's not necessarily true," Pornhub vice president Corey Price says. "If you just look at YouTube's numbers, they're astounding."

The corollary is that, with the rising power of companies like Apple and Google and Facebook, the adult industry doesn't drive new technology. In many respects, it doesn't even have access to new technology. The big tech companies behind the big platforms control not only the gateway services (the iPhone app store, Google Search, the Facebook social network) but the gateway devices (the iPhone, Android phones, Google Chromecast, the Amazon Fire TV, the Oculus Rift virtual reality headset). And for the most part, they've shut porn out. Besides, these giants now drive new technology faster than services like Mikandi or Pornhub ever could.

Porn distributors have become the imitators, not the innovators. This summer, Pornhub introduced a for-pay service, an alternative to its ad-driven free porn sites. In a press release, the company called it "the Netflix of porn." When I talk to Price, he compares it to Spotify. And remember: the Tubes sites have spent the last decade mimicking Youtube. "We've innovated in some areas," Price says. "But the adult industry being the leader of technology? If it was ever true, it isn't true today."

Silicon Valley doesn't even get the clothes right. The reality is that people from porn companies wear whatever they want at conferences—a lot like people from other tech companies. "People who work in the adult industry are like people who work for other startups," says one industry veteran. "But they have an edge. They have a certain countercultural attitude." They're a lot like people from other tech companies in so many ways. They just deal in a different type of online content. And even the content isn't as different as you might think.

This Is What the Porn Industry Looks Like

Back in 1998, in his preternaturally entertaining exposé of the porn business, "Big Red Son," which detailed his visit to an industry mega-conference, David Foster Wallace observed a world populated by people who wore bad toupees and pinkie rings and used the word class "as a noun to mean refinement." "All the clichés," he said, "are true."

They wouldn't stay true for long. The Internet would soon remake the industry. It became less about producers and directors in Southern California, and more about people who put stuff on the 'net. Old-school producers and directors are still around, but they've been superseded by the people who deliver the porn, and these people have moved into production as well. Twenty years later, almost none of Wallace's cliches are true. In fact, not even the clichés that replaced those clichés are true. Nowadays, the porn industry looks nothing like those guys in bad toupees—and nothing like the steely-eyed execs who show up in Silicon Valley. It looks like Chris O'Connell.

The big adult business-to-business conference is called Internext, and it's held at the Hard Rock Hotel, just off the Las Vegas strip. On the first day of this year's show, O'Connell turned up in a blue mohair and wool suit, with a red tie and matching handkerchief. As he walked down the hall that Saturday night, past the framed guitars, the signed Led Zeppelin photos, and the freestanding, poster-sized porn-tech ads, he carried a lit Dominican cigar in one hand, and two smartphones in the other. The second phone is unlocked and rooted, so he can test new software code.

This is pretty much what he always looks like—though, if it's cold, he might add a waistcoat, an overcoat, and a black fur felt fedora-like hat fashioned by a haberdasher in Romania. And on a Sunday morning, he might relax in a rugby shirt. But whatever he wears, he doesn't wear it with irony. "I'm not a hipster," O'Connell says. And he's not. He's a registered Republican. He's an engineer who quotes Adam Smith. He's a shareholder in a porn company who carries a commercial pilot's license. He’s neither a ruthless businessmen in a suit, nor a coder in a hoodie. He’s a coder in a suit with a bit more color to it. He's a guy with his own tastes—in clothes, in politics, in technology, in sex.

He lives in Arizona because he likes the politics, including the gun laws. Like many others in the porn business, he sits at the libertarian end of the spectrum. Free speech and free guns. He also lives in Arizona because that's where he went to grad school. After three years of liberal arts at Middlebury in Vermont and a few more years in the Silicon Valley startup world, he studied astronomy at the University of Arizona, working with the Large Binocular Telescope and contributing to academic papers in publications like The Astrophysical Journal and The Astronomical Society of the Pacific. At one point, to make some extra money, he helped build some websites, and some of them were adult sites. Mikandi was a next step. The world was going mobile, and the likes of Apple wouldn't allow porn apps. He thought it should. But he also liked the idea of, in his own way, rebuilding what Apple had built. He still does. "It's a very hard thing to do," he says.

As a metaphor, O'Connell works on multiple levels. He talks not like some smarmy San Fernando Valley opportunist or one of the porn industry automatons in Silicon Valley, but like a software engineer enthralled with things like the HHVM virtual machine, the Cloudfare content distribution network, and other really geeky stuff. After all, that's what he is. He doesn't just use tech. He builds it. And he does this under the aegis of a company whose Seattle offices, on the first floor of a nondescript building with no doorman, sit in the shadow of the glass towers that house Amazon, one of the big companies squeezing the porn industry. Plus, he's the guy who put porn on Google Glass.

The Steve Jobs Effect

Jesse Adams and Jen McEwen launched Mikandi in the fall of 2009 after spending two years in China bootstrapping a business that made vibrating condom rings and other sex toys. At first, the Mikandi app store wasn't much of a store. "We launched the day after Thanksgiving," Adams says, "with no apps." But it caught O'Connell's eye. He had spent the last six month building a similar store, just so he could get one of his own apps onto phones, and he asked Adams and McEwen if they could combine forces. "They had the marketing," he says, "and I had the technology."

Annie Marie Musselman for WIRED

Before long, the store also caught the eye of Steve Jobs. That spring, the Apple founder and tech world patron saint unveiled the latest incarnation of the world's most influential smartphone—the iPhone 4—and afterwards, he took questions from the press. At one point, a reporter asked if Apple would ever let people install software on the iPhone without the company's explicit approval, and in response, Jobs pointed to Android. Google let people install almost anything on Android phones—if they ventured outside the official Android app store.

"You know, there's a porn store for Android," Jobs said, referring to Mikandi, warning that this store delivered porn apps without discrimination. "Anyone can download them. You can. Your kids can. That's just not a place we want to go."

It was another reminder that the Internet had changed in the age of the smartphone, that many devices no longer offered unfettered access to whatever the world cared to send across the Internet. But that bit of Jobsian self-righteousness also carried some untended consequences. Though Jobs didn't mention it by name, about 10,000 people downloaded Mikandi onto their Android phones over the next 12 hours—ten times more than the usual—and traffic to the store promptly tripled.

And yet, all these years later, Mikandi remains a small business. O'Connell loves what he does. So do Adams and McEwen. And their business is successful. But it's small. That's because a porn startup can't raise large amounts of money like other startups. And because their store has been pushed to the edge of the Android world. And because so much porn is available for free from the tube sites and other sources. "The adult industry has a very large content library, with, to use one of the buzzwords of the Internet, a very long tail," O'Connell says. "You have so few viewers for each piece of content." But nowadays, those aren't the only forces keeping the company from the enormous bucks.

Ironically, O'Connell says, a company like Mikandi is also in a bind because so much free porn—or porn-like stuff—is now available through social media, from people posting stuff that isn't necessarily for financial gain. Facebook bans adult content. And other social sites have done much the same. But not all of them. Twitter puts pop-up warnings over porn, but you can still get to it. Tinder isn't all that different from an adult dating app. Snapchat cracks down on accounts dedicated to porn, but it is, by definition, a service for trading private pictures and videos. If you can get private pictures and videos through Snapchat, you aren't as interested in porn from porn companies.

In some respects, the porn industry has been replaced by millions of people with ready access to camera tech, posting stuff to the Internet. That's just the way the modern Internet works. "Adult," O'Connell says, "is getting rolled into everything else."

'It's Chaos. It's Fragmented. It's Broken. It's Blocked'

As he built Mikandi amidst this new world order, O'Connell didn't pay $15 million for video software. He and his team built it themselves. That's pretty much the way it works in the porn business. Part of it, O'Connell says, is that with all that free porn available across the `net, industry margins are much too thin for that kind of spending. But even if a company did pay $15 million for that kind of tech, it isn't likely to pay a mainstream startup a la Pied Piper.

The Silicon Valley bit about the industry driving the adoption of credit card verification systems takes on a new meaning when you consider that many credit card services now refuse to work with adult operations (in the early years, fraud, inordinate chargebacks, and other abuses were rampant). Many mainstream technology vendors take much the same stance, including companies that build email services and, yes, video engines.

"For adult companies, it's chaos. It's fragmented. It's broken. It's blocked," Adams says. "You have to build your own newsletter service. You have to build your own billing system. All the game tools for distribution and ads—none of that is available to adult companies. All the awesome stuff that everyone expects you to have is blocked."

That means adult operations need people like Chris O'Connell. After building the Mikandi video engine, O'Connell helps run a side business, Sendfaster, that sells similar technology to other operations, including customers outside the adult industry. Video tech isn't just a cost. It's a source of revenue. "The realities of the adult industry have meant that companies have to be scrappy," O'Connell says.

And yet, no matter how much technology people like O'Connell are willing and able to build, they will still reach enormous roadblocks—just because their tech handles adult content. In 2013, O'Connell landed a ticket to Google I/O, the company's annual developer conference, and he was among the few who had the opportunity to purchase a pair of Google's computerized eyewear. He did, and that meant he could build software for the device, which seems to project a tiny computer screen somewhere out in front of you when you slip it over your eyes. So, together with Adams and others, he built an app called "Tits and Glass." He was in the vanguard of a new kind of porn. The app let you share "share, comment, and vote on your favorite sexy photos with Google Glasses." Then Google shut it down.

Annie Marie Musselman for WIRED

Just after the app was released, the Internet giant changed its terms of service, banning content that contained nudity, graphic sex acts, or sexually explicit material. That was the end of Tits and Glass. Later, O'Connell and crew also built an app store for Google Chrome OS—the company's laptop and desktop operating system—and that was blocked, too. They wanted to put one on Google Chromecast, a gadget that puts apps and video on your TV. Same result.

Virtual Unreality

Nowadays, the prevailing narrative is that virtual reality will re-energize the porn industry. After I spoke to Alec Helmy, the publisher of XBIZ, who called Mikandi the future, he wrote back and mentioned VR. Buzzfeed, in its lengthy porn feature, paints VR as the great porn hope. You hear the same thing from, well, WIRED. But the future is more complicated than that. Think of Chris O'Connell and Google Glass. Think of Mikandi and Steve Jobs.

VR and its cousin, "augmented reality," are controlled by the big corporations. Facebook owns the Oculus Rift. Microsoft built the Hololens. Google does Google Glass. These will treat porn at least like Android treats porn—or maybe even like Glass treated porn when O'Connell unveiled his app. In other words, they won't allow it through official channels and maybe not at all.

Yes, the adult industry will build virtual reality porn. It has already started. Glider's CMP Corp offers 180-degree and 360-degree videos through a site called BadoinkVR.com. But in more ways than one, porn VR will sit on the fringes of the Internet. And the mainstream services will offer VR that's pretty porn-like. No, really. If we can communicate with each other via virtual reality, we will trade pornography—or stuff that's close to it. Culturally, we're moving towards a world where this kind of thing is more acceptable, where we're more open about it. As much as the big corporations bar porn from their services, it still shows up, thanks in part to the people and companies who don't call themselves porn vendors.

If all this true, then the stuff coming from the adult industry means less. As O'Connell explains, much the same thing is happening on today's 2D Internet. If we have Snapchat and Twitter and Tumblr, we don't need the porn companies—or at least, we don't need them as much as we once did.

O'Connell and Adams and McEwen now kinda wish they had branded themselves as a mainstream operation—not as a porn business. If they called themselves something else, they would have more freedom to do what they want to do. Indeed, as Mikandi competes with all those mainstream services, it's moving closer to mainstream content. Their store now offers games and comics and e-books. They're embracing many of the same digital artists whose work shows up on Tumblr and other mainstream services. "In some ways, it's about: how can we get less adult? Or rather: how do we serve our users more of the time? How do we provide them with the stuff they want all of the time?" O'Connell explains.

When it comes right down to it, he says, Mikandi isn't all that different from your typical tech startup. It uses many of the same tools to build much the same tech. Yes, it still serves up stuff that's more extreme than what you might find on even the most liberal of mainstream services. But that will slowly change too, as the mainstream moves closer and closer to porn. "You begin to wonder," O'Connell says, "if the industry will cease to be its own thing."