Bitcoin’s future might come down to David versus Goliath.

Nasdaq, the stock exchange known for its high-tech stocks, and Marc Andreessen, the venture capitalist who co-founded Netscape, could soon be squaring off in a battle to become New York’s first regulated exchange of the digital currency, sources told The Post.

The push to create the exchange comes as the state’s top financial watchdog is close to wrapping up new rules on bitcoin, according to four people familiar with the situation.

The twilight of the rule-writing process — expected now in early July — has started internal discussions at Nasdaq about how to take advantage of the currency’s growing popularity, sources said.

Andreessen, whose venture capital firm was an early investor in tech darlings like Twitter, has reached out to the New York Department of Financial Services about the upcoming rules and what it would take to create an exchange, sources said.

Should Nasdaq officials decide to go forward, they likely will move quickly — exchange officials expect to create a regulated platform for bitcoin buyers and sellers in about a year, one source said.

Nasdaq already has a small foothold in the bitcoin community with its listing of the Winklevoss twins’ bitcoin exchange-traded fund, the first publicly traded ETF of the currency.

The DFS, led by Benjamin Lawsky, put out a call for exchange proposals this March after Mt. Gox, the private, unregulated bitcoin exchange, imploded, losing $400 million in investor assets.

The DFS’ upcoming bitcoin rules, which aren’t final, focus on cybersecurity, licensing and consumer protection requirements, one person said.

Should Nasdaq, which is already familiar with securities rules as a self-regulatory organization, throw its hat into the bitcoin ring, it could rattle the industry, experts said.

“It would provide some serious competition to these startups,” said Marco Santori, a New York City lawyer who chairs the foundation’s regulatory affairs committee.

“The regulations are a moat and they protect incumbents — almost always,” Santori said.

The Treasury Department has been pushing bitcoin operators to adhere to the Bank Secrecy Act of 1970, which requires financial institutions to detect and enforce money-laundering rules, including strict records of cash transactions and reporting of suspicious activity. For most banks, this requires teams of people to watch over and report on transactions.

While the public at large hasn’t totally accepted the cryptocurrency, companies ranging from satellite-TV operator Dish Network to doughnut shops in Austin, Texas, have announced that they will accept payments in bitcoin.

Indeed, bitcoin’s rising popularity has brought with it mountains of regulation that are sure to challenge the existing exchanges, most of which are small and located overseas.

Matt Anderson, a DFS spokesman, and Joseph Christinat, a Nasdaq spokesman, declined to comment. Andreessen declined to comment through a spokeswoman.