MOSCOW—The only North Korean restaurant in Moscow is in a basement, and the staff doesn’t like to answer questions, or be asked them. When a group of North Korean officials entered, they went straight away to the VIP area at Koryo Phenyan, as the eatery is called. Eventually, reluctantly the waitresses confirmed that the place is owned by Pyongyang’s embassy.

Meanwhile the flatscreen TV on the wall showed North Korean military commanders, national dancers, singers, and from time to time the square face of “dear,” “brilliant,” “wise” leader Kim Jong Un.

Occasionally, one finds Russian and North Korean officials drinking together here in Moscow, but independent experts have few illusions about Kim Jong Un. He is “very capricious, wayward and ready to kill easily,” Andrei Lankov, a Russian specialist in Korean studies, wrote succinctly in one recent analysis.

Even so, in the showdown building between Washington and Pyongyang, Moscow hopes it can carve out an important role as a go-between, perhaps currying favor with all sides. Russian Deputy Foreign Minister Sergei Ryabkov said recently that Russia has a “possibility for mediation” between U.S. President Donald Trump and Kim Jong Un.

Elaborating on that theme, Dmitry Solonnikov, director of the Institute for Modern State Development, told Economy Today, “Our task is now to prepare a package of positive solutions for the State Department and our MID [Ministry of Foreign Affairs] to carry out.” He suggested that when that package is “introduced to the American establishment, media, international community” it will “demonstrate what constructive cooperation could look like.”

Since 2000, Vladimir Putin’s first year as Russia’s ruler, Moscow and Pyongyang have had a “treaty of friendship, good-neighborliness and cooperation.” The two countries share an 11-mile land border southwest of Vladivostok, and at no time since the disintegration of the Soviet Union have mushroom clouds over the Korean Peninsula been a major Russian fear.

Trade between Moscow and Pyongyang is minuscule: In the fourth quarter of 2016 it amounted to only about $25 million, and that was a major increase over the same period the year before. Interestingly, according to the numbers released by the Russian Federal Customs Service, North Korea bought nuclear reactors, boilers, equipment, and mechanical devices for a mere $152,452. If there were other payments, they were off the books.

While the United Nations worked on sanctions to punish North Korea for building and testing nuclear weapons, Russia’s communist MPs meanwhile praised the totalitarian lifestyle of North Korea’s leader.

In April, State Duma Deputy Kazbek Taisayev took a group of Russian journalists to cover the annual celebrations of The Day of the Sun, the birthday of Kim Il Sung, former leader of North Korea and grandfather of Kim Jong Un.

Rustam Yulbarisov, editor of the Russian publication The Question, told Rain TV that, “Kim Jong Un managed to roll new ballistic missiles on the main square to demonstrate that the country is in ideal physical and military shape.”

In May, President Putin admitted that the missile tests Russia’s friend Pyongyang performed this year were “dangerous.” But he insisted, “We must stop intimidating North Korea and find a peaceful solution to this problem.”

What was Putin’s plan? Go easy on Pyongyang and team up with China to get tough on the United States, all in the name of mediation.

But at the time, North Korea was just about to make a major breakthrough. Previously it had been testing an intermediate range missile called the Musudan that failed repeatedly. But in mid-May, it launched a liquid fuel Hwasong-12, capable of reaching the American territory of Guam or beyond.

Then, to the consternation of the international community, on July 4—Independence Day in the United States—North Korea launched the two-stage Hwasong-14, a true ICBM capable of reaching Alaska. That was followed by the launch of another Hwasong-14 that demonstrated even greater potential range on July 28. The continental United States was coming in range.

Where did impoverished little North Korea get the wherewithal to build such ICBMs, not to mention the nuclear weapons that might someday ride in their nose cones?

International experts have concluded that the rocket engine used by North Korea was of the Soviet-origin RD-250 family, but where the engines came from, and whether they were brought in whole, built from parts, or constructed from scratch based on plans is not clear.

Michael Elleman at the London-based International Institute for Strategic Studies, publishers of The Military Balance, wrote earlier this month that, “No other country has transitioned from a medium-range capability to an ICBM in such a short time,” and concluded North Korea acquired “a high-performance liquid-propellant engine” from “a foreign source.”

“An unknown number of these engines were probably acquired through illicit channels operating in Russia and/or Ukraine,” Elleman wrote, suggesting they probably were acquired in one form or another over the last two years.

But there is evidence the North Korean effort to make such acquisitions dates back much further.

In one known incident in 2011, just before Kim Jong Un took over, following the death of his father, Kim Jong Il, North Korean agents tried to steal an engine from Ukraine that could carry a warhead able to reach all the way to the continental United States.

The Security Service of Ukraine detained two North Korean citizens, Ryu Songchel and Li Tkhekil, who were photographing scientific dissertations classified as “secret.” The Ukrainian services believe the spies wanted to recruit an employee of the Ukrainian state enterprise Yuzhny Machine-Building Plant in order to get the design for missile engines.

Ukrainian courts sentenced Ryu Songchel and Li Tkhekil to eight years in prison for espionage.

Last week, Anton Gerashchenko, an adviser to Ukraine’s interior ministry, told his followers on social networks that both North Korean citizens were still in jail this month, but were supposed to be freed in 2018.

Elleman, in his report for the IISS, noted that North Korea decided to halt its focus on the failing Musudan launcher last year just as Ukraine’s company, Yuzhnoye, a designer of satellites, rockets, and formerly of Soviet ICBMs, experienced a financial crisis. Engine builder Yuzhmash was in trouble as well, and both are based in the Ukrainian city of Dnipro.

Prior to the war in eastern Ukraine that followed Russia’s annexation of Crimea in 2014, “Russia was the biggest buyer of Yuzhmash products for decades,” independent military expert Yevgeny Golts told The Daily Beast. “But the war in Ukraine stopped that cooperation.

“All the secret documents, all the secret designs, were passed through a huge number of hands to a huge number of hands between Russia and Ukraine,” Golts said.

Back in the 1960s, the Soviet Union refused to help North Korea build nuclear weapons, but supported Pyongyang’s peaceful nuclear energy program.

Today both Kiev and Moscow deny they have ever helped Pyongyang to create the analogue of the RD-250 engine. Ukrainian officials referred to allegations as “a provocation” ordered by Russian secret services, but last week Ukrainian President Petro Poroshenko ordered an investigation.

On Friday, Russia’s Roscosmos State Corporation for Space Activities denied that Russia had any cooperation with Kim Jong Un’s military in missile technologies, because that would violate Russia’s laws.

Meanwhile, U.S. intelligence suggested that North Korea could make the engines for intercontinental ballistic missiles without Russia’s help or Ukraine’s. “We have intelligence to suggest that North Korea is not reliant on imports of engines,” a U.S. intelligence official told Reuters.

But that might be more convincing if U.S. intelligence had not been blindsided by the huge advances in North Korean missile technology in the first place.