In December of 2016, Frank Yiannis, Walmart’s vice president of food safety, brought a container of Walmart mangoes to the office and asked his team to find out where they came from.

Six days, 18 hours, and 26 minutes later, they had an answer.

Six days to track produce from shelf to stalk is a tough time frame to swallow; in the context of a recall or foodborne illness, it’s excruciating. In some cases, it’s faster to get your blood tested than it is to find verify if your orange is organic. And yet, six days is better than the several weeks many retailers currently require to track produce—navigating a nexus of distributors, packers, brokers, and farmers who communicate through different databases and systems.

This Pan’s Labyrinth of produce tracking stems from the fact that the produce retail chain is a naturally decentralized process. Fruits and vegetables travel from networks of suppliers in different regions, working through distributors and brokers to meet certain classifications—local, organic, natural, or others. Decentralization allows independent farms to compete with national growers and enables international growers to step in when a region’s seasons change.

But for retailers, the abundance and flexibility offered by decentralized produce creates a logistical nightmare for tracking and quality assurance, whether recalling contaminated goods or verifying organic labels. The longer that products travel from stalk to shelf, the greater the room for error or fraud. In one case from early 2017, a 36 million pound shipment of soybeans traveled from Ukraine to Turkey to California; along the way, they were re-labeled as organic, increasing the shipment’s value by $4 million—creating windfall for one company in the supply chain and a gross overpayment for retailers and consumers.

What’s a fruit aisle to do? Driven by internal pressure and consumer demand for transparency, retailers have started to pilot products such as QR codes or interactive labels that retrieve all the data that a store has about each product. But codes and labels are interface, rather than systemic solves—they only work if a retailer already has all the information about a product correctly tagged and linked. Even if a tomato has an interactive label, different handlers each use their own tagging databases and sensors to track each stage of the fruit’s journey, making that label burdensome for a retailer to accurately code. Here lies the delicate but paramount challenge for the retailer: bringing all parts of the tomato chain together, without compromising each player’s proprietary data and systems.

Enter the blockchain, a decentralized management system that can aggregate and verify data from all parts of the supply chain. Think of a private blockchain as an independently-managed spreadsheet; each party can opt in to have their information and trades recorded and authorized, creating an impartial ledger. No one can make a change to the ledger without all others seeing, curtailing mislabeling or fraud. By automating authorization and oversight, blockchains deliver immediate data to retailers and consumers while only sharing necessary information—quality checks, organic verifications, international tracking—without disclosing a company’s secrets. It’s anonymous, (presumably) un-hackable, and a lot faster than 6 days.

What’s blockchain’s impact, step-by-step along the produce chain?

Farmers
According to Forbes, produce farmers generally sit on 20% unused land capacity, and they routinely compost about 10% of their output at peak season. Blockchain improves a farm’s sales position by stamping products for quality and offering tracebacks—affording higher prices at market, deterring fraudulent competitors, and creating a channel for smaller farms to gain business from large distributors and retailers.

Distributors
Distributors hold the highest-pressure role in the supply chain: retailers and consumers demand more local produce, but distributors are constrained by local farms’ ability to consistently supply them. Blockchain gives distributors the capacity to bring more verified local farms into their portfolio—while automating info gathering for the end consumer.

Processors
Processors are expected to communicate not only the origin of their ingredients, but also the steps they take to prepare and package the final ingredient. Blockchain is an internal, as well as external solution for processors looking to streamline their own manufacturing while offering more transparency to the eater. Blockchain’s decentralized encryption allows processors like Campbell’s to verify product claims (hormone-free, organic ingredients) without exposing company secrets.

Retailers
Having traveled the supply chain, fully tracked produce is easier for a retailer or grocer to accurately price and promote. As grocers compete with Amazon, Instacart and other delivery servixes, blockchain also supports inventory tracking for delivery and fulfillment.

Beyond marketing and delivery, blockchain’s greatest strength lies in quality assurance and damage control. Remember those 6 days of mango tracking? Having piloted several blockchain studies, Walmart is working to clock in produce recall at under 3 seconds.

Restaurants
Though not a direct step of the retail chain, restaurants too reap benefits from distributed ledgers. All a restaurant’s ingredients can be registered and track for full farm-t0-table transparency and greater oversight when preparing dishes for customers with allergies or intolerances.