Scottish independence: 'Both sides win' in referendum deal
When or if the independence referendum deal is finally signed, it will allow both sides to claim victory.
The Scottish government will be able to say Holyrood will control what the people will be asked, when they will be asked it and who gets to answer the question.
So MSPs get to set the referendum timing, the question and extend the franchise allowing 16 and 17 year olds to vote.
Mr Salmond has always said the referendum should "be made in Scotland".
The UK government can say they've listened to what Scots said in the 2011 Scottish parliament election and delivered the powers for a clear and decisive referendum.
Their objective has always been to have a single question: in or out of the political union with the rest of the UK.
A one question referendum with the details left to Holyrood has been increasingly likely as no clearly defined "third option" has emerged.
Devolving more powers to Holyrood is popular, according to opinion polls, but the proposal has lacked a clear sponsor.
The SNP have consulted on the issue but it isn't party policy. The results of that 26,000 strong consultation have still to be published.
The unionist parties insist further substantial devolution would be a decision for the whole of the UK, not just Scotland.
Labour and the Liberal Democrats have set up commissions to look into the issue. David Cameron says he'll discuss it after a no vote.
Exchanged a kiss
So what did they bargain with?
Westminster has the power to make an independence referendum legally certain by transferring authority to hold it to Holyrood.
The Scottish government believed they already had the authority to hold a consultative referendum on more powers if not full independence.
The Scottish government wanted legal certainty. The UK government wanted just one question.
This way the courts are unlikely to get involved.
I am told at their first meeting to negotiate a referendum deal the deputy first minister Nicola Sturgeon and the Scotland office minister David Mundell exchanged a kiss in greeting.
Their efforts look increasingly likely to be sealed with a handshake between prime minister and first minister on Monday.