But the presumption is that if Mr. Kim decided to go ahead, the North would attempt to conduct the test by firing it on a missile, presumably to an empty spot in the Pacific. The goal would be to demonstrate that it had solved all the technological issues involved in delivering a nuclear weapon to an American city.

But that form of testing — putting a live weapon on a missile — is particularly risky. Other countries have blanched at the potential for disaster, Dr. Hecker noted, including the Chinese, who conducted one missile launch with a live nuclear weapon in the warhead. It worked as planned, he said, but “the Chinese considered the risks unacceptable” and never tried it again. In the hands of the North Koreans, some say, it would be even riskier.

“This would be a regional nightmare” for East Asia, said Heather Conley, a former senior State Department official, now at the Center for Strategic and International Studies in Washington.

It is possible the threat will never come to fruition. Detonating a weapon inside a missile warhead, or even from a ship or barge, would be far more difficult for the North than setting one off inside a mountain, where engineers have months to wire up the weapon, and no time pressure.

It would require what experts call a “weaponized device” that could survive shocks, stresses and, if launched from a missile, the heat of re-entry into the atmosphere, something North Korea has never demonstrated it can handle.

“The DPRK would be taking a big risk — missile tests fail,” said Philip E. Coyle III, a nuclear scientist and former head of the Pentagon’s weapons testing. The live nuclear warhead could come down on a neighboring country, or if the missile blew up on the launchpad — as has been known to happen — set off the nuclear warhead in North Korea.

The transportation risks would be enormous, including the chance of an accidental detonation before the nuclear device reached the target zone. And while the world’s best missiles fail roughly once in every 100 flights, the failure rate for the North’s missiles is much higher. Last year, one type of missile failed seven out of eight times, perhaps in part because it had been targeted by a series of cyber attacks ordered by President Barack Obama. Since then, the North has ceased testing that type of missile and been more successful with others.