A two-hour drive from the tech-fueled riches of San Francisco, Stockton, Calif., is a completely different world from its Silicon Valley neighbor. But the small city is taking a big bet to try to fix its lagging economy with a strategy that many of the tech elite have been largely only pontificating about: universal basic income, or cash handouts.

Four years later, Stockton is still very much struggling. The median household income there is $44,797, well below California's median household income of $61,818, according to a statement from the city's 27-year-old mayor, Michael Tubbs. Stockton's unemployment rate is 7.3 percent, close to double the 4.3 percent national average. One in four residents live below the poverty line and 18 percent of Stocktonian residents experience food insecurity.

Mayor Tubbs sees universal basic income as a possible way to alleviate some of the pains of poverty the city is experiencing.

Mayor Michael Tubbs, Photo by Kevin Richtik - Caroline photography

Tubbs, who was born and raised in Stockton and first elected to city council at 22, read about the idea of a guaranteed basic income in Dr. Martin Luther King, Jr.'s last book, "Where Do We Go From Here: Chaos or Community?" In the book, King writes: "I'm now convinced that the simplest approach will prove to be the most effective — the solution to poverty is to abolish it directly by a now widely discussed measure: the guaranteed income."

Called the Stockton Economic Empowerment Demonstration (SEED), Tubbs and the city of Stockton announced their initiative Wednesday. In the coming six to nine months, SEED will go through a design period where the city will work with social scientists and community leaders to determine, among other things, the number of residents who will be part of the initial test phase of the program and how to select participants.

Checks of $500 per month are expected to start being distributed to Stocktonians in the second half of 2018. The goal is to grow the program as the city can afford to do so.

Stockton's SEED program is being funded initially with a $1 million grant from the Economic Security Project. It's also accepting crowdfunded donations to the project with a Crowdrise campaign. The Economic Security Project is an organization aiming to raising awareness of universal basic income in the United States and is co-chaired by future of work expert Natalie Foster, Facebook co-founder Chris Hughes and scholar and leader Dorian T. Warren.

When the Economic Security Project reached out to Tubbs to talk about universal basic income as a possible poverty alleviation tool for Stockton, he had already been thinking about it.

"A few months ago I called Mayor Michael Tubbs, the charismatic young mayor of Stockton, CA, to hear his thoughts about the universal basic income, an idea that my colleagues at the Economic Security Project and I were exploring," writes Foster in a Medium post.

"It turned out he was a step ahead of me. He told me that he'd been tracking the conversation...."

For the Economic Security Project, the pilot program will provide information about how a universal basic income can work in the United States. "Our goal in providing this grant is to explore and learn from the impact of these cash transfers — and the economic security they provide — in the lives of Stockton residents," says Foster. "At this point in our journey, we believe unconditional cash has the power to end systemic poverty and rebuild the middle class."

Stockton is not the only universal basic income program underway in the United States. Silicon Valley start-up accelerator Y Combinator has initiated a long-term study of universal basic income. Y Combinator's research arm has piloted a program in Oakland, Calif., and is preparing for a larger program which will involve 3,000 individuals: 1,000 will receive $1,000 per month for up to five years, while 2,000 will receive $50 a month as a control group.

"Eliminating poverty is such a moral imperative and something that I believe in so strongly," Y Combinator president Sam Altman has told CNBC Make It. "I think about the amount of human potential that is being wasted by people that are not doing what they want to do. I think about how great it would be to undo that. And that's really powerful to me."

For its part, Stockton hopes to prove that a given a chance, its residents will thrive.

"Stockton is in many ways a microcosm of the United States: in recent years, major shifts in our economy, persistent wage stagnation, and rising inequality have made it increasingly difficult for hardworking residents to make ends meet," the SEED website says.

"We believe this initiative will highlight the resiliency and grit of our people. And it will show the nation and the world that ours is a community of hardworking, determined individuals who can forge ahead if only given the opportunity."