If you dropped by Starbucks (sbux) for a free cup of coffee on National Coffee Day, you would instead have been greeted by signs about the company’s supply chain, ethical sourcing commitments, and support for coffee farmers. (Starbucks didn’t dole out goodies this year; for free joe, better head to Dunkin’ Donuts, Krispy Kreme, Cinnabon, Tim Horton’s, or another participating coffee shop.)
Rather than being handed freebies, customers were invited to pause and consider the global economy of the caffeinated bean, one of the world’s most valuable agricultural products from the tropics.
Most of the world’s coffee is grown by small farmers, many of whom depend on family labor and unreliable income—often less than $2 a day, the World Bank says. In fact, 25 million of these farmers produce an astounding four-fifth’s of the world’s total coffee supply, according to the UK non-profit Fairtrade Foundation.
Now there’s a tech startup that wants to change the economics. Bext360, a year-old Denver-based company, is applying technology, like robots, mobile apps, and blockchains—the shared accounting ledger technology that paved the way for Bitcoin’s rise—in order to, as it says, “improve the upstream supply chains of key commodities,” starting with coffee.
It works like this. The firm builds big, sensor-laden machines to sort, weigh, and assess the quality of each coffee cherry plucked on a plantation. The devices analyze and grade the fruit based on its condition (riper, larger cherries generally fetch a higher price). The resulting data—weight, grade, and other specs—are made visible to buyers who then bid on the beans.
“We’re trying to provide more and more data at the farm level to make it more like the wine industry,” says Daniel Jones, CEO of Bext360. He wants farmers to get paid “not only on quantity but on quality of yield,” he says.
“People are willing to pay more for good coffee,” Jones notes.
All of this coffee information—from provenance to purchasers to payouts—are recorded on a blockchain in Bext’s system. The ledger is designed to help keep down overhead costs—replacing paper carbon copies and other inefficient record-keeping methods—while making the financials easier to audit.
If one batch of beans ends up producing a superior, specialty coffee, farmers can potentially get compensated for it.
The blockchain that Bext360 is using was built by Stellar, a financial tech venture founded by Jed McCaleb, an entrepreneur whose previous crypto projects have included the ill-fated Mt. Gox Bitcoin exchange (he sold it years before the multimillion dollar hack) and the inter-bank cryptocurrency network Ripple.
By tying coffee to crypto tokens minted on Stellar, Bext360 says it is able to conduct cheap, instant cross-border trades, an important advantage for such a global industry.
“There are a lot of these stages in the process and the original farmer doesn’t capture the additional value added to the beans,” McCaleb tells Fortune, describing traditional coffee commerce. With Bext360, he says, “farmers can get a higher value for higher quality coffee beans, rather than one fixed bulk price.”
Bext360 intends to host an “initial coin offering,” or ICO, a controversial crypto-based funding mechanism for its “coffee tokens” in December or January, Jones says. The company has so far tested its machines in California this summer and it plans to set up a trial in Uganda in October.
Eventually, Jones hopes to use the blockchain to close the loop between cultivators and consumers. “We envision providing people with a link to see the origins of their coffee and the ability to tip the farmer—that’s the ultimate goal,” he says.
Get Data Sheet, Fortune’s technology newsletter
For Bext360, coffee isn’t a bad place to start, since demand for the stuff has been shooting through the roof in recent years. Coffee is globally consumed by the shipping container-full—with a record 158 million bags projected to be ingested this year, according to the United States Department of Agriculture.
Other companies are interested in applying blockchains to food supply giants too. Big companies like Walmart, Dole, Unilever are exploring how to use blockchain in partnership with IBM to better trace goods, like mangoes and pork chops, from farms to store shelves.
Time will tell if Bext’s coffee chain will catch on. That’s something to ponder on your next Starbucks visit, while waiting for your morning jolt.
This article is part of Fortune’s new initiative, The Ledger, a trusted news source at the intersection of tech and finance. Click here for more on The Ledger.