The ride-hailing service Uber once described itself as a “fun and social new way to help people in your community.” Its competitor Lyft encouraged users not to shake hands but to fist-bump their drivers. Airbnb, meanwhile, bragged that the service gave elderly hosts a “renewed sense of purpose,” not to mention “unforgettable memories.”

Friendliness was supposed to be a feature of the new sharing economy. To enforce good behavior, most of these peer-to-peer services ask users to create profiles, upload pictures of themselves and rate each other after every transaction. This vision for the future — capitalism with a personal connection — has always felt slightly dystopian, as well as just a touch naive about human nature.

Now it is becoming clear, as several recent studies have shown, that these sharing services can easily turn into platforms for expressions of racial bias.

The latest discovery came from researchers at MIT, Stanford and the University of Washington who found that black users often have to wait longer to get a ride on services such as Uber and Lyft. Black users are also far more likely than white users to get canceled on by Uber drivers.

The study, released Monday by the National Bureau of Economic Research, joins similar papers finding that black people have a harder time renting rooms on Airbnb and selling goods on eBay. These kinds of findings can have legal ramifications. A recent lawsuit sought damages from Airbnb, claiming that the company's website — which emphasizes people's profiles and photos — fosters discrimination.

In response, the companies have taken steps to reduce the possibility of racial bias affecting people who use the services. Before accepting a trip, for example, Uber drivers see only a passenger’s location and star rating. Airbnb has announced a host of measures to reduce racial discrimination on the platform.

In the new Uber study, the ride-sharing researchers conducted experiments this past year in Seattle and Boston, sending trained assistants on hundreds of trips in the cities. Some used names typically associated with African Americans, while others used names typically associated with white Americans. To ensure that all other conditions were fair, the assistants followed identical instructions.

In Seattle, people with black-sounding names waited about 30 percent longer between the time they requested an Uber ride and the time they got picked up — a difference of nearly a minute and a half.

The researchers concluded that Uber drivers were often canceling their trips after finding out that their passenger’s name sounded black. (Only after drivers accept the trip does the app reveal the rider’s first name.) This forced people to wait longer as the system scrambled to find them another driver.

When the experiment was repeated in Boston, the assistants kept track of how often they were canceled on. Black men seemed to encounter the most discrimination. When male riders used black-sounding names such as Rasheed and Darnell, they were about three times as likely to have a driver flake on them. Overall, males with black-sounding names had about 10 percent of their trips canceled.

Most of the cancellations seemed to happen when users were making pickup requests in Boston’s far-out suburbs. This could reflect that suburban Uber drivers are more prejudiced or that Uber drivers in general are unwilling to trek very far to pick up black men.

Despite experiencing more cancellations, riders with black-sounding names in Boston did not have to wait much longer to get an Uber ride. The researchers believe this is because there are more drivers in Boston than in Seattle, so riders can be quickly rerouted if a driver quits on them.

“There’s no way to know if an individual decision by a driver was discriminatory,” said Stephen Zoepf, an author on the paper. “There are plenty of legitimate reasons why any individual Uber driver would cancel a trip. It’s really only in the aggregate that you can see the patterns.”

The researchers also tested a competing ride-hailing service, Lyft. Unlike Uber drivers, Lyft drivers get to see a rider’s name and photo before they accept a trip. They found that Lyft drivers also discriminate but that black riders have to wait less time compared with white riders. But prejudiced drivers can ignore black riders upfront and not go through the process of accepting then canceling a ride.

Representatives from Uber and Lyft said that their companies have strong nondiscrimination guidelines for their drivers.

“Because of Lyft, people living in underserved areas — which taxis have historically neglected — are now able to access convenient, affordable rides,” Lyft spokesman Adrian Durbin said.

Rachel Holt, Uber’s head of North American operations, said in a statement, “We believe Uber is helping reduce transportation inequities across the board, but studies like this one are helpful in thinking about how we can do even more.”

The study’s authors aren’t claiming that Uber or Lyft drivers are any more discriminatory than taxi drivers. In fact, the study also found that taxis in Seattle are less likely to pick up black people. When the white research assistants tried to hail a cab, the cab stopped about 60 percent of the time. When the black research assistants tried to hail a cab, the cab stopped only about 20 percent of the time.

“We’re not starting from a world of perfect equity,” said Don MacKenzie, one of the authors of the report.

A simple solution would be to remove names and photos from the system altogether. MacKenzie suggests using code words instead so drivers and passengers can confirm each other’s identities. But even that kind of system could have unintended consequences; if they can’t pick and chose their riders, biased drivers might start to avoid minority neighborhoods altogether.

The study raises questions about a company’s responsibilities to stop illegal discrimination, especially in the age of big data, when we can see some of these problems more clearly. After it was revealed that black people had trouble finding rooms on Airbnb, the company created a full-time engineering team to “root out bias.”

Uber and Lyft could do something similar. The companies do not appear to collect racial information at the moment, but they could use computers to infer people's ethnicities, then warn drivers who seem to be rejecting a lot of minority riders.

“There's a lot more information available now — the new technology has the capacity to greatly eliminate the amount of discrimination,” said Christopher Knittel, a co-author on the paper. “It’s up to the companies here, in terms of how they design their services.”