North Korea has developed a nuclear weapons program despite poverty and international sanctions, using home-grown technology and virtually free labor to cut costs, experts said.
South Korean government analysis has put North Korea's nuclear spending at $1.1 billion to $3.2 billion overall, although experts say it is impossible to make an accurate calculation given the secrecy surrounding the program, and estimates vary widely.
However, the weapons that North Korea has tested thus far are comparatively small and based mostly on less sophisticated fission, or atomic bomb, technology.
The isolated North's claim that its fourth and most recent test, conducted last week, was of a more advanced and powerful hydrogen bomb has been widely doubted, although experts said it is possible Pyongyang took the intermediate step of boosting an atomic bomb with hydrogen isotopes.
A former South Korean official involved in nuclear diplomacy with North Korea told Reuters previously that it was likely the North's nuclear program was cutting corners on safety, further driving down costs.
North Korea was at the bottom of a 2011 list on nuclear arms spending by Global Zero, a group campaigning to rid the world of nuclear weapons.
The full cost of Pyongyang's program that year was estimated by the group at $700 million, making it the lowest spender among nuclear states, beneath Pakistan's estimated $2.2 billion, although the analysis was made before the North's two most recent nuclear tests.
By comparison, the United States spent $61.3 billion on nuclear weapons in 2011, according to the report.
Construction of the Yongbyon Nuclear Scientific Research Center, North Korea's main nuclear facility, cost $600-700 million, based on a 2012 estimate, a South Korean defense ministry official told Reuters.
The small reactor at Yongbyon, which began construction in 1979, is based on Soviet-era technology and generates just 5 megawatts of power.
"Actually, what they spend isn't that much," Kim Min-gyu, a former North Korean diplomat who worked at the North Korean embassy in Moscow until defecting in 2009, told Reuters.
"Their workforce works for free and, except for a few key imported parts, they make everything else".
Tax the rich
Paying for those parts is not easy for a country whose official economy was worth just $28.4 billion in 2014, according to South Korea's central bank.
But it has turned to a variety of sources for hard currency in the past, including counterfeiting, insurance scams, selling missile parts to the Middle East, and, more recently, exporting manpower abroad under conditions that human rights groups say resemble indentured servitude.
North Korea also boasts a booming unofficial market economy, driven by private trade that has flourished since the devastating famine of the 1990s, giving the state a relatively new source of foreign currency.
That grey economy has eclipsed the official one, experts said, and generates so much wealth that, after previous nuclear tests, wealthy traders known as "donju", or "masters of money", were arbitrarily and suddenly taxed by the state to pay for the nuclear program, according to one report.
"After the first three nuclear tests, prominent donju were purged on 'anti-socialist' charges and their assets confiscated by the state," a source inside North Korea told the Daily NK, a Seoul-based website staffed by defectors still in touch with contacts inside North Korea.
In addition, North Korea exported more than $1 billion in minerals last year, mostly coal, to China, its main trading partner, according to Reuters calculations based on Chinese export data.
Although heavily sanctioned, North Korea still sells small arms to buyers who turn to Pyongyang because of a lack of viable alternative supplies, according to a recent report by Andrea Berger at the Royal United Services Institute (RUSI) in London.
It also raises $200-300 million a year sending laborers as far afield as Poland and Mongolia to earn cash, said the Database Center for North Korean Human Rights in Seoul.
Kim Min-gyu, the former diplomat, said laborer salaries are usually used to prop up the Pyongyang economy, and not invested in the nuclear program.
"Since money is completely fungible, you can't isolate the transactions that go to pay for bombs from those that pay for apartment buildings in Pyongyang," said Christopher Green, a North Korea expert at Leiden University in the Netherlands.