Andrey Ternovskiy, an eighteen-year-old high-school dropout from Moscow, has a variety of explanations for why he created the Web site Chatroulette.com. According to one story, he got bored talking to people he already knew on Skype; according to another, it was a fund-raising ploy for a bike trip from Moscow to Amsterdam. The most reliable version, however, centers on a shop called Russian Souvenirs. It is an upscale outfit owned by Ternovskiy’s uncle Sasha, who hired his nephew to work there as a salesman during the summer of 2008, five days a week, eleven hours a day. Ternovskiy was supposed to show foreign tourists around the shop, pulling various nesting dolls, lacquered boxes, and kitschy Soviet paraphernalia from the bright vitrines. The job was easy but exhilarating.

“I was really excited to work there, because I met, like, hundreds of different nations in a day,” Ternovskiy said recently at a coffee shop near his mother’s apartment, in the far reaches of northwestern Moscow. He is thin and nervous, with light sprays of acne on his cheeks and a fuzz of dark-blond hair. He has a hard time making eye contact and learned English by spending thousands of hours chatting online, but he says that his passion is talking with people and “exploring other cultures.”

Selling souvenirs to foreign tourists was an ideal job for Ternovskiy. He worked tirelessly, and began to learn German, Spanish, Italian, French, and even some Turkish. He memorized the numbers and some key phrases. By the second week, he could size up a customer’s nationality and address him in his own tongue. He didn’t, however, take quite as well to the business side of things. He would talk and joke with the tourists, but he didn’t push them to buy anything. If someone asked for a discount, he happily obliged. This rankled his uncle, but Ternovskiy didn’t see the problem. “I couldn’t just make people pay the money,” he says, laughing. “I just couldn’t feel the value of the money.” He was fired within a month.

The following summer, Ternovskiy holed up at home and began to toy with the code for a new site that would re-create the atmosphere of the store. It took him three days to construct a basic version. A few months later, it was one of the most talked-about social-networking sites in the world.

The idea is simple. When you log on to Chatroulette.com, you see a sparse white window with two boxes. One box shows your own image, courtesy of your Webcam; the other is for the face of what the site calls, somewhat ambiguously, a “partner.” When Partner appears, you can stay and talk using your voice or your keyboard, or you can click “Next,” which whips you on to someone new. The point is to introduce you to people you’d never otherwise meet and will never see again—the dancing Korean girls, the leopard-printed Catman, the naked man in Gdansk.

More than a million people, most of them from the United States, clog Chatroulette’s servers daily. To “next” someone has become a common transitive verb. Catman is an Internet celebrity, as is Merton the improvising pianist. Brooklyn bars throw Chatroulette parties, an indie band has used the site to début an album, and the Texas attorney general has warned parents to keep their children far, far away. Hundreds of articles and blog posts have asked whether Chatroulette is a fad or a good investment, and if it will change Internet culture forever. “The Daily Show” ’s Jon Stewart attempted to take his pants off for the NBC anchor Brian Williams while Chatrouletting on the air.

A visit to Chatroulette usually begins with a few rushed clicks of the “Next” button, either out of a sense of danger—do you really want to engage with that empty-eyed guy lounging in bed?—or out of curiosity about what’s around the corner. The site can be especially hard on men. The majority of Chatroulette users are male and under thirty-five, and many of them are trolling for girls, so they “next” each other at barbaric rates. When you do decide to stop and engage, things can get a little awkward. On one of my first Chatrouletting attempts, I found myself talking to a man from Lyons, who had muted the sound. We watched each other typing and reacting to the words that scrolled next to our images, co-stars in a postmodern silent film.

There are some unsavory things on Chatroulette: copulating couples, masturbators, a man who has hanged himself (it’s fake). When the actor Ashton Kutcher was in Moscow in February, as part of a U.S. State Department technology delegation, he berated Ternovskiy for what his stepdaughter had seen on the site. “You’ve got to clean this up!” he said. (Within twenty-four hours, Ternovskiy made it vastly easier for the site to cut off offensive users.) But the YouTube videos that people have recorded of their trips through the Chatroulette vortex also show a lot of joy. There is, for example, the video of the dancing banana, crudely drawn on lined paper, exhorting people to “Dance or gtfo!” (Dance or get the fuck out.) The banana’s partners usually respond with wiggling delight. There’s also something liberating in the protection that the “Next” button provides. Striking up a conversation with the person next to you on the subway is risky, and potentially time-consuming. On Chatroulette you can always just disappear.

“People are, from a gut, instinctual level, so interested in finding each other. You see the lonely in people,” says Scott Heiferman, the founder of Meetup, a site that facilitates in-person meetings for people with common interests. His site is the antithesis of Chatroulette, yet he finds something deeply compelling in the idea of a blank screen, behind which lies a crowd of strangers waiting to talk to you. “It’s really strange,” Heiferman says. “I have employees I’ve never had a conversation with, but there I am sitting in my office, dicking around with Chatroulette.”

The technology behind Chatroulette is fairly basic and not particularly new. But by combining video-chatting technology and randomization Ternovskiy has bucked a decade-long trend that has made the Internet feel progressively more organized, pleasant, and safe. Google (founded in 1998) makes sure you pull up less flotsam when you search. Social networks like Friendster (2002), MySpace (2003), and Facebook (2004) let you stay in touch with a network of people you already know. Privacy settings keep out the ones you don’t. Twitter (2006) feeds you information from sources you choose to follow. Now Chatroulette has come along and showed us that we want chaos, too.

The best way to talk to Ternovskiy is through some kind of digital intermediary. Shy and evasive in person, he fills with a wry swagger when he is just a stream of text. “They have no business no money blablablabla,” he typed to me one afternoon, feigning phlegmatic unconcern with the financial woes of an advertiser he’d been negotiating with—his only one. Like much of his generation, Ternovskiy has an online persona far more developed than his real one.

He was born on April 22, 1992, less than four months after the collapse of the Soviet Union, and grew up in a tidy apartment in a typically dingy Moscow high-rise. His mother, Elena, is a talented mathematician who works on differential equations at the élite Moscow State University. His father, Vladimir, is an associate professor of mathematics at the same university, and dabbles in cybernetics. Their household was loving but turbulent. The couple fought and frequently separated, and Vladimir started a parallel family, an issue that was never openly discussed. (“It’s a little game we play,” Elena said of the arrangement.) Andrey retreated to his room, where, thanks to Vladimir’s belief that “the future would have something to do with computers,” there was always a machine, as up to date as the family could afford. Vladimir invested great effort in Andrey’s upbringing, engaging a Chinese tutor, a weight-lifting coach, and a chess teacher. But most of Andrey’s learning occurred alone, with his computer. He started with games, usually of the reality-simulating variety. By fourth grade, he was writing code.

Like many young Russians with programming skills, Ternovskiy turned to hacking. When he was eleven, he came upon zloy.org (which translates as angry.org), a hacker forum led by a young man named Sergey (a.k.a. Terminator), who trained his followers in cyber warfare. Using the handle Flashboy, Ternovskiy soon mastered the art of the denial-of-service attack, wherein a target system is paralyzed by a mass of incoming communication requests. Next came Web-site and e-mail hacking, a service he gladly performed for girls who asked nicely. By 2007, at the age of fifteen, Ternovskiy had learned about what hackers call “social engineering”—getting what one wants through deceit or manipulation. Posing as a teacher, Ternovskiy got access to some practice tests before they were delivered to his school.

As Ternovskiy spent more and more time on the computer, his grades tumbled. Vladimir, concerned by his son’s academic languor, hired a graduate student as a math tutor. But Ternovskiy was often late to the sessions, and, worse, he seemed either unable or unwilling to solve the most basic problems. “I just don’t understand how someone can code and have such big blank spots in math,” the tutor, Fedor Puchkov, said. He soon realized, however, that, despite Ternovskiy’s inability to crack simple problems, the more unusual and visual the problem the more elegant Ternovskiy’s answer. Two robots parachute onto an infinite checkered strip; how do you make them track each other down? “Andrey found the optimal solution,” Puchkov said. How do you cut a square into convex pentagons? “Here’s how Andrey solved it,” Puchkov said, and sketched a square with two abutting pentagons in the center and lines radiating out cleanly to the perimeter. It was the simplest solution—and Ternovskiy had come to it far more quickly than Puchkov had.

“I don’t know,” Ternovskiy says of the way he thinks. “I quickly get the scheme of how it should work in my head. I just write out the remaining details, and that’s all the work. It’s probably weird.” Puchkov’s explanation is “He’s not stupid—he’s lazy.”

The math sessions with Puchkov had no impact on Ternovskiy’s classroom performance. The deputy chief of security at his school has a thick file on Ternovskiy’s delinquencies, including chronic truancy and correcting the English of his English teacher. His mother recently tried to make peace with the school authorities, but they waved her off, dismissing Ternovskiy as an unwelcome “millionaire.” Ternovskiy, meanwhile, sees school—and college—as a waste of time. “The last three years at school, I haven’t done anything,” he says. “I just can’t make myself. There’s so much interesting stuff in the world, and I have to sit there with textbooks?”

By “the world,” of course, Ternovskiy means the Internet, which is also where most of his friends are. His closest confidant is a Russian immigrant named Kirill Gura, who lives in Charleston, West Virginia. Every night for the past five years, Ternovskiy has turned on his computer, found Kirill on MSN Messenger, and talked to him until one of them fell asleep. “He’s a real friend,” Ternovskiy says.

Sitting in his carefully engineered workspace—a comfortable chair and two giant monitors placed at the precise distance that Wikipedia says prevents eyestrain and a humped posture—Ternovskiy says that he sees the computer as “one hundred per cent my window into the world.” He doesn’t seek much else. “I always believed that computer might be that thing that I only need, that I only need that thing to survive,” he says. “It might replace everything.”

Chatroulette.com was originally called Head-to-Head.org, and it came online on August 2, 2009. Ternovskiy’s friends didn’t like it, so he advertised on Web forums. Users trickled in, but the site had glitches, and the name seemed off. So on November 16th, having recently watched the Russian-roulette scene in “The Deer Hunter,” Ternovskiy bought the domain name Chatroulette.com, for seven dollars, and revamped the code. The site took off when a Brazilian soccer fan posted a notice inviting kindred spirits to mill around and talk about the sport. Hundreds of them showed up—at their peak, they constituted half of Chatroulette users—but they didn’t talk about soccer; instead, they took off their clothes.

During the next few months, Ternovskiy introduced an array of features, most of which missed the mark: one-on-one chats in “rooms” organized by subject (this was done away with because users kept encountering the same people) and a short-lived bulletin board called Lost & Found, which quickly filled up with men whose hearts had been crushed by the “Next” button and the people who mocked them. There was talk of having a reverse button (for those who regretted a decision to “next”) and of allowing three-way conversations, but the ideas were quickly scrapped for fear of upsetting the already fragile dynamics. After each mistake, Ternovskiy would move on, and traffic would increase. In the past three months, Chatroulette had nearly forty-eight million unique visitors.

When I talked to Ternovskiy in Moscow, he was content to see his success as sheer luck. He had got about ten thousand dollars in investments, mostly from his father, and he was now making fifteen hundred dollars a day in advertising from a Russian dating service called Mamba. He had to use part of that money to pay for fourteen servers in Germany and five programmers in Belarus. He seemed to maintain the same indifferent attitude toward finances that he had demonstrated in his uncle’s store. “I don’t know. I haven’t counted,” he said, once he figured out that I had asked him a question about profit rather than revenue. “It’s not important,” he added, saying that his costs were covered by the advertising. At one point, he seemed to sense that he was making the wrong impression on a Western journalist who he reckoned might be keen to find the next Facebook. So he quickly began to talk of future secret projects and an umbrella company that would encompass all such future secret projects.

Ternovskiy sucked down a glass of fresh-squeezed grapefruit juice and pattered on about happiness and the intersection between virtual reality and real reality. But he was clearly distracted. Earlier that day, he had been approved for an American tourist visa, which had been fast-tracked by a letter from Fred Wilson, who runs Union Square Ventures, one of the largest venture-capital firms in New York.

“I felt like a kid getting a present,” Ternovskiy told me. “I screamed in the street.”

Ternovskiy was already being courted by Yuri Milner, the C.E.O. of Digital Sky Technologies, a Moscow-based Internet investment company that has reportedly acquired a stake of nearly ten per cent in Facebook. But Ternovskiy was not interested. “I am not planning anything with him,” he said, flapping his fingers against his thumb to imitate Milner talking. “I want to meet with American investors.” He was going to the States for three weeks, first to New York, to meet investors, and then to “San Francisco, then maybe California.”

The Ternovskiys are proud of their Russian ethnic background, but they have a complicated relationship with the motherland. Andrey’s great-great-grandfather was a teacher of ancient languages and a representative in the local parliament of Tobolsk, a small city in Siberia. During the Civil War, the advancing Bolsheviks drowned him in an ice hole in a river. Ternovskiy’s grandfather was an engineer who learned to be neutral and obliging toward the state. For his devotion, he ended up in the secret city of Sarov—the Soviet Los Alamos—where he worked on developing nuclear weapons with the physicist (and later dissident) Andrei Sakharov. “We never had much good will toward the Soviet state, I can bear witness to that,” Vladimir Ternovskiy says. But he adds that he also saw no reason to emigrate “just because I don’t like the government.”

Like his grandfather, Andrey Ternovskiy knows when to toe the pro-Russian line; for example, when reporters from state television call. In private, however, he gripes, albeit cautiously, about his country and his countrymen. He doesn’t like his peers’ increasingly anti-Western attitudes, which he says make him “uncomfortable” because most of his virtual friends happen to be in the U.S. He is puzzled by Russia’s hypersensitive self-absorption. He has also been worried about getting drafted into the Russian Army, which has become infamous for hazing so brutal that it kills dozens of draftees every year. As a self-described happy nerd—a word he loves to drop in English—he cringes at the anger and frustration that he sees in his compatriots. When I asked him where he got his optimism, he said, simply, “Dad is happy, Mom is Russian.”

One might think that this would be an ideal time for the Ternovskiy family. “Modernization” has been the buzzword of Dmitry Medvedev’s Presidency, and he has begun a major initiative to turn the Russian economy away from the extraction of natural resources (which now funds nearly two-thirds of the federal budget) and toward one based on innovation and technology. The Kremlin has poured more than five billion dollars into Rusnano, a state corporation meant to modernize Russia through nanotechnology. And, in February, Medvedev, in typically top-down Russian governmental fashion, announced plans to build a high-tech zone inspired by Silicon Valley. Ternovskiy, however, cares little about all these plans. When the Russian media finally caught on to his rise, Ternovskiy found their attention and patriotic questions distasteful. “I don’t want to make it a Russian thing,” he told me. “The whole point is to have no borders.”

Ternovskiy also has reason to be skeptical of the Kremlin’s recent interest in grooming intellectual talent, given the exodus of scientists from the country—by 2002, more than half a million had left—and the pitiful state of Russia’s intelligentsia since the fall of Communism. Andrey’s parents are exactly the kind of people Russia might be cultivating in its modernization drive, yet Vladimir makes only five hundred dollars a month and Elena three hundred. Official talk of modernization and innovation rankles Vladimir, who supplements his income with work for Russian Souvenirs. “It’s demagoguery,” he says. Recently, he sent a project proposal to Rusnano: no response. “These projects don’t interest them. The Internet doesn’t interest them. If I proposed something else, like cutting down some forest in the Far East, that would instantly interest them. There’s no support from the government. It’s completely absent. And Andrey knows that if he stays here no one will support him. The country doesn’t need people like him.”