(Courtesy Javier Castano)

Officially, Javier Castaño is a 50-year-old shoeshine guy at a cafe in Malaga, Spain. But in his off hours, he serves as the secret guardian of some of Twitter’s most desirable geographic handles: @canada, @japan, @rome, @madrid — even, for a brief time, @NY.

The story of how Castaño came to own (and later, not own) these high-profile accounts is almost as random and circuitous as Twitter itself. In a former life, the native Asturian was a graphic designer and artist. But when he lost his job during Spain’s economic downturn, he turned to shoeshining — keeping one eye on the Internet, his true interest.

Castaño had a Facebook in October 2006, only days after the social network opened to the public. When Barack Obama got a Twitter account, on March 7, 2007, Castaño immediately registered his own, too — even though Twitter was a ghost town, and wouldn’t go mainstream for several years.

Looking around that early, empty Twitter landscape, Castaño realized that many of Spain’s largest cities, not to mention several foreign cities and countries, hadn’t claimed their handles yet. Convinced that Twitter would one day be big, and that these places would need their named handles to communicate with citizens, Castaño snapped them all up.

… and then began the long, tiring, indeterminable quest of giving them all back.

See, Castaño isn’t your standard Twitter-handle squatter — one of these obnoxious ne’er-do-wells who nabs big-name accounts just to hold them for ransom or turn them to cheap tourism marketing. Because Twitter allows the first person at an account to claim it (except in case of trademarked names), the site enjoys a thriving underground trade in this type of handle trafficking. A third of all U.S. state names are owned by a travel deal Web site. There have been very public custody battles over usernames like @CNNbrk and @Chase, for Chase Bank. And in 2010, one of Castaño’s countrymen, Israel Meléndez, made a reported six figures selling @israel to that country’s government.

But Castaño insists he doesn’t play that game — he only registered the accounts to prevent squatters from grabbing them.

“All the content of Twitter.com belongs to Twitter’s owners,” Castaño explained in a tweet. “Who am I to sell little bits of the domain to anyone?”

Instead, Castaño has spent years trying to return accounts like @RiodeJaneiro and @Canada to the government organizations that would best use them. Around Christmas in 2009, Castaño approached the embassies of several foreign countries, including Japan, Canada and Italy. It was still two years before Twitter’s mainstream breakthrough, though. They had no idea what he was talking about.

So Castaño began writing letters to government officials, and later, when those officials began to sign up to Twitter themselves, to tweet at them directly, offering the accounts. Occasionally he’d hear from marketers or mysterious “communications staffers,” claiming some vague connection to a foreign government. But Castaño was meticulous.

“There were some attempts to pose as institutions in order to get an account, but I was pretty cautious,” he said. “I waited patiently, and until I was completely sure I was talking to the right person, I didn’t give any passwords.”

In 2012, he entrusted @Andalucia to the local government there. (They still haven’t tweeted, to his distress.) He also made contact with Martha McLean, who handled e-communications for Canada’s Foreign Affairs Department, and passed that account to her. @Canada’s stereotypical first tweet went out after a long planning period in November 2014.

By then, Castaño had also given @Malaga, @Madrid and @Rome to their rightful owners. @NY had been hacked and stolen from him years prior — the fault, he says, of “weak passwords.”

He began a complicated verification process with Rio de Janiero’s city government, which had been operating a tourism account under the (pretty lame) handle @rioguiaoficial. Once the city’s official Twitter account publicly approved the transfer on Feb. 5, Castaño sent over its password via DM. In a statement to the Guardian, Rio’s tourism secretary said it would “be of great value” to the city — a sentiment repeated in one of the account’s first tweets.

“Today @Canada belongs to the Canadians, @RiodeJaniero belongs to the Brazilians, Rome belongs to the Romans,” a satisfied Castaño said. “Only Japan remains; for the Japanese.”

I asked Castaño what he plans to do once @japan has been claimed; it will, after all, represent the end of a project he’s labored at for years. He will probably still shine shoes Café Central. He jokes that he’ll “flirt from behind his glasses” — like a retiree with nothing else to do.

In all seriousness, though, he does still have his own Twitter handle, @xabel, from which he continues tweeting at the Japanese government, the Japanese Embassy in Spain, the diplomat Noriyuki Shikata … and anyone else who will listen.

“I hope that the Japanese authorities will contact you,” a fan tweeted at him this morning.

“Thanks,” Castaño fired back. “It looks like it will soon be possible.” Two smilies.