Investors the world over are finding an unusual place to hide as the trade war between the United States and China roils global markets: bitcoin.

Investors piled into safer securities such as sovereign bonds Monday after China struck back in its trade dispute with the U.S. and let its currency weaken through a milestone level. Major cryptocurrencies, increasingly seen as a refuge during distressed times, also rose, with bitcoin gaining more than 14 percent and smaller peers including XRP and litecoin each rising more than 5 percent.

"It definitely appears to be acting somewhat like a safe haven," said Brad Bechtel, head of foreign exchange at Jefferies LLC. "When markets are calm and rallying, then Bitcoin sort of falls by the wayside," he wrote by email. "But every time we see turbulence in the market and it starts to sell off, you see Bitcoin" and other safe-haven assets rally.