There should probably be a law—of marketing, of psychology, of thermodynamics—holding that every commercial product, given a long enough tenure on the planet, will eventually end up being sold in a vending machine. Cupcakes. Kale. Crabs. Caviar. Lobster. Beer. Pizza. French fries. Smartphones. Underwear.

And now… pot.

After medicinal marijuana was legalized in Washington state in 2012, dispensaries sprang, almost fully formed, from a previously underground market. In short order—the second law of vendodynamics being what it is—something else sprang up to sell edibles while avoiding the awkward middleman of a human: the vending machine, gone to pot.

This week brings yet more disruption, in the form of a machine in Seattle that cuts even more to the chase: It sells only buds. (Well, buds plus some strategic accessories: vaporizer pens, hemp-oil energy drinks, and the like.) The machine, situated against a wall of the Seattle Caregivers medical marijuana dispensary, was manufactured by the craftily named tech firm American Green, Inc. It is called ZaZZZ. It features, user interface-wise, a touchscreen and little else. It is, obviously, painted green.

Every vending machine is a small miracle of radically efficient design. And every one comes with its unique set of problems and solutions. Machine-sold salads, for example, must be kept fresh. French fries must be served hot and crisp. T-shirts and underwear must be vacuum-packed to volumes that will make them small enough to suit vending machines' particular economies of scale.

For weed, of course, the challenges are even more complicated because of the messy legalities of an industry that has only recently been recognized as an industry in the first place. (The machine’s debut, Reuters notes, “comes as lawmakers in Olympia weigh numerous marijuana-related bills, including a wide-ranging proposal to align the medical and recreational industries by phasing out collective gardens and allowing medical dispensaries to transition to recreational-use shops.”) So, for one thing: How do you supply the machine with product that has been legally obtained? For another, how do you ensure, in the absence of a discerning human, that the person buying the pot is legally able to do so? And how do you accomplish all that in a way that preserves the ease and convenience of a vending machine?

The ZaZZZ starts with its touchscreen, keeping its products—unlike, say, old-school, snack-focused vending machines—hidden from view. The screen isn’t just an ordering interface; it also allows the machine to offer in-depth information, medical and otherwise, about the strains of marijuana being sold under its auspices.

The weed itself, for its part, is obtained from growers based in Washington state. American Green is based in Tempe, Arizona—and federal laws prohibit the shipping of medical marijuana products across state lines.

The most crucial component of the machine, however, from both a legal and a technological point of view, is its ability to match the face of the pot-purchaser with the ID he or she presents as proof of medical eligibility. When buying marijuana, self-service-style, you start by swiping your ID. Then, the ZaZZZ uses a set of cameras—backed up with facial recognition software—to match your face to the ID you’ve presented.

As another precaution, given the highly regulated product being sold, the individual packets of pot each have RFID chips. Which means, as Greg Honan, owner of Herbal Elements, another dispensary that just installed the machine, puts it: “You can really stack inventory in a safe manner in a concentrated area.” And, since the federal government doesn't allow debit or credit cards to be used in marijuana-related transactions, all purchases must be made in cash. (Or in, yep, bitcoin.)

The machine, Stephen Shearin, president of American Green, explains, is "a way to take something that has proven itself as a viable business model throughout the last century, and bring it into the 21st century." Around five ZaZZZ machines, he told Reuters, are currently being planned for locations in Seattle and around Washington state. More are slated for Alaska, California, Colorado, Michigan, and Rhode Island.

So what was the first purchase made from this game-changing marvel of modern technology? A single gram of pot, sold for $15. It was nicknamed "Girl Scout Cookies."