When dozens of people across the country got sick from eating contaminated romaine lettuce this spring, Walmart did what many grocers would do: It cleared every shred off its shelves, just to be safe.

Walmart says it now has a better system for pinpointing which batches of leafy green vegetables might be contaminated. After a two-year pilot project, the retailer announced on Monday that it would be using a blockchain, the type of database technology behind Bitcoin, to keep track of every bag of spinach and head of lettuce.

By this time next year, more than 100 farms that supply Walmart with leafy green vegetables will be required to input detailed information about their food into a blockchain database developed by I.B.M. for Walmart and several other retailers exploring similar moves.

The burgeoning blockchain industry has generated a great deal of buzz, investment and experimentation. Central banks are exploring whether it would be good for tracking money flows. Eastman Kodak has explored a blockchain platform that could help photographers manage their collections and record ownership of their work, while a group of reporters and investors are using the technology to start a series of news publications.