The main elements of a satisfactory end to the North Korean nuclear crisis have been in place for more than a decade.
North Korea receives economic assistance, especially energy assistance such as fuel oil or electricity. Nuclear supplier states promise to explore assisting it in building a light water nuclear power plant. North Korea's sovereignty is clearly acknowledged and security assurances that take regime change off the table are provided.
In return, North Korea commits to a denuclearized Korean Peninsula, terminates all military nuclear programs, places all its nuclear programs and facilities under full international inspections to confirm that none support military objectives, and returns to the Nuclear Non-Proliferation Treaty (NPT) as a non-nuclear weapon state.
That was essentially the arrangement under the 1994 "framework agreement" between Pyongyang and the Clinton Administration.  Its core elements held until 2002 when the Bush Administration imposed unilateral sanctions in response to North Korea's currency abuses, included North Korea in the famous "axis of evil," and used the Pentagon's nuclear posture review to issue thinly veiled nuclear threats against North Korea, Iran, and other states in Washington's bad books. TheUSalso accused North Korea of mounting a uranium enrichment effort with help from Pakistan's famous nuclear smuggler A.Q. Khan, but the Koreans denied it and to date no public evidence of the program has been presented.
Former President Jimmy Carter, who has served as an informal envoy to North Korea during the Clinton Administration and beyond, found North Korea's precipitous response - expulsion of the inspectors, resumption of the production of nuclear bomb materials, and withdrawal from the NPT - fully predictable.  The North, he says, has always responded more favorably to positive inducements, especially those that are understood to take regime-change strategies off the table.
The same deal of positive inducements and commitment to a denuclearized Korean peninsula was again agreed to by North Korea in the September 2005 Joint Statement by the parties to the Six-Nation talks.  The 1994 and 2005 agreements stated the deal in terms of the positive commitments made by all the parties. The UN Security Council Resolution No. 1718, unanimously adopted October 14, 2006 following North Korea's October 9 nuclear warhead test, repeats the deal but focuses on the negative consequences that are to be visited on North Korea until it meets the central demand to end all military programs and return to the NPT under safeguard inspections. Until that time, it will be denied economic cooperation and a broad range of punitive economic measures will be imposed. 
What could be simpler? It is really only a matter of managing the appropriate mix of threats and incentives. But that's where it gets complicated. The North Korean regime regards itself as largely immune to military attack - not because of its elementary nuclear weapons capability, but because of its million-strong conventional army. That army would not save it in any war, but it would guarantee a level of such extraordinary devastation that its neighbors continue to conclude that any militarily forced end to the regime would be much worse than the status quo.
Kim Jong-il's fierce resistance to threats is not evidence of his presumed invulnerability, but of his view that threats and punitive sanctions show that the US, and now also the Security Council, is reneging on those elements of the September agreement that call for security assurances and normalization of relations. In the Joint Statement the US affirmed that it "has no intention to attack or invade the DPRK with nuclear or conventional weapons," and agreed that the two countries would "respect each other's sovereignty, exist peacefully together, and take steps to normalize their relations subject to their respective bilateral policies."
For Resolution 1718 to be implemented, the United States will once again have to provide North Korea clear security assurances and evidence of progress towards the normalization of relations, including a relaxation of unilateral sanctions which effectively block North Korea from all access to international financial institutions.
But nuclear weapon states will also have to make some changes - perhaps not to get the current deal outlined in Resolution 1718, but certainly if non-proliferation is to be honored in the long run.
You can't persuasively preach temperance from a bar stool, but that is exactly what the UN Security Council is trying to do. All five permanent members of the Council (P5) are recognized as nuclear weapon states under the NPT and as such are obliged to dismantle their nuclear arsenals according to Article VI of the Treaty and as confirmed in the 1996 World Court opinion.  In 2000 they reaffirmed their rhetorical commitment to abolish nuclear weapons - through their "unequivocal undertaking," at the NPT Review Conference, "to accomplish the total elimination of their nuclear arsenals leading to nuclear disarmament"  - but the P5 remain determined nuclear retentionists.
China and the United States refuse to ratify the comprehensive nuclear test ban treaty, even though they obviously want North Korea and all other states to abide by it. They refuse to negotiate an agreement to cut-off the production of fissile materials from weapons purposes, even though they obviously want North Korea and all others states to end all production of such fissile materials. All five continue to modernize their arsenals, elaborate nuclear use doctrines, and pursue selective non-proliferation (e.g. accepting nuclear testing in some cases, such as India and Pakistan, while opposing even the development of civilian nuclear fuel technologies in others).
Mohamed ElBaradei, Nobel Peace Laureate and Director of the International Atomic Energy Agency, agrees that a roll back of North Korea's bomb is both essential and eminently achievable. He emphasizes dialogue and security assurances and is wary of punitive sanctions: "Once you start applying penalties, it brings hardliners into the driver's seat." 
We can also add that it wouldn't hurt if the advocates of nuclear temperance in North Korea would begin to address their own addictions.
 "Little is known about North Korea's alleged uranium enrichment program--where it might be located, its state of development, or how many centrifuges might be operational. The United States has not provided any public information that substantiates its existence. Following the U.S. manipulation and distortion of intelligence about Iraq's weapons of mass destruction, some countries and analysts are now skeptical of any U.S. allegations regarding other nations' nuclear programs.  A March 20 Washington Post report that the White House misrepresented intelligence on the supposed transfer of nuclear material from North Korea to Libya may have further undermined the Bush administration's credibility, even though the White House denied the report."
"North Korea's nuclear program, 2005,By Robert S. Norris and Hans M. Kristensen
May/June 2005 pp. 64-67 (vol. 61, no. 03) ¬© 2005 Bulletin of the Atomic Scientists.
 Carter, Jimmy. 2006. Solving the Korean stalemate, one step at a time, The New York Times, October 11.http://www.nytimes.com/2006/10/11/opinion/11carter.html?_r=1&oref=slogin.
 Joint Statement of the Fourth Round of the Six-Party Talks, Beijing, September 19, 2005. 2005.http://www.state.gov/r/pa/prs/ps/2005/53490.htm.
 United Nations Security Council. 2006. Resolution 1718. October 14. http://daccessdds.un.org/doc/UNDOC/GEN/N06/572/07/PDF/N0657207.pdf?OpenElement.
 International Court of Justice. 1996. Legality of the Threat or Use of Nuclear Weapons. Advisory Opinion. Found at The Lawyers' Committee on Nuclear Policy.http://www.lcnp.org/wcourt/opinion.htm.
 NPT. 2000. 2000 Review Conference of the Parties to the Treaty on the Non-Proliferation of Nuclear Weapons Final Document.http://disarmament.un.org/wmd/npt/2000FD.pdf.
 "ElBaradei warns on sanctions on N. Korea, Iran," Reuters, October 23, 2006.