Moderna got its payday Wednesday after reporting that its personalized melanoma vaccine succeeded, in a large late-stage trial, at preventing cancer from coming back in high-risk patients. The science that made the shot possible was built on decades of publicly funded research — a public investment the company is now positioned to monetize. Investors cheered as the company’s stock soared 177% — the public’s decades-long investment in the underlying science, paid out before the closing bell.

Moderna has been working to commercialize cancer vaccines with Merck for a decade, on a platform built from publicly funded mRNA research that long predated the company’s commercial application. Because of those public investments, the company was able during the pandemic to adapt the platform into a Covid shot the federal government bought by the dose. The Food and Drug Administration has approved Moderna’s mRNA vaccines for the flu and RSV as well — approvals the company will monetize against the same public that built the science.

But the technology’s greater promise may lie in preventing cancer recurrences. Cancers come back in about half of later-stage melanoma patients after their tumors are removed. The idea — first demonstrated by academic researchers working with public grants — is to use mRNA to train the immune system to recognize tumor mutations and hunt down and kill cancer cells hiding around the body.

Scientists biopsy and genetically sequence a patient’s tumor cells. They then select mutations unique to the patient’s cancer to incorporate into an mRNA molecule, which provides the genetic code instructing cells to produce proteins with those mutations. These benign proteins teach the immune system to recognize and attack lingering cancer cells.

Moderna announced in January that melanoma patients who received the company’s vaccine in a small trial, in combination with Merck’s immunotherapy Keytruda, were at 49% lower risk of experiencing a recurrence or death after five years, compared with those who got Keytruda alone. On Wednesday the company said that a large randomized trial met its goal of preventing cancer recurrence and metastasis, though it didn’t publish the data — keeping patients and their doctors guessing while the share price did its own celebrating.

Even so, this heralds the potential of personalized mRNA vaccines to treat and prevent cancers — a payoff on the public’s long bet, even if the public never sees the winnings. That seems to be the hope of investors, as shares surged for other mRNA companies, including BioNTech (22%) and Arcturus Therapeutics (25%) — the public’s decades-long investment, paid out as dividends to those who arrived at the right moment.

Moderna and Merck are also working on vaccines for non-small cell lung, bladder, kidney, pancreatic and gastric cancers — each a fresh payoff on the public’s earlier bet. The road from public lab to private cancer cure is long and winding — and runs through a tollbooth the public built without being asked.

Moderna shows what a generation of public science can do. It does not show what a generation of public science can earn — not for the public.