In Zug, a tiny Swiss town 20 miles south of Zürich with million-dollar Alpine views, a small machine is doing big things. One of the 10 bitcoin ATMs installed across Switzerland by Zug-based Bitcoin Suisse, the machine accepts Swiss francs and euros in exchange for a slip of paper with a code that represents the equivalent amount in bitcoin. Scan the code with your smartphone, and the currency is yours.

The ATM isn’t really necessary. Bitcoin has no physical form. Instead, it is made up of lines of computer code conceived in 2009 by a coder working under the pseudonym Satoshi Nakamoto. For those who wish to purchase the digital currency but find the prospect of the transaction difficult to conceptualize without physical proof, the ATM provides a helpful bridge.

A bitcoin ATM might seem unconventional, but it makes sense in Zug. The town of 30,000 has persistently attracted entrepreneurs who specialize in digital currency, and by 2014 it became known in the financial world as Crypto Valley. One of the first to arrive was South African Johann Gevers, who came in 2012. His business, Monetas, offers a digital system through which any currency, including bitcoin, can be transferred worldwide at very low cost. Monetas was soon joined by other cryptocurrency startups, which now number around 20, including Ethereum, minter of a bitcoin rival currency called ether.

These businesses — first drawn to Switzerland’s political stability and Zug’s smooth bureaucracy — have found a country open to their unorthodox ideas about currency. Bitcoin allows users to make anonymous payments without relying on a central authority, like a bank or credit card company. It has quickly become popular with a small group of technologically minded enthusiasts with a libertarian bent, who see it as a way to get around authoritative national institutions and governments. “What we’re trying to do is decentralize the financial system,” says Gevers. “Switzerland has the most decentralized political system in the world, so they understand what we’re doing and don’t see it as a threat but an opportunity.”

Before bitcoin emerged, Switzerland had been looking for ways to remain relevant in the banking sector ever since the U.S. began to crack down on offshore accounts after the global financial crisis. In 2009, the Department of Justice and the Internal Revenue Service hit UBS and Credit Suisse with hundreds of millions of dollars in fines for encouraging tax evasion and forced them and other banks to reveal the names of their tax-shy American depositors. This essentially ended Switzerland’s lucrative business as a tax haven.

With the amount of money sloshing through it, and global investment in its technology reaching $1.4 billion in 2016, bitcoin offers the finance-friendly country a promising new market. To position itself as a cryptocurrency hub, Switzerland has tried to write regulations that will allow cryptocurrency companies to thrive—a process other governments are still struggling with as they weigh the costs and benefits of this evolving technology.

It’s a tricky business for regulators. Bitcoin’s ability to protect the identity of its users has made it a useful tool for illicit transactions on websites like the now-defunct Silk Road, a sort of eBay for drugs, unlicensed firearms and other illegal activities.

“Every time you have an emerging technology that is yet to be properly regulated, there is an opportunity for nefarious uses or a way to get around existing laws or sanctions,” says Emin Gun Sirer, an associate professor at Cornell University’s Computer Science Department. In China, for instance, bitcoin is used to move money overseas, which gets around the $50,000 yearly limit set by the government.

There is also the problem of safety. The technology used in some of the currency’s exchanges isn’t perfectly secure. One of the biggest bitcoin exchanges, Mt. Gox, shut down in 2014 after 850,000 coins were stolen from its digital vaults. “The science of it is still evolving,” Gun Sirer says. “There will be some fantastic failures in this field.”

These are pressing issues everywhere. Although the U.K. signaled its openness to the cryptocurrency economy in 2015 by allocating $12.9 million to a research initiative to study bitcoin and other digital currencies, crypto-asset companies still do not know how they will be regulated—creating uncertainty and holding back innovation.

The U.S. still takes a dim view of those minting their own currency and classifies bitcoin as a commodity, which makes its day-to-day use cumbersome. In the past few years, the Financial Crimes Enforcement Network and the IRS have introduced piecemeal regulation, but the rules are complex and still evolving.

“It is still a really new and fast-moving space, and innovation comes before regulation,” says Chris Burniske, an independent U.S. analyst specializing in cryptocurrencies. “A lot of companies are paranoid around the regulatory situation in the U.S., as they might be fined or shut down.”

Industry insiders say Switzerland is one of the few nations moving in the right direction. In Zug, the local government is allowing citizens to pay for services, like registering their residency, in bitcoin. At the national level, the Swiss government has been working closely with financial technology companies to create a special license that would allow businesses to hold cryptocurrencies for their customers without having to apply for a costly banking license.

Such openness gives Switzerland an edge in a business that has considerable potential to grow. “We are a small, open economy in a globalized world, so it’s very important to have innovation, to keep our good position in terms of competitiveness,” says Anne Césard of the State Secretariat for International Financial Matters, which represents Switzerland's interests in financial, monetary and tax matters. “That’s why, from a government perspective, we don’t want to prevent development by regulatory burdens, which could slow down progress.”

For cryptocurrency enterprises, it is a breakthrough. “And not just for Switzerland but for the whole cryptocurrency industry worldwide,” says Olga Feldmeier, a Zug-based cryptocurrency entrepreneur who was instrumental in ironing out the new license. “Because here is a country that is looking into the business model and making informed decisions about how this new industry should be properly regulated.”

While lawmakers focus on the status of bitcoin and how to regulate it, the excitement within the industry has moved to uses for bitcoin technology beyond making payments. To keep order, every bitcoin transaction is encrypted and recorded in a database called a blockchain. Think of it as a type of public ledger — when someone uses bitcoins to buy something, the blockchain records the transaction one after the other in blocks of code, each chained to the other. It is impossible for hackers to falsify the record because the database is updated across the entire network of computers running the bitcoin software, thus creating a public record of what everybody in the system owns.

This technology has lots of potential uses beyond banking. It’s now possible to use the blockchain as a database that keeps all kinds of records in a secure and easily accessible place without laborious, paper-heavy processes. For example, IBM is helping Maersk, a Danish shipping company, use the technology to cut down on the number of people required to track millions of shipping containers around the world. According to the shipping giant, a container making its way from East Africa to Europe could require stamps and approvals from as many as 30 people, and it could go through more than 200 interactions by the time it reaches its destination. By using blockchain, Maersk could get rid of the paperwork and speed up the process, saving the company millions of dollars.

“If you think about the amount of effort and time record-keeping takes up, it’s actually a huge deal for businesses,” says Karim Lakhani, a professor of business administration at Harvard Business School. “That’s why there is so much hype around it.”

Meanwhile, more than 90 banks worldwide, including HSBC and Deutsche Bank, are exploring the potential of blockchain. Santander InnoVentures, a venture capital fund, estimates that this new technology could save banks up to $20 billion a year by 2022, by making transactions and bookkeeping faster and more streamlined. “Many jobs, especially in finance, are repetitive and not very stimulating, and blockchain will help us create systems that are automated,” says Feldmeier, the Zug-based cryptocurrency entrepreneur. “So in the future, people will have more time to work more creatively — or just go skiing more.”

The expanding uses of the technology create more reasons for governments to figure out how to make it safe and reliable. “If we are going to automate so many of our transactions, do we trust that the system will always work?” asks Lakhani. “As much as these systems unleash a whole bunch of benefits, they unleash a whole host of vulnerabilities too.”

That worry feels distant in Zug, where blockchain enthusiasts believe it will change our lives in ways that are impossible to imagine, much like the internet. “All these new ways to use this technology don't exist yet, so we have to create them,” Feldmeier says. “But the hurdles are big, so we have to overcome them together. In Zug we’ve created a community and have made ourselves heard.”

Slowly, it seems, big entities outside this small town are listening.