One bitcoin now costs more than an ounce of gold.

The digital currency's meteoric rise in 2017 continued this week, with prices hitting above $1,290 per unit on Friday. An ounce of gold, meanwhile, could be had for $1,228.

A number of factors have been driving the convergence of the two commodities.

Gold prices were driven lower this week after William Dudley, the president of Federal Reserve Bank of New York, told CNNMoney that U.S. interest rates could be hiked in the "near future."

Low rates have helped gold because investors had little reason to own U.S. bonds that yield next to nothing. If the Fed boosts rates, bonds become more attractive.

Meanwhile, high demand for bitcoin has continued to drive prices higher.

Gold and bitcoin appeal to some investors as perceived "safe havens" that might provide security in times of turmoil. But they also have some major differences: The precious metal is a physical asset that has been sought after for hundreds of years. Bitcoin, meanwhile, appeared on the scene in 2009 and is entirely ephemeral.

Charles Hayter, CEO of digital currency comparison website CryptoCompare, said there's no direct correlation between their price.

"The truth is that bitcoin is its own asset class in its own right and does fare well in times of uncertainty," he said.

Related: What is bitcoin?

Bitcoin can be extremely volatile: Its value fell more than 30% earlier this year after authorities in China -- where the bulk of trading takes place -- stepped up scrutiny of bitcoin exchanges.

Hayter said the controversy has since receded.

"The issue where the [Chinese central bank] was reining in Chinese bitcoin exchanges has now been brushed under the carpet," Hayter said. "Moves to regulate bitcoin more stringently will bring short term woes but will ultimately strengthen the ecosystem."

Bitcoin is preferred by some people for its perceived anonymity, and it has also been used for illegal purchases of drugs and other products.