(Bloomberg) — In the future, when you order a coffee at McDonald’s or Starbucks, it could be served in the same cup you used a few months earlier.

That’s the vision behind pilot programs this week that will introduce two types of “smart” reusable cups in independent coffee shops in San Francisco and Palo Alto, California. The models, made mostly from plastic and outfitted with RFID chips or QR codes for tracking, are the fruit of a two-year “moon shot” project known as the NextGen Cup Challenge, which was led by Starbucks Corp. and McDonald’s Corp.

Those two chains alone blow through billions of paper cups a year, and most are coated with a plastic lining that makes them almost impossible to recycle. Eliminating that waste would go a long way toward meeting environmental goals set by each company. The NextGen group also intends to try some new compostable and recyclable single-use cups in Oakland.

The key to leaving a lighter footprint on the planet may not be choosing the perfect material, because there are downsides to any disposable cup, whether paper, aluminum or plastic. Instead, NextGen’s big idea is to make cups durable and create a system in which they would be reused. That means collecting, cleaning, redistributing and digitally tracking them — a process that could keep tabs on rates of reuse and attrition. It could theoretically identify areas where people are buying drinks but not returning cups, perhaps indicating a need for more collection sites nearby.

“This technology for tech-enabled reusable cups didn’t exist five years ago,” said Bridget Croke, managing director at Closed Loop Partners, a recycling-focused private equity firm that coordinated the challenge.

The pilot programs starting at independent coffee shops in California this week are a test for the public as well as for the new cups: Will consumers choose to drop cups at certain collection sites instead of in trash cans?

Two small startups will use this trial to scale up their logistics and get a sense of what it would be like to run a reusable cup system globally.

The model on trial in San Francisco, from the startup Muuse, is printed with a distinct QR code on each cup, which consumers can scan when they pick up and drop off cups. Muuse has been used on college campuses.

The model from a startup called CupClub, which will debut in Palo Alto, was designed by London-based architect Safia Qureshi in 2015. The cups are meant to be easily stacked at bright-yellow drop-off points, scattered throughout the city. Then they will be piled into vans and sent for cleaning. Embedded with RFID tags, the cups can be scanned as they pass near certain points, like the coffee shop counter or a collection site. The startup has been selling the system to corporate offices and says reusing its cups can reduce landfill waste by as much as 40%.

Qureshi said people didn’t like the experience of drinking out of reusable metal cups, so the company settled on recyclable white plastic. “Consumers need a product that isn’t going to be so much of a step change,” she said.