Alejandro Avila, the 30-year-old Mexican cofounder of Espiral, a mobile wallet service that he describes as “Square meets Stripe,” is on the edge of something big. Mexicans carry more than 100 million mobile phones and only 15 percent use credit cards, making financial tech a lucrative nascent market.

Yet Avila—whose family left Mexico in the 1990s only to return a decade later—faces a dangerous caveat to success.

Espiral is based in Guadalajara, a place locals call the Silicon Valley of Mexico. With startups galore, and deep-pocketed multinationals like Intel, HP, and Oracle all tapping the relatively affordable engineers, this city is home to tech innovation.

But what the guidebooks don’t tell you is that this place is also home to very real terror. Three police officers were killed in a rich suburb here in February—in broad daylight—days before I met Avila. Last year, buses were set on fire in downtown Guadalajara, blocking traffic and allowing cartel leaders to escape police. Last May, members of that same cartel used a rocket-propelled grenade to shoot a military helicopter out of the sky.

Indeed, the drug-related violence in Mexico is leading Avila and other entrepreneurs to consider tough questions. “I think everyone in Mexico asks, ‘What happens if I’m successful?’” he says.

Avila has a green card in the United States. He frequently travels to Los Angeles to visit his cofounder and cousin Francisco Diaz-Mitoma, who lives in Santa Monica, and was named to the Forbes 30 Under 30 list in 2012; and Jason Kline, a third partner.

With glasses and a thick beard, he resembles his U.S.-based partners in manner and speak. His English is flawless. He resettled in Riverside, California, at the age of two, and returned to Mexico at 13. Upon returning, Avila studied civil engineering at the prestigious Western Institute of Technology and Higher Education, calling himself a lifelong geek.

But what Avila faces that his Yankee brethren don’t is the nagging question of whether the place he works is truly secure—and Avila calls Guadalajara safe by Mexican standards.

Espiral has 650 clients in Mexico, and is already profitable. But it may soon become extremely profitable since Avila recently signed deals to handle all mobile transactions for the city of Tijuana, and the Caliente Group, which owns the soccer club Xolos. Espiral will allow visitors at stadiums to order food, drinks, and merchandise from their seats. And the Tijuana venture includes in-app payment processing, plus pre-installing Espiral into more than 800 tablets and readers in all of the city’s mobile payment venues. Espiral takes a cut from each purchase.

The idea for Espiral came when Avila, Diaz-Mitoma, and Kline were vacationing in Sayulita, a hippie beach town adjacent to Puerto Vallarta. It was Christmas 2012, and the then-twentysomethings needed cash. Bars and restaurants wouldn’t take credit cards, and local ATMs “would charge $8 to $15 just for withdrawing, and there was a limit to $100 a day. That’s when we started brainstorming.”

The trio tapped one of Avila’s cousins for an angel round and Espiral was born. “We got a couple coders from India, which led to a second round, and another $35,000 from a private group.”

Kline, who has an MBA from Pepperdine, handled financials, and Diaz-Mitoma and Avila focused on business development. But Avila was the only one in Mexico—challenging from both a communications and day-to-day level. Feeling the stress, and solitude, he hired a full-time developer in 2014. Days would turn to nights and they’d still be working. And that’s when things really started moving, he says.

Around that time, Avila landed his first major client after a one-hour meeting with Banorte, Mexico’s third-largest bank, turned into a four-hour marathon. At the end of the interview, Banorte signed on as a partner. Now Espiral had a banking system to facilitate transactions. With a legitimate financial institution’s support, Espiral gained immediate credibility.

Avila then entered and won Naranya, a startup competition in Monterrey, which led to another $40,000 in funding and free office space in an accelerator shared by Google staffers. This co-working atmosphere helped him bounce ideas off of other entrepreneurs, many of whom were from Argentina, Brazil, and Chile, places that felt many of the same financial woes as Mexicans.

Alejandro Avila

A year and a half later, Avila’s team has swelled to 15, and he’s now working with three large banks, and expanding beyond card processing. The next big play is remittances, which Avila says would allow locals to bypass their banks and use Espiral without paying transaction fees.

“We’re going to try to compete with Google Wallet and Apple Pay with direct partnerships with the banks we work with,” he says.

And with the city of Tijuana as a client, Avila says he doesn’t see himself going back to the U.S. anytime soon. Despite the potential for danger, he says, “I’m more comfortable in Mexico.” Someone has to be on the ground for meetings and management, he adds.

Yet when pressed, Avila admits to worrying about security, casually mentioning last year’s narco blockades, and a recent clash pitting Uber and taxi drivers, which shut down the city for hours. And he gets more serious when he mentions that danger has hit close.

Last year, Avila’s grandmother and aunt had secured a loan with Banamex, a bank owned by Citigroup. They wanted to pay off a $25,000 debt, and got a loan for $30,000. But after they got the money and drove home, gunmen ambushed them and stole the funds. “Now they owe $55,000.”

Like most entrepreneurs, no matter where they are, Avila’s chasing a dream. A chase that may make him grab a tiger by its tail. But if that leads to the wealth every founder dreams of, what choice is there but to keep tugging?

Update: An earlier version of this story incorrectly reported the Avila attended the Monterrey Institute of Technology. He attended the Western Institute of Technology and Higher Education.